Class GeometryTestUtils

java.lang.Object
org.elasticsearch.geo.GeometryTestUtils

public class GeometryTestUtils extends Object
  • Constructor Details

    • GeometryTestUtils

      public GeometryTestUtils()
  • Method Details

    • randomLat

      public static double randomLat()
    • randomLon

      public static double randomLon()
    • randomAlt

      public static double randomAlt()
    • randomCircle

      public static Circle randomCircle(boolean hasAlt)
    • randomLine

      public static Line randomLine(boolean hasAlts)
    • randomPoint

      public static Point randomPoint()
    • randomPoint

      public static Point randomPoint(boolean hasAlt)
    • nextLucenePolygon

      public static org.apache.lucene.geo.Polygon nextLucenePolygon()
      Returns a Lucene polygon with non-zero area, so its vertices are not all collinear and the polygon survives Tessellator. Lucene's GeoTestUtil.nextPolygon on its own occasionally returns degenerate polygons; callers that hand the result to the geo_shape indexer should use this wrapper.
    • randomPolygon

      public static Polygon randomPolygon(boolean hasAlt)
    • linearRing

      public static LinearRing linearRing(double[] lons, double[] lats, boolean generateAlts)
    • randomRectangle

      public static Rectangle randomRectangle()
    • randomMultiPoint

      public static MultiPoint randomMultiPoint(boolean hasAlt)
    • randomMultiLine

      public static MultiLine randomMultiLine(boolean hasAlt)
    • randomMultiPolygon

      public static MultiPolygon randomMultiPolygon(boolean hasAlt)
    • randomGeometryCollection

      public static GeometryCollection<Geometry> randomGeometryCollection(boolean hasAlt)
    • randomGeometryCollectionWithoutCircle

      public static GeometryCollection<Geometry> randomGeometryCollectionWithoutCircle(boolean hasAlt)
    • randomGeometry

      public static Geometry randomGeometry(ShapeType type, boolean hasAlt)
    • randomGeometry

      public static Geometry randomGeometry(boolean hasAlt)
    • randomGeometry

      public static Geometry randomGeometry(boolean hasAlt, int maxPoints)
    • randomGeometry

      protected static Geometry randomGeometry(int level, boolean hasAlt)
    • randomGeometryWithoutCircle

      public static Geometry randomGeometryWithoutCircle(boolean hasAlt, int maxPoints)
    • randomGeometryWithoutCircle

      public static Geometry randomGeometryWithoutCircle(int level, boolean hasAlt)
    • toMultiPoint

      public static MultiPoint toMultiPoint(Geometry geometry)
      Extracts all vertices of the supplied geometry