Class CircleUtils

java.lang.Object
org.elasticsearch.geometry.utils.CircleUtils

public class CircleUtils extends Object
Utility class for storing different helpful re-usable spatial functions
  • Method Details

    • createRegularGeoShapePolygon

      public static Polygon createRegularGeoShapePolygon(Circle circle, int gons)
      Makes an n-gon, centered at the provided circle's center, and each vertex approximately Circle.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

      public static Polygon createRegularShapePolygon(Circle circle, int gons)
      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)