java.lang.Object
org.elasticsearch.geometry.utils.CircleUtils
Utility class for storing different helpful re-usable spatial functions
-
Method Summary
Modifier and TypeMethodDescriptionstatic int
circleToPolygonNumSides
(double radiusMeters, double errorDistance) static Polygon
createRegularGeoShapePolygon
(Circle circle, int gons) Makes an n-gon, centered at the provided circle's center, and each vertex approximatelyCircle.getRadiusMeters()
away from the center.static Polygon
createRegularShapePolygon
(Circle circle, int gons) Makes an n-gon, centered at the provided circle's center.
-
Method Details
-
createRegularGeoShapePolygon
Makes an n-gon, centered at the provided circle's center, and each vertex approximatelyCircle.getRadiusMeters()
away from the center. It throws an IllegalArgumentException if the circle contains a pole. This does not split the polygon across the date-line. Relies on org.elasticsearch.index.mapper.GeoShapeIndexer to split prepare polygon for indexing. Adapted from from org.apache.lucene.tests.geo.GeoTestUtil -
createRegularShapePolygon
Makes an n-gon, centered at the provided circle's center. This assumes distance measured in cartesian geometry. -
circleToPolygonNumSides
public static int circleToPolygonNumSides(double radiusMeters, double errorDistance)
-