Bug report #5357

kml innerBoundaryIs

Added by Chris Chaudoir over 12 years ago. Updated over 12 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:-
Affected QGIS version:master Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:wontfix
Crashes QGIS or corrupts data:No Copied to github as #:15052

Description

When importing a kml vector layer, the parser only recognizes the first of multiple linear rings nested within a single set of innerBoundaryIs tags.

For example:

<outerBoundaryIs>
<LinearRing>
<coordinates> {Big poygon}
</coordinates>
</LinearRing>
</outerBoundaryIs>
<innerBoundaryIs>
<LinearRing>
<coordinates> {1st hole in Big polygon}
</coordinates>
</LinearRing>
<LinearRing>
<coordinates> {This second hole is being ignored}
</coordinates>
</LinearRing>
</innerBoundaryIs>

Note, the parser will recognize the 2nd hole, if it is withing a 2nd set of innerBoundaryIs tags, but combining multiple holes within a single set of innerBoundaryIs tags is legal, more efficient, and how Google Earth exports kml layers.

example.kml (14.9 KB) Chris Chaudoir, 2012-04-14 06:21 PM

fromshp.kml (1.64 KB) Richard Duivenvoorde, 2012-04-15 04:47 AM

51.kml - 51 dBW EIRP contour for Telsat T12 European downlink (15 KB) Chris Chaudoir, 2012-04-15 05:22 AM

History

#1 Updated by Giovanni Manghi over 12 years ago

  • Status changed from Open to Feedback

Hi, is this a QGIS issue or an ogr one?

#2 Updated by Richard Duivenvoorde over 12 years ago

Although the kml you sent is viewable in GoogleEarth, I think your kml is not valid.
Where did you get it from?

Even GoogleMaps is showing just one of the innerrings. you can check via this url:

http://maps.google.com/?q=https://issues.qgis.org/attachments/4394/example.kml

Both qgis and ogr2ogr show and or generate a polygon with just one hole.

This online validator is also complaining http://kmlvalidator.com/home.htm if you give it https://issues.qgis.org/attachments/4394/example.kml

BUT if I create a shapefile in qgis with a polygon with several holes, AND i save this polygon as a KML, qgis shows all holes.

I attach my example here fromshp.kml

As you can see it has a different layout for the innnerrings:

      <Polygon>
        <outerBoundaryIs>
            <LinearRing>
                <coordinates>-...</coordinates>
            </LinearRing>
        </outerBoundaryIs>
        <innerBoundaryIs>
            <LinearRing>
                <coordinates>...</coordinates>
            </LinearRing>
        </innerBoundaryIs>
        <innerBoundaryIs>
            <LinearRing>
                <coordinates>...</coordinates>
            </LinearRing>
        </innerBoundaryIs>
      </Polygon>

I will close this ticket as I think it is not a QGIS bug

#3 Updated by Richard Duivenvoorde over 12 years ago

  • Status changed from Feedback to Closed

#4 Updated by Chris Chaudoir over 12 years ago

I now think this must be a Google Earth bug. The example file I submitted was exported from (Save As) Google Earth. The initial file (correctly tagged) I generated using text editor, by pasting-in the holes, each inside its own innerBoundaryIs tag.

I could open the initial file correctly in QGIS and Google Earth. But when saved the layer using Google Earth (the example file I submitted), the three sets of tags are replaced by a single tag that encloses all three holes.

Thanks for the help, and sorry this took up your time.

Attached is the original file I created, which is formatted correctly.

Also available in: Atom PDF