arthur-e / Wicket

A modest library for moving between Well-Known Text (WKT) and various framework geometries
https://arthur-e.github.io/Wicket/
Other
586 stars 226 forks source link

Fix ArcGIS polygon from WKT multipolygon #114

Closed rebelzach closed 6 years ago

rebelzach commented 6 years ago

After encountering a MULTIPOLYGON that has a few polygon features, one with a hole. ArcGIS wouldn't draw the Polygon created by Wicket. I compared the output of Wicket to that of ArcGIS server. ArcGIS server appears to be flattening the ring hierarchy, and indeed Wicket's deconstruction to WKT seems to expect this. However when creating the ArcGIS Polygon Wicket did not perform the same flattening. This PR performs the flattening however doesn't make any checks for directionality not sure if its necessary anyway since the WKT standard defines the directionality as well as ordinality of the rings.

Let me know if I'm off base, but it appears even the arcgis demo page is affected by this issue.

All the best.

arthur-e commented 6 years ago

I wish we had a test suite for ArcGIS in the style of those for Google Maps. I'm not qualified to build those tests at this time. @rebelzach Do you have the time to add tests cases?

rebelzach commented 6 years ago

I do have some time to put those tests together. I can't say exactly when, but I'll work to get these together, I'll use output from ArcGis Server as the standard for what the output from the conversions should look like. I'll plan on adding them to this branch.