Class SpatialPartition
- java.lang.Object
-
- org.locationtech.jts.operation.union.SpatialPartition
-
public class SpatialPartition extends java.lang.Object
Computes a partition of a set of geometries into disjoint subsets, based on a provided equivalenceSpatialPartition.EquivalenceRelation
. Uses a spatial index for efficient processing.- Author:
- mdavis
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
SpatialPartition.EquivalenceRelation
An interface for a function to compute an equivalence relation.
-
Constructor Summary
Constructors Constructor Description SpatialPartition(Geometry[] geoms, SpatialPartition.EquivalenceRelation rel)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getCount()
Gets the number of partitionsGeometry
getGeometry(int s, int i)
Gets a geometry in a given partitionint
getItem(int s, int i)
Gets the index of a geometry in a partitionint
getSize(int s)
Gets the number of geometries in a given partition.
-
-
-
Constructor Detail
-
SpatialPartition
public SpatialPartition(Geometry[] geoms, SpatialPartition.EquivalenceRelation rel)
-
-
Method Detail
-
getCount
public int getCount()
Gets the number of partitions- Returns:
- the number of partitions
-
getSize
public int getSize(int s)
Gets the number of geometries in a given partition.- Parameters:
s
- the partition index- Returns:
- the size of the partition
-
getItem
public int getItem(int s, int i)
Gets the index of a geometry in a partition- Parameters:
s
- the partition indexi
- the item index- Returns:
- the item in the partition
-
getGeometry
public Geometry getGeometry(int s, int i)
Gets a geometry in a given partition- Parameters:
s
- the partition indexi
- the item index- Returns:
- the geometry for the given partition and item index
-
-