[gdal-dev] Unable to extract features from KML

Michael Z Freeman michael-gdal at michaelzfreeman.org
Sun Nov 20 11:07:58 PST 2016


Hi,

Even through "ogrinfo" can see all the fields and the features in my KML I
can never get ogr2ogr to actually give me the feature info that I want:
name, description, point, polygon. The only format that actually shows is
JSON but that is a real pain to import into PostGreSQL. CSV and PostGreSQL
get to the "MultiGeometry" KML that contains POINT and POLYGON and then
seem to give up.

I am quite new to GDAL and spent some time working through manuals, FAQ
and did a list search and can only find "Re: missing point in
MultiGeometry KML file" which may be a solution as the answer specifies
having to have "<coordinates>" in triplets and lo and behold the source
KML is missing the "Z" dimension that should be set to 0. However a test I
did adding the third triplet still gives the same results.

Any help very much appreciated.

GDAL 1.11.3, released 2015/09/16

PRIMARY KML FEED (REGIONATED):
http://pirlwww.lpl.arizona.edu/~rbeyer/kml/HiRISE_PDS.kml

KML FEED WEBPAGE: http://rossbeyer.net/science/kml/

EXTRACTED REGION: http://files.michaelzfreeman.org/MC-01-0-0-0.kml

USED COMMANDS:

ogrinfo -ro fields=YES -geom=YES Beyer_Hirise_Areas_KML/MC-01-0-0-0.kml >
ogrinfo_hirise.txt

ogr2ogr -f PGDump output_pgdump Beyer_Hirise_Areas_KML/MC-01-0-0-0.kml

ogr2ogr -f CSV output.csv Beyer_Hirise_Areas_KML/MC-01-0-0-0.kml

http://files.michaelzfreeman.org/ogrinfo_hirise.txt

http://files.michaelzfreeman.org/output_pgdump

http://files.michaelzfreeman.org/output.csv

---

Michael Z Freeman
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: ogrinfo_hirise.txt
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20161120/9e33a62d/attachment-0001.txt>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: output.csv
Type: text/comma-separated-values
Size: 9039 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20161120/9e33a62d/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: output_pgdump
Type: application/octet-stream
Size: 22524 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20161120/9e33a62d/attachment-0001.obj>


More information about the gdal-dev mailing list