samcragg / sharpkml

SharpKML is an implementation of the Open Geospatial Consortium (OGC) KML 2.2 standard developed in C#, able to read/write both KML files and KMZ files.
MIT License
158 stars 51 forks source link

Unrecognized namespace #24

Closed terribletim closed 4 years ago

terribletim commented 4 years ago

kmlFile.Root is null when attempting to load USGS static kml - ColouredByAge

It appears that namespace http://earth.google.com/kml/2.2 is not recognized. File will load if namespace is edited to "http://www.opengis.net/kml/2.2"

samcragg commented 4 years ago

Unfortunately the library is working as expected in this scenario, as the namespace is wrong. However there is another way to parse these files, see LegacyFiles for an example.

I hope that helps.

terribletim commented 4 years ago

Thanks for info. It's a useful approach if you have the opportunity to inspect the file beforehand. But it's not suitable when trying to consume a web resource directly.