1

Even with top notch pure KML straight from the horse's mouth,
https://developers.google.com/static/kml/documentation/KML_Samples.kml
ogrinfo still shows plenty of worrisome "Unknown Geometry" output:

$ ogrinfo -al KML_Samples.kml | grep Geometry | uniq --count
     10 Geometry: Unknown (any)

Should I feel bad?

OK, each high level section of a KML file,

$ egrep --count '^  <Document>|<Folder>' KML_Samples.kml
10

doesn't have an individual geometry, because they are all WGS84 by definition, right? So maybe ogrinfo should say something different, or even nothing?

1 Answer 1

4

This is the geometry type - not the coordinate reference.

Because KML layers can contain mixtures of geometry types (ie points, lines and polygons can all be in the same layer) GDAL returns this "Unknown (any)" type.

GDAL could in theory spin through all the features in the layer and report something else if all the features were the same type, but that could be intensive and isn't something you might want to do on a networked KML source.

For other data types where ogrinfo does return a singular data type, GDAL will have found something in a header or other metadata that describes the feature format, and it will trust that. For example, there's some bytes in the shapefile that give this, and so GDAL doesn't have to scan all the features.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.