Package org.apache.lucene.geo
Class XYPolygon
- java.lang.Object
-
- org.apache.lucene.geo.XYPolygon
-
public class XYPolygon extends Object
Represents a polygon in cartesian space. You can construct the Polygon directly withdouble[],double[]x, y arrays coordinates.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)XYPolygon[]getHoles()Returns a copy of the internal holes arraydouble[]getPolyX()Returns a copy of the internal x arraydoublegetPolyX(int vertex)Returns x value at given indexdouble[]getPolyY()Returns a copy of the internal y arraydoublegetPolyY(int vertex)Returns y value at given indexGeoUtils.WindingOrdergetWindingOrder()Returns the winding order (CW, COLINEAR, CCW) for the polygon shellinthashCode()intnumHoles()returns the number of holes for the polygonintnumPoints()returns the number of vertex pointsStringtoGeoJSON()prints polygons as geojsonStringtoString()
-
-
-
Field Detail
-
minX
public final double minX
minimum x of this polygon's bounding box area
-
maxX
public final double maxX
maximum x of this polygon's bounding box area
-
minY
public final double minY
minimum y of this polygon's bounding box area
-
maxY
public final double maxY
maximum y of this polygon's bounding box area
-
-
Constructor Detail
-
XYPolygon
public XYPolygon(float[] x, float[] y, XYPolygon... holes)Creates a new Polygon from the supplied x, y arrays, and optionally any holes.
-
-
Method Detail
-
numPoints
public int numPoints()
returns the number of vertex points
-
getPolyX
public double[] getPolyX()
Returns a copy of the internal x array
-
getPolyX
public double getPolyX(int vertex)
Returns x value at given index
-
getPolyY
public double[] getPolyY()
Returns a copy of the internal y array
-
getPolyY
public double getPolyY(int vertex)
Returns y value at given index
-
getHoles
public XYPolygon[] getHoles()
Returns a copy of the internal holes array
-
getWindingOrder
public GeoUtils.WindingOrder getWindingOrder()
Returns the winding order (CW, COLINEAR, CCW) for the polygon shell
-
numHoles
public int numHoles()
returns the number of holes for the polygon
-
toGeoJSON
public String toGeoJSON()
prints polygons as geojson
-
-