Question

How to automate email notifications with embedded map and text

  • 4 October 2020
  • 6 replies
  • 14 views

Badge +5

I am working on a project that involves sending an email notification to a series of email addresses with a text body and embedded map of the area impacted. I am having a hard time pulling together examples to get this done.

 

The embedded map would include:

  • a background image (either ESRI basemap or using our internal ESRI raster mosiacs)
  • a series of ESRI SDE points, lines and polygons (some having labels)
  • both the image and vector data would be clipped to a specific boundary (usually no more than 1500 acres (~600 HA)

 

I am assuming that the embedded map within the email would need to be a jpeg, png, etc. But I could be assuming incorrectly...

 

The main item that I am struggling with (at least now) is the creation of the map. I am also struggling with bringing in an ESRI basemap or connecting to our mosaics without it reading the entire mosaic.

 

I am running FME Desktop 2020.0 and have a FME Server 2020.0 newly stood up and running some automations. I would appreciate any help that you are willing to give - examples, documentation, even interpretive dance if it helps.


6 replies

Userlevel 4
Badge +25

Just for clarification, would you need a dynamic map or will a static image be enough? The thing is that email clients generally don't like to load external scripts and stuff.

Badge +5

Just for clarification, would you need a dynamic map or will a static image be enough? The thing is that email clients generally don't like to load external scripts and stuff.

A static image would be enough.

Userlevel 4
Badge +25

A static image would be enough.

Okay, I'll save you my interpretive dance version of the story (but can do hand-puppets if you like 😉 )

 

In broad terms:

  1. Get the extents of the map you want to make
  2. Use that as a initiator feature to read your base map using a FeatureReader. I'm assuming you can access it through a WMS or other way that FME supports.
  3. Same thing for the vector data
  4. Then use a MapnikRasterizer (will not work on Linux-based FME Server), ImageRasterizer or VectorOnRasterOverlayer to create the map
  5. Save that somewhere online, using a FeatureWriter. You're right, PNG or JPG are best, depending on your base map. If that's like a satellite image or aerial photo JPG will work best, if it's more mappy then PNG might be better.
  6. Add an <img> tag to the email body

Hope this helps.

Badge +5

A static image would be enough.

Thank you for your response. Here is where I am still having issues:

  • I have a sample bounding box and I can get a clipped image output from a MrSID image Reader but when I try to push that same bounding box into a FeatureReader, it takes a very long time to return the image to move to the next transformer. What I would really like to do is connect to an ESRI basemap, pass in the bounding box and pass the image output to the next step. I am assuming the performance would be better. Does anyone have an example of connecting to an ESRI basemap and clipping out an image to use within a map?
  • I am comfortable with the vector data (accessing, clipping, reprojecting, etc)
  • I have pushed a polygon, point and small clipped MrSid raster into the MapnikRasterizer but it takes about 10 min to process - so I am doing something wrong there...
  • I am not getting very far with the ImageRasterizer or VectorOnRasterOverlayer - does anyone have examples that they are willing to share?
Badge +1

Just for clarification, would you need a dynamic map or will a static image be enough? The thing is that email clients generally don't like to load external scripts and stuff.

Hey, in a case that someone need to add a dynamic map (for better context) what would be the best approach?

Badge +16

Hey, in a case that someone need to add a dynamic map (for better context) what would be the best approach?

The REST API for an Esri Online or Portal map service can export an image and return it.

https://developers.arcgis.com/rest/services-reference/enterprise/map-service.htm

 

Reply