-
Notifications
You must be signed in to change notification settings - Fork 582
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MultiPolygon and right hand rule #782
Comments
Any way you can share the file? What did you use to create the geojson with Multipolygons? |
Hi Chris, I used geojson.io for the geojson creation; starting from a single polygon i change type from polygon to multipolygon and then i've placed the second poly array. No problem. But today when i try to do the same, i've got this error: This is the whole GeoJSON:
I also used https://mapstertech.github.io/mapster-right-hand-rule-fixer/ to parse point in the correct order. And it works. I'not a programmer but i understand that right hand rule stand for the point order if a polygon it's inside or outside the other poly in the multipolygon array. So i try to do that but it'doesn't work |
@chriswhong I think this is going to come up more often. There's new GeoJSON spec that came out in July about winding order of polygons (counter-clockwise). A variety of tools do not conform with that (esp. older versions) and will output clockwise-winding-ordered GeoJSON. The result is that the above situation the OP shared will occur. An example of this is something I found w/ |
@FitzCarraldo-it you can visualize the 2 polygons you have that are in the wrong winding order (as in the above image). A script to generate the above is shared below. In the image, polygons A and B have their polygons in clockwise order whereas C has its in counter-clockwise order, which is correct. As a result, both A and B need to be reversed to become valid GeoJSON. Script:
|
The error is showing up because However, geojson.io has always been using In any case, I think geojson.io is working as expected and showing an error/not rendering invalid geojson in the code editor. @FitzCarraldo-it FYI the sample geojson data you provided includes coordinates for three polygons that do not intersect, but they are nested in the geojson as only one polygon with an exterior ring and two interior rings. If all three were drawn in geojson.io, they would be counterclockwise, but placing them where they are in the geojson means it expects the 2nd and 3rd to be clockwise because they are inner rings.
|
Thank you for the answer. I still have issue but i understand the question. I use map for my Einstein Analytics exam and i find that what works on geojson.io doesn't in Analytics and viceversa.I think i must investigate geojson implementation in Salesforce!!! |
Thanks for raising this! Closing as there is no immediate action to take. |
Hi, based on some other discussions it was determined that the right hand rule should be a warning instead of an error. This was implemented in #786, so you should be able to use the geojson you were trying earlier now. |
Him Chris. Tank you for the info!!! |
Hi,
Thank you for your work. I have an issue about multipolygon. I create some map with multipoly last week, but now if i try to do the same thing i get the right hand rule error and i don see anything. So i load the old file and i get the same error but i can see and edit the multipolygon. I miss something?
The text was updated successfully, but these errors were encountered: