Class Polygon
- java.lang.Object
-
- com.github.filosganga.geogson.model.AbstractGeometry<AreaPositions>
-
- com.github.filosganga.geogson.model.MultiLineString
-
- com.github.filosganga.geogson.model.Polygon
-
- All Implemented Interfaces:
Geometry<AreaPositions>,Serializable
public class Polygon extends MultiLineString
A Geometry composed by a sequence ofLinearRings (or closedLineStrings). The first one is the external perimeter, the followers are the holes. GeoJson reference: @see http://geojson.org/geojson-spec.html#polygon.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.github.filosganga.geogson.model.Geometry
Geometry.Type
-
-
Constructor Summary
Constructors Constructor Description Polygon(AreaPositions positions)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description List<LinearRing>holes()Returns the holesLinearRings.List<LinearRing>linearRings()Returns theLinearRings composing this Polygon.static Polygonof(LinearRing perimeter, LinearRing... holes)Creates a Polygon from the given perimeter and holes.static Polygonof(LinearRing perimeter, Iterable<LinearRing> holes)Creates a Polygon from the given perimeter and holes.static Polygonof(LinearRing perimeter, Stream<LinearRing> holes)Creates a Polygon from the given perimeter and holes.LinearRingperimeter()Returns the perimeterLinearRing.Geometry.Typetype()Returns the Geometry type.-
Methods inherited from class com.github.filosganga.geogson.model.MultiLineString
lineStrings, of, of, of, toMultiLineString, toPolygon
-
-
-
-
Constructor Detail
-
Polygon
public Polygon(AreaPositions positions)
-
-
Method Detail
-
of
public static Polygon of(LinearRing perimeter, LinearRing... holes)
Creates a Polygon from the given perimeter and holes.- Parameters:
perimeter- The perimeterLinearRing.holes- The holesLinearRingsequence.- Returns:
- Polygon
-
of
public static Polygon of(LinearRing perimeter, Iterable<LinearRing> holes)
Creates a Polygon from the given perimeter and holes.- Parameters:
perimeter- The perimeterLinearRing.holes- The holesLinearRingIterable.- Returns:
- Polygon
-
of
public static Polygon of(LinearRing perimeter, Stream<LinearRing> holes)
Creates a Polygon from the given perimeter and holes.- Parameters:
perimeter- The perimeterLinearRing.holes- The holesLinearRingStream.- Returns:
- Polygon
-
type
public Geometry.Type type()
Description copied from interface:GeometryReturns the Geometry type.- Specified by:
typein interfaceGeometry<AreaPositions>- Overrides:
typein classMultiLineString- Returns:
- Type
-
linearRings
public List<LinearRing> linearRings()
Returns theLinearRings composing this Polygon.- Returns:
- a Guava lazy Iterable of
LinearRing.
-
perimeter
public LinearRing perimeter()
Returns the perimeterLinearRing.- Returns:
- LinearRing
-
holes
public List<LinearRing> holes()
Returns the holesLinearRings.- Returns:
- a Guava lazy Iterable of
LinearRing.
-
-