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
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.
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
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).
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
(...).add(SpatialRestrictions.within(Mall.LOCATION, getCircle(centerPoint, 10)));)