Bug report #3272
KML export is malformed
|Affected QGIS version:||master||Regression?:||No|
|Operating System:||OS X||Easy fix?:||No|
|Pull Request or Patch supplied:||No||Resolution:||fixed/implemented|
|Crashes QGIS or corrupts data:||No||Copied to github as #:||13332|
The first four rows of an layer exported as KML read as follows:
<?xml version="1.0" encoding="utf-8" ?> <kml xmlns="http://www.opengis.net/kml/2.2"> <Document><Folder><name>test</name> <Schema name="test" id="test"> ...
The <Schema> element is not a valid child of <Folder>. It should be a child of <Document>.
This doesn't by itself cause any rendering issues, but if a <Style> declaration is added after the <Schema> (which is normally correct) the styles will fail to render.
#1 Updated by barryrowlingson - almost 10 years ago
There's a handy KML validator here:
which spots the Schema nesting problem and also points me to the OGC standard which says the type has to be like type="xsd:string", whereas qgis is generating type="string". Fixer might want to fix this too. Even the Google KML examples don't have this!
#6 Updated by Médéric RIBREUX almost 5 years ago
- Pull Request or Patch supplied set to No
- Status changed from Open to Closed
- Assignee deleted (
- % Done changed from 0 to 100
- Resolution set to fixed/implemented
Hello, bug triage...
the KML export is now made with OGR and Schema is not a child of Folder anymore:
<?xml version="1.0" encoding="utf-8" ?> <kml xmlns="http://www.opengis.net/kml/2.2"> <Document id="root_doc"> <Schema name="testkml" id="testkml"> <SimpleField name="ID" type="int"></SimpleField> <SimpleField name="POLY_NUM_A" type="float"></SimpleField> <SimpleField name="POLY_ST_A" type="string"></SimpleField> </Schema> <Folder><name>testkml</name>
I am closing this bug.