Skip to main content
Solved

How do I save images and then include those images in a popup in a KML for use in a data download service?


runneals
Contributor
Forum|alt.badge.img+19

I worked with one of our interns on developing a pretty simple workbench that queries records from a REST service using a project #, styling the popups and icons, and writes it out to a KML that is then downloaded from FME server using the data download service. I have exposed the attachment from ArcGIS Online and have the process worked out for converting them to base64.

 

The next part that I'm needing help with (why I posted this) is determine the best way to embed the photos in the popup, which are varying content subtypes of image (image/png, image/jpeg, image/jpg, etc). I've attempted (unsuccessfully) to embed the base64 image in html, but it doesn't seem to load. I think the best way would be to save the images in a folder, and somehow reference the local image path in the kml popup... Both the KML and Images would be downloaded through the published data download service.

Best answer by runneals

debbiatsafe wrote:

Hi @runneals​ 

I would recommend taking a look at the second example of this Embedding Images in HTML with FME article if you wish to embed base64 encoded images in KML. The article and the accompanying workspaces were made 2013(!) but the workspace still works in 2021. I hope this helps!

kmlHere's the workflow that I used... Useful for when working with ArcGIS Online, ArcGIS Portal, or ArcGIS Server REST services with attached attachments. I forgot I had done this previously but for emails. You may need to initially click on the images and login to AGOL/Portal/Server when using this method, but it works pretty well, you don't have to worry about images and this is the easiest way to deal with security. There is a private parameter that I set (ServiceURL) that points to the service, to allow ultimate flexibility. In the attached screenshot, the /0/ refers to the layer # that can be found within the REST service.

View original
Did this help you find an answer to your question?

4 replies

gazza
Contributor
Forum|alt.badge.img+6
  • Contributor
  • March 23, 2021

I think you are on the right track with embedding the image in the kml. I have done this before, I'll see if I can find the workspace for you.


gazza
Contributor
Forum|alt.badge.img+6
  • Contributor
  • March 23, 2021
gazza wrote:

I think you are on the right track with embedding the image in the kml. I have done this before, I'll see if I can find the workspace for you.

Turns out it was one of our clients that has done this before. I have their workspace and have asked if I can share it but I'll at least be able to figure out where you are failing.


debbiatsafe
Safer
Forum|alt.badge.img+20

Hi @runneals​ 

I would recommend taking a look at the second example of this Embedding Images in HTML with FME article if you wish to embed base64 encoded images in KML. The article and the accompanying workspaces were made 2013(!) but the workspace still works in 2021. I hope this helps!


runneals
Contributor
Forum|alt.badge.img+19
  • Author
  • Contributor
  • Best Answer
  • March 25, 2021
debbiatsafe wrote:

Hi @runneals​ 

I would recommend taking a look at the second example of this Embedding Images in HTML with FME article if you wish to embed base64 encoded images in KML. The article and the accompanying workspaces were made 2013(!) but the workspace still works in 2021. I hope this helps!

kmlHere's the workflow that I used... Useful for when working with ArcGIS Online, ArcGIS Portal, or ArcGIS Server REST services with attached attachments. I forgot I had done this previously but for emails. You may need to initially click on the images and login to AGOL/Portal/Server when using this method, but it works pretty well, you don't have to worry about images and this is the easiest way to deal with security. There is a private parameter that I set (ServiceURL) that points to the service, to allow ultimate flexibility. In the attached screenshot, the /0/ refers to the layer # that can be found within the REST service.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings