I am developing a web application using Google Maps to draw circles in the map. This circles are stored in a MySQL 5.7 database, and its representation is done with Polygon object from JTS library.
A circle is stored with center and radius too. When a circle polygon is drawn in Google Maps, center and radius are obtained from database and then the circle object of Google Maps is created.
The results of drawing a circle vary when it is drawn with the polygon object from Google Maps and its center and radius stored in database, and when it is drawn from the Polygon stored in database. There are some differences, in meters, between both bounds.
As is shown in this example:
The black border circle is drawn with Google Maps Circle object and the fuchsia border circle is drawn with Google Maps Polygon object. Zoom is set up to the maximum value. As you can appreciate is quite similar, but there is an error, about 2 o 3 meters. In this example, the circle has a radius of 8.000 m (8 km) and is located in Madrid.
This problem grows when radius circle is bigger.
Probably, this error occurs because of the use of JTS library I don't know if using a geodesic library, like Spatial4j, solve this (I've tried this but I've have another problems and, as I mentioned before, I don't know if this is the solution).
Thank you very much!