Package org.apache.lucene.geo
Class Line
java.lang.Object
org.apache.lucene.geo.LatLonGeometry
org.apache.lucene.geo.Line
Represents a line on the earth's surface. You can construct the Line directly with
double[]
coordinates.
NOTES:
- All latitude/longitude values must be in decimal degrees.
- For more advanced GeoSpatial indexing and query operations see the
spatial-extras
module
-
Field Summary
-
Constructor Summary
ConstructorDescriptionLine
(double[] lats, double[] lons) Creates a new Line from the supplied latitude/longitude array. -
Method Summary
Modifier and TypeMethodDescriptionboolean
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
returns the number of vertex pointsprotected Component2D
get aComponent2D
from this geometryprints lines as geojsontoString()
Methods inherited from class org.apache.lucene.geo.LatLonGeometry
create
-
Field Details
-
minLat
public final double minLatminimum latitude of this line's bounding box -
maxLat
public final double maxLatmaximum latitude of this line's bounding box -
minLon
public final double minLonminimum longitude of this line's bounding box -
maxLon
public final double maxLonmaximum longitude of this line's bounding box
-
-
Constructor Details
-
Line
public Line(double[] lats, double[] lons) Creates a new Line from the supplied latitude/longitude array.
-
-
Method Details
-
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 -
toComponent2D
Description copied from class:LatLonGeometry
get aComponent2D
from this geometry- Specified by:
toComponent2D
in classLatLonGeometry
-
equals
-
hashCode
public int hashCode() -
toString
-
toGeoJSON
prints lines as geojson
-