public class PolygonIndex extends Object
| Modifier and Type | Field and Description |
|---|---|
int |
computations |
Map<String,Map<Point,Map<Point,Double>>> |
distanceIndex |
Map<String,Polygon> |
polygonIndex |
| Constructor and Description |
|---|
PolygonIndex() |
| Modifier and Type | Method and Description |
|---|---|
double |
getDistance(String uri,
Point x,
Point y)
Returns the distances between two points x and y from the polygon with
label uri Returns -1 if nothing is found
|
void |
index(Polygon p)
Indexes the distances between the points in a given polygon and adds
polygon to list of indexes
|
void |
index(Set<Polygon> polygons)
Indexes a list of polygons by mapping the uri of each polygon to the
corresponding distanceIndex
|
String |
toString()
String representation of the polygon index
|
public String toString()
public void index(Set<Polygon> polygons)
polygons - to be indexedpublic void index(Polygon p)
p - Input polygonpublic double getDistance(String uri, Point x, Point y)
uri - Label of the polygonx - First point from the polygony - Second point from the polygonCopyright © 2020. All rights reserved.