[gdal-dev] converting csv to kml: locations displaced in Google Earth

Tim Michelsen timmichelsen at gmx-topmail.de
Thu Jan 10 15:54:09 EST 2008


Hello,
I would like to convert a csv file to kml. When I load the resulting KML
into Googleearth (GE) the generated placemarks inside the file are
totally displaced.
What could be the reason?
Could it be that XML decription is used too old?

When I export my places from GE I read this line:
<kml xmlns="http://earth.google.com/kml/2.1">

In the generated KML file I can read:
<kml xmlns="http://earth.google.com/kml/2.0">

Here are the test files:
Latitude,Longitude,Name
48.1,0.25,"First point"
49.2,1.1,"Second point"
47.5,0.75,"Third point"

the command line I used:
ogr2ogr -f "KML" test.kml test.csv

the KML:
<?xml version="1.0" encoding="utf-8" ?>
<kml xmlns="http://earth.google.com/kml/2.0">
<Document><Folder><name>test</name>
     <Placemark>
       <description><![CDATA[
         <b>Latitude:</b> <i>48.1</i><br />
         <b>Longitude:</b> <i>0.25</i><br />
         <b>Name:</b> <i>First point</i><br />
      ]]></description>  </Placemark>
     <Placemark>
       <description><![CDATA[
         <b>Latitude:</b> <i>49.2</i><br />
         <b>Longitude:</b> <i>1.1</i><br />
         <b>Name:</b> <i>Second point</i><br />
      ]]></description>  </Placemark>
     <Placemark>
       <description><![CDATA[
         <b>Latitude:</b> <i>47.5</i><br />
         <b>Longitude:</b> <i>0.75</i><br />
         <b>Name:</b> <i>Third point</i><br />
      ]]></description>  </Placemark>
</Folder></Document></kml>

Attached you find the screenshot from GE.

I would highly appreciate your hints and help.

Kind regards,
Timmie

P.S. The Mailserver would let my inital mail through. This one comes 
with a smaller image.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test-kml_google-earth_full_small.jpg
Type: image/jpeg
Size: 11901 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/gdal-dev/attachments/20080110/d5390d79/test-kml_google-earth_full_small.jpg


More information about the gdal-dev mailing list