Package mil.nga.sf.geojson
Class Polygon
- java.lang.Object
-
- mil.nga.sf.geojson.GeoJsonObject
-
- mil.nga.sf.geojson.Geometry
-
- mil.nga.sf.geojson.Polygon
-
- All Implemented Interfaces:
Serializable
public class Polygon extends Geometry
Polygon- Author:
- yutzlejp
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
static Polygon
fromCoordinates(List<List<Position>> coordinates)
Create a polygon from coordinatesList<List<Position>>
getCoordinates()
Returns coordinates as a GeoJSON Position listGeometry
getGeometry()
Get the simple geometryGeometryType
getGeometryType()
Get the geometry typePolygon
getPolygon()
Get the simple features polygonList<LineString>
getRings()
Get the ringsint
hashCode()
void
setCoordinates(List<List<Position>> coordinates)
Sets the coordinates from a GeoJSON Position listvoid
setPolygon(Polygon polygon)
Set the simple features polygonvoid
setRings(List<LineString> rings)
Set the rings-
Methods inherited from class mil.nga.sf.geojson.Geometry
getSimpleGeometry, getType
-
Methods inherited from class mil.nga.sf.geojson.GeoJsonObject
getBbox, getForeignMember, getForeignMembers, hasForeignMember, hasForeignMembers, setBbox, setForeignMember
-
-
-
-
Constructor Detail
-
Polygon
public Polygon()
Constructor
-
Polygon
public Polygon(List<LineString> rings)
Constructor- Parameters:
rings
- ring line string list- Since:
- 3.0.0
-
Polygon
public Polygon(Polygon polygon)
Constructor- Parameters:
polygon
- simple polygon
-
-
Method Detail
-
fromCoordinates
public static Polygon fromCoordinates(List<List<Position>> coordinates)
Create a polygon from coordinates- Parameters:
coordinates
- coordinates- Returns:
- polygon
- Since:
- 3.0.0
-
getGeometryType
public GeometryType getGeometryType()
Get the geometry type- Specified by:
getGeometryType
in classGeometry
- Returns:
- geometry type
-
getGeometry
public Geometry getGeometry()
Get the simple geometry- Specified by:
getGeometry
in classGeometry
- Returns:
- simple geometry
-
getCoordinates
public List<List<Position>> getCoordinates()
Returns coordinates as a GeoJSON Position list- Returns:
- the coordinates
-
setCoordinates
public void setCoordinates(List<List<Position>> coordinates)
Sets the coordinates from a GeoJSON Position list- Parameters:
coordinates
- coordinates- Since:
- 3.0.0
-
getRings
public List<LineString> getRings()
Get the rings- Returns:
- list of ring line strings
- Since:
- 3.0.0
-
setRings
public void setRings(List<LineString> rings)
Set the rings- Parameters:
rings
- list of ring line strings- Since:
- 3.0.0
-
getPolygon
public Polygon getPolygon()
Get the simple features polygon- Returns:
- polygon
- Since:
- 3.0.0
-
setPolygon
public void setPolygon(Polygon polygon)
Set the simple features polygon- Parameters:
polygon
- polygon- Since:
- 3.0.0
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classGeoJsonObject
-
equals
public boolean equals(Object obj)
- Overrides:
equals
in classGeoJsonObject
-
-