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 google maps circle to polygon conversion #137

Closed MGotink closed 5 years ago

MGotink commented 5 years ago

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 commented 5 years ago

Great, thanks!