Package dev.morphia.geo
Class Polygon
- java.lang.Object
-
- dev.morphia.geo.Polygon
-
- All Implemented Interfaces:
Geometry
@Deprecated(since="2.0", forRemoval=true) public class Polygon extends Object implements Geometry
Deprecated, for removal: This API element is subject to removal in a future version.use the driver-provided types insteadThis class represents either a simple polygon enclosing an area, or a more complex polygon that contains both an exterior boundary and interior boundaries (holes) within it. It will be persisted into the database according to the specification. The factory for creating a Polygon isPolygonBuilder
, which is accessible via theGeoJson.polygonBuilder
method. Alternatively, simple polygons without inner rings can be created via theGeoJson.polygon
factory method.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description Polygon
convert()
Deprecated, for removal: This API element is subject to removal in a future version.Converts this type to the driver typePolygon
convert(CoordinateReferenceSystem crs)
Deprecated, for removal: This API element is subject to removal in a future version.Converts this type to the driver typeboolean
equals(Object o)
Deprecated, for removal: This API element is subject to removal in a future version.List<LineString>
getCoordinates()
Deprecated, for removal: This API element is subject to removal in a future version.Returns a list of coordinates for this Geometry type.LineString
getExteriorBoundary()
Deprecated, for removal: This API element is subject to removal in a future version.Returns a LineString representing the exterior boundary of this Polygon.List<LineString>
getInteriorBoundaries()
Deprecated, for removal: This API element is subject to removal in a future version.Returns a (possibly empty) List of LineStrings, one for each hole inside the external boundary of this polygon.int
hashCode()
Deprecated, for removal: This API element is subject to removal in a future version.String
toString()
Deprecated, for removal: This API element is subject to removal in a future version.
-
-
-
Method Detail
-
getCoordinates
public List<LineString> getCoordinates()
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:Geometry
Returns a list of coordinates for this Geometry type. For something like a Point, this will be a pair of lat/long coordinates, but for more complex types this will be a list of other Geometry objects. Used for serialisation to MongoDB.- Specified by:
getCoordinates
in interfaceGeometry
- Returns:
- a List containing either Geometry objects, or a pair of coordinates as doubles
-
getExteriorBoundary
public LineString getExteriorBoundary()
Deprecated, for removal: This API element is subject to removal in a future version.Returns a LineString representing the exterior boundary of this Polygon. Polygons should have an exterior boundary where the end point is the same as the start point.- Returns:
- a LineString containing the points that make up the external boundary of this Polygon.
-
getInteriorBoundaries
public List<LineString> getInteriorBoundaries()
Deprecated, for removal: This API element is subject to removal in a future version.Returns a (possibly empty) List of LineStrings, one for each hole inside the external boundary of this polygon.- Returns:
- a List of LineStrings where each LineString represents an internal boundary or hole.
-
hashCode
public int hashCode()
Deprecated, for removal: This API element is subject to removal in a future version.
-
equals
public boolean equals(Object o)
Deprecated, for removal: This API element is subject to removal in a future version.
-
toString
public String toString()
Deprecated, for removal: This API element is subject to removal in a future version.
-
convert
public Polygon convert()
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:Geometry
Converts this type to the driver type
-
convert
public Polygon convert(@Nullable CoordinateReferenceSystem crs)
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:Geometry
Converts this type to the driver type
-
-