@Experimental public class GeoPolygon extends AbstractGeoJsonObject
| Constructor and Description |
|---|
GeoPolygon(GeoPoint firstPoint,
GeoPoint secondPoint,
GeoPoint thirdPoint,
GeoPoint fourthPoint,
GeoPoint... additionalPoints)
Instantiates a new Polygon.
|
GeoPolygon(List<GeoPoint> exteriorRing)
Instantiates a new Polygon.
|
| Modifier and Type | Method and Description |
|---|---|
GeoPolygon |
addHole(GeoPoint firstPoint,
GeoPoint secondPoint,
GeoPoint thirdPoint,
GeoPoint fourthPoint,
GeoPoint... additionalPoints)
Adds a new hole to the polygon.
|
GeoPolygon |
addHole(List<GeoPoint> hole)
Adds a new hole to the polygon.
|
GeoPolygon |
addHoles(List<List<GeoPoint>> holes)
Adds new holes to the polygon.
|
boolean |
equals(Object obj) |
static GeoPolygon |
fromDocument(org.bson.Document document) |
List<GeoPoint> |
getExternalRing()
Returns the external ring of the polygon.
|
List<List<GeoPoint>> |
getRings() |
int |
hashCode() |
protected org.bson.BsonArray |
toCoordinates() |
String |
toString() |
checkType, toBsonDocumentpublic static final String TYPE
public GeoPolygon(List<GeoPoint> exteriorRing)
exteriorRing - the exterior ring of the polygon, it cannot self-intersectpublic GeoPolygon(GeoPoint firstPoint, GeoPoint secondPoint, GeoPoint thirdPoint, GeoPoint fourthPoint, GeoPoint... additionalPoints)
firstPoint - the first point of the polygonsecondPoint - the second point of the polygonthirdPoint - the third point of the polygonfourthPoint - the third point of the polygonadditionalPoints - the additional points of the polygonpublic GeoPolygon addHole(List<GeoPoint> hole)
hole - a hole, must be contained in the exterior ring and must not overlap or
intersect another holepublic GeoPolygon addHole(GeoPoint firstPoint, GeoPoint secondPoint, GeoPoint thirdPoint, GeoPoint fourthPoint, GeoPoint... additionalPoints)
firstPoint - the first point of the polygonsecondPoint - the second point of the polygonthirdPoint - the third point of the polygonfourthPoint - the third point of the polygonadditionalPoints - the additional points of the polygonpublic GeoPolygon addHoles(List<List<GeoPoint>> holes)
holes - holes, must be contained in the exterior ring and must not overlap or
intersect another holepublic List<GeoPoint> getExternalRing()
protected org.bson.BsonArray toCoordinates()
toCoordinates in class AbstractGeoJsonObjectpublic static GeoPolygon fromDocument(org.bson.Document document)
Copyright © 2010-2018 Red Hat, Inc. and others. Licensed under the GNU Lesser General Public License (LGPL), version 2.1 or later.