Skip to content

Problem using polygon with multiple inner boundaries #13

@OlavAa

Description

@OlavAa

As I am fairly new to python in general and only worked with simpleKml for a few weeks I recently asked for advice here:
https://gis.stackexchange.com/questions/447853/simplekml-adding-polygons-with-multiple-innerboundaries-works-for-google-earth

SimpleKml offers an effective way to write the code to create the KML file for my bathymetric maps. And right now I have almost achieved the desired result. But this final problem with multiple inner boundaries I need to solve as Google Maps for Android simply cannot handle the KML structure properly: I either fix this, or drop the use of simpleKml and start looking for alternatives.

As demonstrated in the above link: The problem I experience with Google Maps for Android as compared to Google Earth is that filled polygons are not added to the map in any particular order. Thus, polygons for a colored bathymetric map needs to be built with both outer and inner boundaries. As seen in the link (bottom part with my sample code) I add the inner boundaries to an array (also tried list) and declare them as "innerboundaryis" to polygon objects at the end. My problem is however how the resulting inner boundaries ends up in the KML file:

  • I get: A single innerboundaryis is with multiple LinearRing objects inside
  • Instead of the needed: Multiple innerboundaryis with a single LinerarRing object inside each

While Google Earth handles both alternatives with ease, Google Maps for Android only properly handles the latter.

Is there any way at all for me to write the code differently to achieve the (for Google Maps Android) mandatory "one innerboundaryis for each inner polygon"?

The response received so far to the question on gis stack exchange suggests simpleKml may have implemented multiple inner boundaries wrong and that the KML specification may be interpreted to support the second bullet above. At least, this is how Google Maps for Android seems to expect the structure.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions