Package org.elasticsearch.geo
Class ShapeTestUtils
java.lang.Object
org.elasticsearch.geo.ShapeTestUtils
generates random cartesian shapes
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic double
area
(org.apache.lucene.geo.XYPolygon p) static boolean
extremePoint
(org.elasticsearch.geometry.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.static double[]
floatsToDoubles
(float[] f) static double
static org.elasticsearch.geometry.Circle
randomCircle
(boolean hasAlt) static org.elasticsearch.geometry.Geometry
randomGeometry
(boolean hasAlt) protected static org.elasticsearch.geometry.Geometry
randomGeometry
(int level, boolean hasAlt) static org.elasticsearch.geometry.GeometryCollection<org.elasticsearch.geometry.Geometry>
randomGeometryCollection
(boolean hasAlt) static org.elasticsearch.geometry.GeometryCollection<org.elasticsearch.geometry.Geometry>
randomGeometryCollectionWithoutCircle
(boolean hasAlt) protected static org.elasticsearch.geometry.GeometryCollection<org.elasticsearch.geometry.Geometry>
randomGeometryCollectionWithoutCircle
(int level, boolean hasAlt) static org.elasticsearch.geometry.Geometry
randomGeometryWithoutCircle
(boolean hasAlt) static org.elasticsearch.geometry.Geometry
randomGeometryWithoutCircle
(int level, boolean hasAlt) static org.elasticsearch.geometry.Line
randomLine
(boolean hasAlts) static org.elasticsearch.geometry.MultiLine
randomMultiLine
(boolean hasAlt) static org.elasticsearch.geometry.MultiPoint
randomMultiPoint
(boolean hasAlt) static org.elasticsearch.geometry.MultiPolygon
randomMultiPolygon
(boolean hasAlt) static org.elasticsearch.geometry.Point
static org.elasticsearch.geometry.Point
randomPoint
(boolean hasAlt) static org.elasticsearch.geometry.Point
static org.elasticsearch.geometry.Point
randomPointNotExtreme
(boolean hasAlt) static org.elasticsearch.geometry.Polygon
randomPolygon
(boolean hasAlt) static org.elasticsearch.geometry.Rectangle
static double
-
Field Details
-
MIN_VALID_AREA
public static final double MIN_VALID_AREA- See Also:
-
-
Constructor Details
-
ShapeTestUtils
public ShapeTestUtils()
-
-
Method Details
-
randomValue
public static double randomValue() -
randomPoint
public static org.elasticsearch.geometry.Point randomPoint() -
randomPoint
public static org.elasticsearch.geometry.Point randomPoint(boolean hasAlt) -
randomPointNotExtreme
public static org.elasticsearch.geometry.Point randomPointNotExtreme(boolean hasAlt) -
randomPointNotExtreme
public static org.elasticsearch.geometry.Point randomPointNotExtreme() -
extremePoint
public static boolean extremePoint(org.elasticsearch.geometry.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 org.elasticsearch.geometry.Circle randomCircle(boolean hasAlt) -
randomLine
public static org.elasticsearch.geometry.Line randomLine(boolean hasAlts) -
randomPolygon
public static org.elasticsearch.geometry.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 org.elasticsearch.geometry.Rectangle randomRectangle() -
randomMultiPoint
public static org.elasticsearch.geometry.MultiPoint randomMultiPoint(boolean hasAlt) -
randomMultiLine
public static org.elasticsearch.geometry.MultiLine randomMultiLine(boolean hasAlt) -
randomMultiPolygon
public static org.elasticsearch.geometry.MultiPolygon randomMultiPolygon(boolean hasAlt) -
randomGeometryCollection
public static org.elasticsearch.geometry.GeometryCollection<org.elasticsearch.geometry.Geometry> randomGeometryCollection(boolean hasAlt) -
randomGeometry
public static org.elasticsearch.geometry.Geometry randomGeometry(boolean hasAlt) -
randomGeometry
protected static org.elasticsearch.geometry.Geometry randomGeometry(int level, boolean hasAlt) -
randomGeometryWithoutCircle
public static org.elasticsearch.geometry.Geometry randomGeometryWithoutCircle(boolean hasAlt) -
randomGeometryWithoutCircle
public static org.elasticsearch.geometry.Geometry randomGeometryWithoutCircle(int level, boolean hasAlt) -
randomGeometryCollectionWithoutCircle
public static org.elasticsearch.geometry.GeometryCollection<org.elasticsearch.geometry.Geometry> randomGeometryCollectionWithoutCircle(boolean hasAlt) -
randomGeometryCollectionWithoutCircle
protected static org.elasticsearch.geometry.GeometryCollection<org.elasticsearch.geometry.Geometry> randomGeometryCollectionWithoutCircle(int level, boolean hasAlt)
-