Hello everyone:
I have been working with the pygplates package from pygplates_rev28_python38_win64, and I encountered the problem with finding all segments of a latitudinal line which intersect a polygon feature. I attach the picture below to demonstrate the issue:
In the picture, the gray lines are latitudinal lines. The boundary of the polygon is highlighted in white. All segments of the latitudinal lines that pygplates.PolygonOnSphere.partition module identified as geometries positioned inside the polygon are highlight in bright green. There are segments of latitudinal lines should have also been identified as geometries positioned inside the polygon; however, they were misidentified as geometries positioned outside the polygon.
May I please ask for your help?
Thank you very much for your time and your support.
Hi Lavie,
Can you send me your code to reproduce the problem? You can use a Personal Message if you like.
I’ll be releasing pyGPlates 1.0 early next week (so if I can fix it before then, that’d be great).
Hi Lavie,
Thanks for sending the code and data! I was able to reproduce the problem.
This is actually due to the same issue noted in PolygonOnSphere.partition() - see the Warning about the limited support for partitioning polygons.
Although, in your case, you are partitioning polylines (not polygons), but still, the polygon in your screenshot actually has a spurious vertex that’s triggering the same kind of issue…
…where there’s a degenerate line circled in red.
The best workaround is to remove the unneeded vertex (pointed by red arrow) in the polygon. There’s actually two vertices in the same location. I tried doing this with GPlates but somehow the vertices kept reappearing (after I saved the Shapefile with the changes and then reloaded it). Not sure what’s happening there. So you might need to use another GIS to remove it.
In the longer term, we plan to address the warning mentioned in PolygonOnSphere.partition() by doing proper intersection of polygons (and handling any interior polygon holes). That should also fix this issue.
Dear John, thank you very much for sincerely supporting us and addressing this issue.