Package org.apache.lucene.geo
Class Line
- java.lang.Object
-
- org.apache.lucene.geo.LatLonGeometry
-
- org.apache.lucene.geo.Line
-
public class Line extends LatLonGeometry
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-extrasmodule
-
-
Field Summary
Fields Modifier and Type Field Description private double[]latsarray of latitude coordinatesprivate double[]lonsarray of longitude coordinatesdoublemaxLatmaximum latitude of this line's bounding boxdoublemaxLonmaximum longitude of this line's bounding boxdoubleminLatminimum latitude of this line's bounding boxdoubleminLonminimum longitude of this line's bounding box
-
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 booleanequals(java.lang.Object o)doublegetLat(int vertex)Returns latitude value at given indexdouble[]getLats()Returns a copy of the internal latitude arraydoublegetLon(int vertex)Returns longitude value at given indexdouble[]getLons()Returns a copy of the internal longitude arrayinthashCode()intnumPoints()returns the number of vertex pointsprotected Component2DtoComponent2D()get aComponent2Dfrom this geometryjava.lang.StringtoGeoJSON()prints lines as geojsonjava.lang.StringtoString()-
Methods inherited from class org.apache.lucene.geo.LatLonGeometry
create
-
-
-
-
Field Detail
-
lats
private final double[] lats
array of latitude coordinates
-
lons
private final double[] lons
array of longitude coordinates
-
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
-
toComponent2D
protected Component2D toComponent2D()
Description copied from class:LatLonGeometryget aComponent2Dfrom this geometry- Specified by:
toComponent2Din classLatLonGeometry
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
toGeoJSON
public java.lang.String toGeoJSON()
prints lines as geojson
-
-