Class GeometryCollection
java.lang.Object
org.apache.tinkerpop.gremlin.structure.geo.Geometry
org.apache.tinkerpop.gremlin.structure.geo.GeometryCollection
- All Implemented Interfaces:
Comparable<Geometry>
- Direct Known Subclasses:
MultiCurve,MultiPoint,MultiSurface
A geometry collection containing any mix of geometry types.
GeometryCollections are immutable.
- Since:
- 4.0.0
-
Method Summary
Modifier and TypeMethodDescriptionstatic GeometryCollectionempty()Creates an empty geometry collection withModel.CARTESIANmodel.static GeometryCollectionCreates an empty geometry collection with the specified model.booleanExact equality: same type, same SRID, same coordinates (including z flag).Returns an unmodifiable list of geometries in this collection.inthashCode()Hash code consistent with equals.booleanisEmpty()Returns true if this geometry is empty (has no coordinates).static GeometryCollectionCreates a geometry collection from an array of geometries.
-
Method Details
-
of
Creates a geometry collection from an array of geometries. All geometries must have the same SRID and z-dimension flag. A collection must have at least 1 geometry; useempty()orempty(Model)for an empty collection. An element may be empty, and may itself be a collection as long as the nesting limit is respected.- Parameters:
geometries- the geometries, at least 1 of them- Returns:
- the collection
- Throws:
IllegalArgumentException- ifgeometriesis null, if it holds no geometries, if any element is null, if the geometries do not all have the same SRID and the same z dimension, or if this collection taken together with its deepest nested element would exceed 32 levels of collection nesting, where every collection, including aMultiPoint,MultiLineStringorMultiPolygon, counts as one level- Since:
- 4.0.0
-
empty
Creates an empty geometry collection withModel.CARTESIANmodel.- Returns:
- an empty collection
- Since:
- 4.0.0
-
empty
Creates an empty geometry collection with the specified model.- Parameters:
model-Model.CARTESIANorModel.GEOGRAPHIC- Returns:
- an empty collection
- Throws:
IllegalArgumentException- ifmodelisModel.OTHERor null- Since:
- 4.0.0
-
geometries
Returns an unmodifiable list of geometries in this collection. Subclasses that admit only one kind of part narrow the element type:MultiPoint.geometries()returnsList<Point>,MultiLineString.geometries()returnsList<LineString>andMultiPolygon.geometries()returnsList<Polygon>.- Returns:
- the geometries as a list of
Geometryor a narrower element type, an empty list when this collection holds no parts - Since:
- 4.0.0
-
isEmpty
public boolean isEmpty()Description copied from class:GeometryReturns true if this geometry is empty (has no coordinates). For collections, returns true if all parts are empty. -
equals
Description copied from class:GeometryExact equality: same type, same SRID, same coordinates (including z flag). Coordinates are compared numerically, so -0.0 equals 0.0. -
hashCode
public int hashCode()Description copied from class:GeometryHash code consistent with equals. Zero values are normalized so -0.0 and 0.0 hash alike.
-