[gdal-dev] converting KML to CSV

Frank Warmerdam warmerdam at pobox.com
Mon Nov 10 16:10:45 EST 2008


Markus Neteler wrote:
> On Tue, May 20, 2008 at 3:25 PM, Frank Warmerdam <warmerdam at pobox.com> wrote:
>> Tim Michelsen wrote:
>>> Hello,
>>> I'd like to convert KML back to CSV.
>>>
>>> When I issue
>>> ogr2ogr -f CSV out.csv in.kml
>>>
>>> there are no coordinates written to the CSV file. Only the placemark names
>>> are
>>> written.
>>>
>>> How can I get ogr2ogr to create a file like
>>> Latitude,Longitude,Name
>>> 48.1,0.25,"First point"
>>> 49.2,1.1,"Second point"
>>> 47.5,0.75,"Third point"
>> Tim,
>>
>> The CSV driver does not support writing geometries, though I can see some
>> support for this might be desirable.
> 
> Frank,
> 
> I would need the same... is there any work-around (or would it be a
> pain to add that)?

Markus,

As a workaround you could write a script that would essentially .csv with
a WKT column.  It would not be hard to add directly in the .csv driver but
I'm not all that keen on doing it myself.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent



More information about the gdal-dev mailing list