Package org.apache.lucene.geo
Class Line2D
- java.lang.Object
-
- org.apache.lucene.geo.Line2D
-
- All Implemented Interfaces:
Component2D
public final class Line2D extends Object implements Component2D
2D geo line implementation represented as a balanced interval tree of edges.Line
Line2DConstruction takesO(n log n)time for sorting and tree construction.relate()areO(n), but for most practical lines are much faster than brute force.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.lucene.geo.Component2D
Component2D.WithinRelation
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontains(double x, double y)relates this component2D with a pointstatic Component2Dcreate(Line... lines)create a Line2D edge tree from provided array of Linestringsstatic Component2Dcreate(XYLine... lines)create a Line2D edge tree from provided array of LinestringsdoublegetMaxX()max X value for the componentdoublegetMaxY()max Y value for the componentdoublegetMinX()min X value for the componentdoublegetMinY()min Y value for the componentPointValues.Relationrelate(double minX, double maxX, double minY, double maxY)relates this component2D with a bounding boxPointValues.RelationrelateTriangle(double minX, double maxX, double minY, double maxY, double ax, double ay, double bx, double by, double cx, double cy)relates this component2D with a triangleComponent2D.WithinRelationwithinTriangle(double minX, double maxX, double minY, double maxY, double ax, double ay, boolean ab, double bx, double by, boolean bc, double cx, double cy, boolean ca)Compute the within relation of this component2D with a triangle-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.lucene.geo.Component2D
relateTriangle, withinTriangle
-
-
-
-
Method Detail
-
getMinX
public double getMinX()
Description copied from interface:Component2Dmin X value for the component- Specified by:
getMinXin interfaceComponent2D
-
getMaxX
public double getMaxX()
Description copied from interface:Component2Dmax X value for the component- Specified by:
getMaxXin interfaceComponent2D
-
getMinY
public double getMinY()
Description copied from interface:Component2Dmin Y value for the component- Specified by:
getMinYin interfaceComponent2D
-
getMaxY
public double getMaxY()
Description copied from interface:Component2Dmax Y value for the component- Specified by:
getMaxYin interfaceComponent2D
-
contains
public boolean contains(double x, double y)Description copied from interface:Component2Drelates this component2D with a point- Specified by:
containsin interfaceComponent2D
-
relate
public PointValues.Relation relate(double minX, double maxX, double minY, double maxY)
Description copied from interface:Component2Drelates this component2D with a bounding box- Specified by:
relatein interfaceComponent2D
-
relateTriangle
public PointValues.Relation relateTriangle(double minX, double maxX, double minY, double maxY, double ax, double ay, double bx, double by, double cx, double cy)
Description copied from interface:Component2Drelates this component2D with a triangle- Specified by:
relateTrianglein interfaceComponent2D
-
withinTriangle
public Component2D.WithinRelation withinTriangle(double minX, double maxX, double minY, double maxY, double ax, double ay, boolean ab, double bx, double by, boolean bc, double cx, double cy, boolean ca)
Description copied from interface:Component2DCompute the within relation of this component2D with a triangle- Specified by:
withinTrianglein interfaceComponent2D
-
create
public static Component2D create(Line... lines)
create a Line2D edge tree from provided array of Linestrings
-
create
public static Component2D create(XYLine... lines)
create a Line2D edge tree from provided array of Linestrings
-
-