Opened 12 years ago
Closed 12 years ago
#4536 closed defect (fixed)
gdal2tiles.py does not generate valid KML (OGC KML 2.2)
Reported by: | tylere | Owned by: | hobu |
---|---|---|---|
Priority: | normal | Milestone: | 1.10.0 |
Component: | Utilities | Version: | svn-trunk |
Severity: | normal | Keywords: | gdal2tiles KML |
Cc: |
Description
The gdal2tiles.py script does not currently generate KML documents that are valid against the current OGC standard schema (http://schemas.opengis.net/kml/2.2.0/ogckml22.xsd). In particular:
- the default XML namespace is incorrect
- the <name> element should not be capitalized
- the <description> element should not be capitalized
- within a <Region> element, the <LatLonAltBox> element should occur before the <Lod> element
A patch correcting these issues is attached.
Attachments (1)
Change History (5)
comment:1 by , 12 years ago
comment:2 by , 12 years ago
Are you sure that the patch is correct as such ? I see you are inverting the order of some elements in the string, but you should also likely adapt the order of the values that will substitute the %d and similar stuff.
In particular, I believe that line 1631 should be changed like this ( argsminlodpixels moved after cwest) :
""" % (cz, cx, cy, args['tileformat'], cnorth, csouth, ceast, cwest, args['minlodpixels'], url, cz, cx, cy)
comment:3 by , 12 years ago
You are correct. Even though it is now creating valid KML, the element attributes are not correct (since I did not reorder the format string parameters). I will correct and add/replace the current patch.
by , 12 years ago
Attachment: | gdal2tiles_valid_ogc_kml.patch added |
---|
comment:4 by , 12 years ago
Component: | PythonBindings → Utilities |
---|---|
Milestone: | → 2.0.0 |
Resolution: | → fixed |
Status: | new → closed |
Note that Google Earth will silently accept many invalid KML files if the default settings are used. Select Tools->Options->General->KML Error Handling->"Show prompts for all error" to be notified of invalid KML.