EXIF to KML with Geotag for OpenStreetMap in WordPress

There are several ways to display your geotagged photos in a map. One way is to export the EXIF information of your JPG photos automatically with Geotag. The abbreviation KML ist not shown in the tool, but you get it if you choose Google Earth => Ausgewählte Bilder exportieren.

EXIF to KML with Geotag

Geotag tool can export EXIF to KML files for the OSM Plugin

I modified the generated KML-file for two reasons:

  • changed the icon from Google-icon to an icon of Map Icons Collection (for legal reasons)
  • changed the placemark for the popup as the size was not correct

Change the marker

from:

<href>http://maps.google.com/mapfiles/kml/pal4/icon46.png</href>

to:

<href>http://MyDomain/wp-content/plugins/osm/icons/mic_photo_icon.png</href>

With “replace all” I modified the description (added a div and changed the location of the JPG files):

from:

<description>&lt;a href=&quot;/home/mika/MyPrograms/jpeg2kml/Fotos/20130404_150830_HDR.jpg&quot;&gt;&lt;img src=&quot;/home/mika/MyPrograms/jpeg2kml/Fotos/20130404_150830_HDR.jpg&quot; width=&quot;150&quot;/&gt;&lt;/a&gt;</description>

to (added a div for the size):

 <description>&lt;div style=&quot;width:150px;height:140px&quot;&gt;
&lt;a href=&quot;http://MyDomain/wp-content/uploads/osm_map/20130404_150830_HDR.jpg&quot;&gt;&lt;img src=&quot;http://MyDomain/wp-content/uploads/osm_map/20130404_150830_HDR.jpg&quot;&gt;&lt;/a&gt;&lt;/div&gt;</description>

The KML file can be displayed with the WP OSM Plugin like this:

[*osm_map lat=”27.354″ lon=”88.206″ zoom=”12″ width=”350″ height=”350″ control=”mouseposition,scaleline” map_border=”thin solid grey” theme=”dark”  kml_file=”../../../../wp-content/uploads/osm_map/Test_It.kml”]

[osm_map lat=”27.354″ lon=”88.206″ zoom=”12″ width=”350″ height=”350″ control=”mouseposition,scaleline” map_border=”thin solid grey” theme=”dark”  kml_file=”../../../../wp-content/uploads/osm_map/Test_It.kml”]Click on the camera / on the pic in the popup.

Autotest

[osm_map lat=”27.354″ lon=”88.206″ zoom=”12″ width=”350″ height=”350″ control=”mouseposition,scaleline” map_border=”thin solid grey” theme=”dark”  kml_file=”../../../../wp-content/uploads/osm_map/Test_It_02.kml”]

Post your comment in the Forum (DE / EN)

Posted in tutorial

Leave a Reply

Your email address will not be published. Required fields are marked *

*