public final class Polygon
extends java.lang.Object
double[]
coordinates, or use fromGeoJSON(java.lang.String)
if you have a polygon already encoded as a
GeoJSON string.
NOTES:
spatial-extras
module
Modifier and Type | Field and Description |
---|---|
private Polygon[] |
holes |
double |
maxLat
maximum latitude of this polygon's bounding box area
|
double |
maxLon
maximum longitude of this polygon's bounding box area
|
double |
minLat
minimum latitude of this polygon's bounding box area
|
double |
minLon
minimum longitude of this polygon's bounding box area
|
private double[] |
polyLats |
private double[] |
polyLons |
Constructor and Description |
---|
Polygon(double[] polyLats,
double[] polyLons,
Polygon... holes)
Creates a new Polygon from the supplied latitude/longitude array, and optionally any holes.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
static Polygon[] |
fromGeoJSON(java.lang.String geojson)
Parses a standard GeoJSON polygon string.
|
Polygon[] |
getHoles()
Returns a copy of the internal holes array
|
double[] |
getPolyLats()
Returns a copy of the internal latitude array
|
double[] |
getPolyLons()
Returns a copy of the internal longitude array
|
int |
hashCode() |
java.lang.String |
toString() |
private final double[] polyLats
private final double[] polyLons
private final Polygon[] holes
public final double minLat
public final double maxLat
public final double minLon
public final double maxLon
public Polygon(double[] polyLats, double[] polyLons, Polygon... holes)
public double[] getPolyLats()
public double[] getPolyLons()
public Polygon[] getHoles()
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public static Polygon[] fromGeoJSON(java.lang.String geojson) throws java.text.ParseException
java.text.ParseException