public abstract class EdgeTree extends Object
Construction takes O(n log n)
time for sorting and tree construction.
relate()
are O(n)
, but for most
practical lines and polygons are much faster than brute force.
Modifier and Type | Field and Description |
---|---|
protected EdgeTree |
left |
double |
maxLat
maximum latitude of this geometry's bounding box area
|
double |
maxLon
maximum longitude of this geometry's bounding box area
|
protected double |
maxX
maximum longitude of this component or any of its children
|
protected double |
maxY
maximum latitude of this component or any of its children
|
double |
minLat
minimum latitude of this geometry's bounding box area
|
double |
minLon
minimum longitude of this geometry's bounding box area
|
protected EdgeTree |
right |
protected boolean |
splitX
which dimension was this node split on
|
protected org.apache.lucene.geo.EdgeTree.Edge |
tree
root node of edge tree
|
Modifier | Constructor and Description |
---|---|
protected |
EdgeTree(double minLat,
double maxLat,
double minLon,
double maxLon,
double[] lats,
double[] lons) |
Modifier and Type | Method and Description |
---|---|
protected abstract PointValues.Relation |
componentRelate(double minLat,
double maxLat,
double minLon,
double maxLon)
Returns relation to the provided rectangle for this component
|
protected abstract PointValues.Relation |
componentRelateTriangle(double ax,
double ay,
double bx,
double by,
double cx,
double cy)
Returns relation to the provided triangle for this component
|
protected static EdgeTree |
createTree(EdgeTree[] components,
int low,
int high,
boolean splitX)
Creates tree from sorted components (with range low and high inclusive)
|
protected PointValues.Relation |
internalComponentRelate(double minLat,
double maxLat,
double minLon,
double maxLon)
Returns relation to the provided rectangle for this component
|
protected static boolean |
pointInTriangle(double x,
double y,
double ax,
double ay,
double bx,
double by,
double cx,
double cy)
Compute whether the given x, y point is in a triangle; uses the winding order method
|
PointValues.Relation |
relate(double minLat,
double maxLat,
double minLon,
double maxLon)
Returns relation to the provided rectangle
|
PointValues.Relation |
relateTriangle(double ax,
double ay,
double bx,
double by,
double cx,
double cy)
Returns relation to the provided triangle
|
public final double minLat
public final double maxLat
public final double minLon
public final double maxLon
protected double maxY
protected double maxX
protected boolean splitX
protected EdgeTree left
protected EdgeTree right
protected final org.apache.lucene.geo.EdgeTree.Edge tree
protected EdgeTree(double minLat, double maxLat, double minLon, double maxLon, double[] lats, double[] lons)
public PointValues.Relation relateTriangle(double ax, double ay, double bx, double by, double cx, double cy)
public PointValues.Relation relate(double minLat, double maxLat, double minLon, double maxLon)
protected abstract PointValues.Relation componentRelate(double minLat, double maxLat, double minLon, double maxLon)
protected abstract PointValues.Relation componentRelateTriangle(double ax, double ay, double bx, double by, double cx, double cy)
protected PointValues.Relation internalComponentRelate(double minLat, double maxLat, double minLon, double maxLon)
protected static EdgeTree createTree(EdgeTree[] components, int low, int high, boolean splitX)
protected static boolean pointInTriangle(double x, double y, double ax, double ay, double bx, double by, double cx, double cy)
Copyright © 2000-2019 Apache Software Foundation. All Rights Reserved.