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

Polygon which overlaps -180/+180 boundary incorrectly drawn #100

Closed
borgille opened this issue Dec 12, 2016 · 3 comments
Closed

Polygon which overlaps -180/+180 boundary incorrectly drawn #100

borgille opened this issue Dec 12, 2016 · 3 comments

Comments

@borgille
Copy link

I ran into an issue with a polygon drawn around North America where one of the points west of Alaska overlapped past the -180 longitude boundary. The point appears to be placed correctly (i.e. where I would want it); however, it's defined in the positive space, and using it with other software (e.g. JTS results in the point being drawn with the point wrapping across the view. I'm not sure if there is a standard regarding global projection views (not sure if that's the correct terminology), but it seems like other software regards them differently. Here's a fiddle demonstrating the same JTS rendering using the OpenLayers API:

https://jsfiddle.net/borgille/bn4s8am1/1/

The same polygon is drawn differently in Wicket: POLYGON((172 57,-167 61,-167 52,172 57))

I haven't had time to look into how Wicket figures out where to draw the points, but it seems like it assumes the shortest longitudinal distance to the defined point within a +/-180 deg radius.

Thanks!

@arthur-e
Copy link
Owner

Confirmed that the elongated triangle seen in the JS Fiddle example is reproduced in the Leaflet sandbox.

Just a quick note: Wicket doesn't "draw the points" so much as it creates a Leaflet/ Google Maps/ ArcGIS API object that represents the points and asks the corresponding framework to map it. I mean only to clarify--the solution is probably to be found in how to tell the mapping library to cross the -180 longitude boundary.

@arthur-e
Copy link
Owner

This also means solutions are going to specific to the mapping API (i.e., need a solution for the Google Maps 3 API, need a different solution for Leaflet, etc.). For instance, the Leaflet API in Wicket needs to be updated to support the new wrap functionality in Leaflet.

@arthur-e
Copy link
Owner

This issue is a little stale; closing for now but please re-open if the issue persists in 1.3.5. Again, it's not clear if this is within the scope of the Wicket library.

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