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

Fix google maps circle to polygon conversion #137

Merged

Conversation

MGotink
Copy link

@MGotink MGotink commented Jul 23, 2019

When converting a large google maps circle (e.g. a circle covering Africa) to a WKT polygon the first and last coordinate of the output are not exactly the same, this causes issues when using it in other libraries. In my case JSTS complains that the linestring is not closed. This is an example of such a converted circle: POLYGON((71.69991307132003 0.9262704706813841,...,71.69991307132003 0.9262704706813717)).
To ensure the calculated polygon is closed the last vertex will no longer be calculated but copied over from the first vertex.

When converting a large google maps circle (e.g. a circle covering Africa) to a WKT polygon the first and last coordinate of the output are not exactly the same, this causes issues when using it in other libraries. In my case JSTS complains that the linestring is not closed. This is an example of such a converted circle: POLYGON((71.69991307132003 0.9262704706813841,...,71.69991307132003 0.9262704706813717)).
To ensure the calculated polygon is closed the last vertex will no longer be calculated but copied over from the first vertex.
@arthur-e arthur-e merged commit 8bed2b7 into arthur-e:master Jul 26, 2019
@arthur-e
Copy link
Owner

Great, thanks!

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

Successfully merging this pull request may close these issues.

2 participants