Skip to content
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 not nested correctly #161

Open
bsaid97 opened this issue Aug 30, 2022 · 2 comments
Open

MultiPolygon not nested correctly #161

bsaid97 opened this issue Aug 30, 2022 · 2 comments

Comments

@bsaid97
Copy link

bsaid97 commented Aug 30, 2022

Hi Arthur, thank you for this awesome library.

I'm trying to convert a Google Maps MultiPolygon back to GeoJSON using Wicket but noticed that the conversion isn't nesting the first index of the shape correctly.

image

It seems that the shape at index 0 needs to be nested into another array to be completely correct. I'm not sure if this is to do with the ring problem I've seen over and over, but as far as I can tell, there is no ring within this shape, just two different polygons in the same multi polygon.

Here's a gist of the GeoJSON generated by Wicket

If you go on geojson.io and make index 0 and level deeper, it works.

@arthur-e
Copy link
Owner

Hi @bsaid97, could you provide some more information on the geometry? Was this hand-drawn in Google Maps or loaded into Google Maps some way other than Wicket? What code did you use to generate the GeoJSON? Could you share a gist of the "correct" WKT or GeoJSON or a screenshot of what it should look like, correctly plotted?

I don't do Javascript development anymore but hopefully these details will point to an obvious solution or help someone else find a fix.

@bsaid97
Copy link
Author

bsaid97 commented Aug 30, 2022

Hi @bsaid97, could you provide some more information on the geometry? Was this hand-drawn in Google Maps or loaded into Google Maps some way other than Wicket? What code did you use to generate the GeoJSON? Could you share a gist of the "correct" WKT or GeoJSON or a screenshot of what it should look like, correctly plotted?

I don't do Javascript development anymore but hopefully these details will point to an obvious solution or help someone else find a fix.

They aren't hand drawn, I'm loading up various polygons through an API which I then draw on the map. I then try to get the GeoJSON object using Wicket from the google maps polygon object.

Here's a correct gist, you should be able to see that the first polygon in the MultiPolygon is just nested one level deeper.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants