Class ShapeTestUtils

java.lang.Object
org.elasticsearch.geo.ShapeTestUtils

public class ShapeTestUtils extends Object
generates random cartesian shapes
  • Field Details

  • Constructor Details

    • ShapeTestUtils

      public ShapeTestUtils()
  • Method Details

    • randomValue

      public static double randomValue()
    • randomPoint

      public static Point randomPoint()
    • randomPoint

      public static Point randomPoint(boolean hasAlt)
    • randomPointNotExtreme

      public static Point randomPointNotExtreme(boolean hasAlt)
    • randomPointNotExtreme

      public static Point randomPointNotExtreme()
    • extremePoint

      public static boolean extremePoint(Point point)
      Since cartesian centroid is stored in Float values, and calculations perform averages over many, We cannot support points at the very edge of the range.
    • randomAlt

      public static double randomAlt()
    • randomCircle

      public static Circle randomCircle(boolean hasAlt)
    • randomLine

      public static Line randomLine(boolean hasAlts)
    • randomPolygon

      public static Polygon randomPolygon(boolean hasAlt)
    • area

      public static double area(org.apache.lucene.geo.XYPolygon p)
    • floatsToDoubles

      public static double[] floatsToDoubles(float[] f)
    • 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)
    • 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)
    • randomGeometryWithoutCircle

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

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

      protected static GeometryCollection<Geometry> randomGeometryCollectionWithoutCircle(int level, boolean hasAlt)