public final class Polygon2D extends EdgeTree
Loosely based on the algorithm described in http://www-ma2.upc.es/geoc/Schirra-pointPolygon.pdf.
Modifier and Type | Method and Description |
---|---|
protected PointValues.Relation |
componentRelate(double minLat,
double maxLat,
double minLon,
double maxLon)
Returns relation to the provided rectangle for this component
|
protected PointValues.Relation |
componentRelateTriangle(double ax,
double ay,
double bx,
double by,
double cx,
double cy) |
boolean |
contains(double latitude,
double longitude)
Returns true if the point is contained within this polygon.
|
static Polygon2D |
create(Polygon... polygons)
Builds a Polygon2D from multipolygon
|
createTree, internalComponentRelate, relate, relateTriangle
public boolean contains(double latitude, double longitude)
See https://www.ecse.rpi.edu/~wrf/Research/Short_Notes/pnpoly.html for more information.
protected PointValues.Relation componentRelateTriangle(double ax, double ay, double bx, double by, double cx, double cy)
componentRelateTriangle
in class EdgeTree
protected PointValues.Relation componentRelate(double minLat, double maxLat, double minLon, double maxLon)
componentRelate
in class EdgeTree
Copyright © 2000-2018 Apache Software Foundation. All Rights Reserved.