earthenterprise
earthenterprise copied to clipboard
Cutter does not properly handle a multigeometry KML and does not report an error
Reproduction: I created a Mercator map with the blue marble imagery plus two high resolution images of areas about the size of a small town. Note that they were not adjacent to one another but were in the same general area. Also note that the high resolution images had resolution levels of 19 as reported by Fusion when I created the map.
I created a multigeometry KML file (attached as a text file) that defined two polygons -- one for each of the high resolution areas. I opened cutter and selected the Mercator map described above. For the "select region" option I pasted in the multigeometry KML. Cutter correctly showed the two polygons defined in the KML. I specified a "World level" and "Region level" of 20 and clicked "cut map". After it completed I copied the GLM file to the data directory for portable and loaded the GLM in portable. I zoomed to the region where the high resolution imagery should have been and all that was there was low resolution blue marble imagery.
If a multigeometry KML is not supported then cutter should generate an error message. If a multigeometry KML is supported then this issue needs to be fixed.
Q: Did you verify that the polygons have the right vertex winding order?
@tst-ppenev I'm not sure what the correct vertex winding order is. I used this page to construct the verticies from the information I had for the images: https://stackoverflow.com/questions/22473612/how-can-i-calculate-the-bounding-box-corners-for-a-group-of-xy-coordinates. From that page, "The bounding box has corners in (minx, miny), (minx, maxy), (maxx, maxy), (maxx, miny)". Is that the correct order?
The two polygons showed correctly in the cutter window when I pasted the KML.
Some implementations require that outer boundaries are specified in, e.g., counter-clockwise order, and inner boundaries in, e.g., the opposite order. I don't know what implementation Cutter uses.
According to the KML documentation at https://developers.google.com/kml/documentation/kmlreference#description_157, the proper order is counterclockwise. I verified that the vertices of the two polygons are in that order.
I did find one thing in my KML file that I thought might be a problem but I corrected it and the result is the same. The updated version of the KML is attached to this comment.
Thanks for checking, @tst-blaird.
I believe previous Cutter tests used this sample to test support for polygons with holes:
https://github.com/googlemaps/kml-samples/blob/gh-pages/kml/Polygon/tennis-poly.kml
I did not think we changed that code during the last release cycle, but, maybe there is a new bug, or it is an old bug.
Note to the person that tries to fix this issue: Retest the scenario first to see if this might have been fixed by the change for #1012.