title: How to use GeometricShapeFactory in geoTools to create a Circle on map
body: <p>I am currently using the below code to create a GeoJson Polygon. this gives me a bad circle which is not valid...</p>
  
  <p>in this case <code>RADIUS = 1609.34</code>  , which is 1 mile in meters.</p>
  
  <pre><code>        public  GeoJsonPolygon createRadiusPolygon(  Point point,double RADIUS) {       
  
                GeometricShapeFactory shapeFactory = new GeometricShapeFactory();
                shapeFactory.setNumPoints(32);
                shapeFactory.setCentre(new com.vividsolutions.jts.geom.Coordinate(point.getX(), point.getY()));
                shapeFactory.setSize(RADIUS * 2);
                com.vividsolutions.jts.geom.Geometry circle = shapeFactory.createCircle();
                List&lt;Point&gt; points = new ArrayList&lt;Point&gt;();
                  for (com.vividsolutions.jts.geom.Coordinate coordinate : circle.getCoordinates()) {
                      Point lngLatAtl = new Point(coordinate.x, coordinate.y);
                      points.add(lngLatAtl);
                  }
                  Collections.reverse(points);
                  return new GeoJsonPolygon(points);
              }
  </code></pre>
  
  <p>referenced:
  <a href="http://docs.geotools.org/stable/userguide/library/jts/geometry.html" rel="nofollow noreferrer">http://docs.geotools.org/stable/userguide/library/jts/geometry.html</a></p>
  
  <p>currently if i use Point(-73.87,40.84)  RADIUS = 1609.34, i get the below link.
  <a href="https://gist.githubusercontent.com/VanitySoft/56c4ce0f5c1c7e7fe0461ed46fd5ed11/raw/94544750a140d81780ebe9206395a21ab88bb1f7/circle" rel="nofollow noreferrer">https://gist.githubusercontent.com/VanitySoft/56c4ce0f5c1c7e7fe0461ed46fd5ed11/raw/94544750a140d81780ebe9206395a21ab88bb1f7/circle</a></p>
  
  <p>===SOLVED== from @Ian answer:
  Using method in his answer. RADIUS is in miles, to get the Circle used to create the GeoJson.</p>
  
  <pre><code>...
    com.vividsolutions.jts.geom.Point jtsPoint =  new GeometryFactory().createPoint(new com.vividsolutions.jts.geom.Coordinate(point.getY(), point.getX()));
                    javax.measure.Measure measure = Measure.valueOf(RADIUS, NonSI.MILE);
                    com.vividsolutions.jts.geom.Geometry circle = createCircleRadis(measure,CRS.decode("epsg:4326"),jtsPoint );
  ...
  </code></pre>
  
  <p>...</p>