Package org.apache.lucene.geo
Class Line
- java.lang.Object
-
- org.apache.lucene.geo.Line
-
public class Line extends Object
Represents a line on the earth's surface. You can construct the Line directly withdouble[]
coordinates.NOTES:
- All latitude/longitude values must be in decimal degrees.
- For more advanced GeoSpatial indexing and query operations see the
spatial-extras
module
- WARNING: This API is experimental and might change in incompatible ways in the next release.
-
-
Constructor Summary
Constructors Constructor Description Line(double[] lats, double[] lons)
Creates a new Line from the supplied latitude/longitude array.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
double
getLat(int vertex)
Returns latitude value at given indexdouble[]
getLats()
Returns a copy of the internal latitude arraydouble
getLon(int vertex)
Returns longitude value at given indexdouble[]
getLons()
Returns a copy of the internal longitude arrayint
hashCode()
int
numPoints()
returns the number of vertex pointsString
toGeoJSON()
prints polygons as geojsonString
toString()
-
-
-
Field Detail
-
minLat
public final double minLat
minimum latitude of this line's bounding box
-
maxLat
public final double maxLat
maximum latitude of this line's bounding box
-
minLon
public final double minLon
minimum longitude of this line's bounding box
-
maxLon
public final double maxLon
maximum longitude of this line's bounding box
-
-
Method Detail
-
numPoints
public int numPoints()
returns the number of vertex points
-
getLat
public double getLat(int vertex)
Returns latitude value at given index
-
getLon
public double getLon(int vertex)
Returns longitude value at given index
-
getLats
public double[] getLats()
Returns a copy of the internal latitude array
-
getLons
public double[] getLons()
Returns a copy of the internal longitude array
-
toGeoJSON
public String toGeoJSON()
prints polygons as geojson
-
-