Class GeoJsonPolygon
java.lang.Object
org.springframework.data.geo.Polygon
com.arangodb.springframework.core.geo.GeoJsonPolygon
- All Implemented Interfaces:
GeoJson<List<GeoJsonLineString>>,Serializable,Iterable<Point>,Shape
GeoJson representation of Polygon. Unlike Polygon the GeoJsonPolygon requires a
closed border. Which means that the first and last Point have to have same coordinate pairs.- Author:
- Christoph Strobl, Mark Paluch
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionGeoJsonPolygon(List<Point> points) Creates newGeoJsonPolygonfrom the givenPoints.Creates newGeoJsonPolygonfrom the givenPoints. -
Method Summary
Modifier and TypeMethodDescriptionThe value of the coordinates member is always anIterable.getType()String value representing the type of theGeoJsonobject.withInnerRing(GeoJsonLineString lineString) Creates a newGeoJsonPolygonwith an inner ring defined be the givenGeoJsonLineString.withInnerRing(List<Point> points) Creates a newGeoJsonPolygonwith an inner ring defined be the givenPoints.Methods inherited from class org.springframework.data.geo.Polygon
equals, getPoints, hashCode, iterator, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
GeoJsonPolygon
Creates newGeoJsonPolygonfrom the givenPoints.- Parameters:
first- must not be null.second- must not be null.third- must not be null.fourth- must not be null.others- can be empty.
-
GeoJsonPolygon
Creates newGeoJsonPolygonfrom the givenPoints.- Parameters:
points- must not be null.
-
-
Method Details
-
withInnerRing
public GeoJsonPolygon withInnerRing(Point first, Point second, Point third, Point fourth, Point... others) Creates a newGeoJsonPolygonwith an inner ring defined be the givenPoints.- Parameters:
first- must not be null.second- must not be null.third- must not be null.fourth- must not be null.others- can be empty.- Returns:
- new
GeoJsonPolygon. - Since:
- 1.10
-
withInnerRing
- Parameters:
points- must not be null.- Returns:
- new
GeoJsonPolygon.
-
withInnerRing
Creates a newGeoJsonPolygonwith an inner ring defined be the givenGeoJsonLineString.- Parameters:
lineString- must not be null.- Returns:
- new
GeoJsonPolygon. - Since:
- 1.10
-
getType
Description copied from interface:GeoJsonString value representing the type of theGeoJsonobject.- Specified by:
getTypein interfaceGeoJson<List<GeoJsonLineString>>- Returns:
- will never be null.
- See Also:
-
getCoordinates
Description copied from interface:GeoJsonThe value of the coordinates member is always anIterable. The structure for the elements within is determined byGeoJson.getType()of geometry.- Specified by:
getCoordinatesin interfaceGeoJson<List<GeoJsonLineString>>- Returns:
- will never be null.
- See Also:
-