Class MultiLineString
- java.lang.Object
-
- com.github.filosganga.geogson.model.AbstractGeometry<AreaPositions>
-
- com.github.filosganga.geogson.model.MultiLineString
-
- All Implemented Interfaces:
Geometry<AreaPositions>,Serializable
- Direct Known Subclasses:
Polygon
public class MultiLineString extends AbstractGeometry<AreaPositions>
Geometry composed by a collection ofLineString.GeoJson reference: @see http://geojson.org/geojson-spec.html#multilinestring.
eg:
MultiLineString mls = MultiLineString.of( LineString.of(Point.from(1,2), Point(2,2)), LineString.of(Point.from(2,3), Point(3,3)) )TODO Consider adding an abstract parent for this and 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 MultiLineString(AreaPositions positions)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description List<LineString>lineStrings()Returns theLineStringIterable contained by this MultiLineString.static MultiLineStringof(LineString... lineStrings)Creates a MultiLineString from the given LineStrings.static MultiLineStringof(Iterable<LineString> lineStrings)Creates a MultiLineString from the given LineStrings.static MultiLineStringof(Stream<LineString> lineStrings)Creates a MultiLineString from the given LineStrings.MultiLineStringtoMultiLineString()Converts to aMultiLineString.PolygontoPolygon()Converts to aPolygon.Geometry.Typetype()Returns the Geometry type.
-
-
-
Constructor Detail
-
MultiLineString
public MultiLineString(AreaPositions positions)
-
-
Method Detail
-
of
public static MultiLineString of(LineString... lineStrings)
Creates a MultiLineString from the given LineStrings.- Parameters:
lineStrings- TheLineStringsequence.- Returns:
- MultiLineString.
-
of
public static MultiLineString of(Iterable<LineString> lineStrings)
Creates a MultiLineString from the given LineStrings.- Parameters:
lineStrings- The Iterable ofLineString.- Returns:
- MultiLineString.
-
of
public static MultiLineString of(Stream<LineString> lineStrings)
Creates a MultiLineString from the given LineStrings.- Parameters:
lineStrings- The Iterable ofLineString.- Returns:
- MultiLineString.
-
type
public Geometry.Type type()
Description copied from interface:GeometryReturns the Geometry type.- Returns:
- Type
-
toPolygon
public Polygon toPolygon()
Converts to aPolygon.- Returns:
- Polygon
- Throws:
IllegalArgumentException- if this MultiLineString contains an openLineStringor it is empty.
-
toMultiLineString
public MultiLineString toMultiLineString()
Converts to aMultiLineString.- Returns:
- this.
-
lineStrings
public List<LineString> lineStrings()
Returns theLineStringIterable contained by this MultiLineString.- Returns:
- Guava lazy
Iterable<LineString>.
-
-