Package org.apache.lucene.geo
Class XYLine
- java.lang.Object
-
- org.apache.lucene.geo.XYLine
-
public class XYLine extends Object
Represents a line in cartesian space. You can construct the Line directly withdouble[],double[]x, y arrays coordinates.
-
-
Constructor Summary
Constructors Constructor Description XYLine(float[] x, float[] y)Creates a new Line from the supplied x/y array.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)double[]getX()Returns a copy of the internal x arraydoublegetX(int vertex)Returns x value at given indexdouble[]getY()Returns a copy of the internal y arraydoublegetY(int vertex)Returns y value at given indexinthashCode()intnumPoints()returns the number of vertex pointsStringtoGeoJSON()prints polygons as geojsonStringtoString()
-
-
-
Method Detail
-
numPoints
public int numPoints()
returns the number of vertex points
-
getX
public double getX(int vertex)
Returns x value at given index
-
getY
public double getY(int vertex)
Returns y value at given index
-
getX
public double[] getX()
Returns a copy of the internal x array
-
getY
public double[] getY()
Returns a copy of the internal y array
-
toGeoJSON
public String toGeoJSON()
prints polygons as geojson
-
-