This is what use to get a circle:
GeometricShapeFactory shape = new GeometricShapeFactory(gf);
shape.setCentre(new Coordinate(40.748754,-73.985460));//Empire Sate Building
shape.setSize(2* (10*0.009));//expect 10km radius
shape.setNumPoints(64);
final Polygon circle = shape.createEllipse();//createCircle deprecated
What I get is a weird ellipse. I know that closer to the equator we get 'more perfect' circle but still, is it valid circle for radius of 10km with ESB as a center point ?
Reading Dr. Ian Turton posts, github repo, and other great materials he shares, I know that I can use geotools and do that differently but I would like to stick with that approach.
EDITED:
I am writting an application. In MySQL I store malls with their location (spatial type Point). What I want to do is to get malls from db that are in a certain circle (via ORM). In order to do that I have to create a Polygon(circle, linearring) in which orm will look. And Instead of using complicated calculations (and additional library). I thought I can use GeometricShapeFactory from jts lib I am already using. But because I am less than beginner what it comes to these things, all I wanted to ask, is whether or not the vertical ellipse generated by jts is valid for my purposes or not ?
I am using google maps (as basemap).
My question:
Based on the fact that my ellipse is just wrong (considering given radius it should be a perfect circle - @whuber comment), how can I generate a proper Polygon(circle, linearring) based on radius and center point ? (I am going to use it in hibernate-spatial: (...).add(SpatialRestrictions.within(Mall.LOCATION, getCircle(centerPoint, 10)));)




x*0.009is alright, but according to your explanation (in question 157848), closer toNorS(from theequator) it's getting more distorted inE-W(more elongated vertically) so ellipse I generated seems to be reasonable, am I right ? 2.) Like I said, i am less than beginner, so aboutUTM, do you think it would be more accurate to use Ion TurtonbufferPointthanGeometricShapeFactorycircle ? https://stackoverflow.com/questions/44249945/how-to-use-geometricshapefactory-in-geotools-to-create-a-circle-on-map – user3529850 Jan 20 '18 at 17:28polygon(circle) based on center point and a radius ? – user3529850 Jan 20 '18 at 18:3540.748754,-73.985460. thanks. Could you give me just one link where is an exmaple of a lib. used for my purposes ? I'm struggling with that since friday night and it sucks the life out of me – user3529850 Jan 20 '18 at 19:30