public final class Polygon extends 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 |
---|---|
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
|
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(Object obj) |
static Polygon[] |
fromGeoJSON(String geojson)
Parses a standard GeoJSON polygon string.
|
Polygon[] |
getHoles()
Returns a copy of the internal holes array
|
double |
getPolyLat(int vertex)
Returns latitude value at given index
|
double[] |
getPolyLats()
Returns a copy of the internal latitude array
|
double |
getPolyLon(int vertex)
Returns longitude value at given index
|
double[] |
getPolyLons()
Returns a copy of the internal longitude array
|
GeoUtils.WindingOrder |
getWindingOrder()
Returns the winding order (CW, COLINEAR, CCW) for the polygon shell
|
int |
hashCode() |
int |
numHoles()
returns the number of holes for the polygon
|
int |
numPoints()
returns the number of vertex points
|
String |
toGeoJSON()
prints polygons as geojson
|
String |
toString() |
static String |
verticesToGeoJSON(double[] lats,
double[] lons) |
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 int numPoints()
public double[] getPolyLats()
public double getPolyLat(int vertex)
public double[] getPolyLons()
public double getPolyLon(int vertex)
public Polygon[] getHoles()
public GeoUtils.WindingOrder getWindingOrder()
public int numHoles()
public static String verticesToGeoJSON(double[] lats, double[] lons)
public String toGeoJSON()
public static Polygon[] fromGeoJSON(String geojson) throws ParseException
ParseException
Copyright © 2000-2019 Apache Software Foundation. All Rights Reserved.