SpatialIndex
Parameters
The query methods (
query, nearest and intersection) behave
differently depending on how the index is constructed. When constructed
from a np.array, they return indices like GeoPandas. When constructed
from a GeoSeries or PySparkDataFrame, they return geometries.is_empty
Returns
size
Returns
valid_query_predicates
query predicate.
Added in version 2.0.0.
Returns
A new set containing
None, "intersects", and "contains".
None selects the default "intersects" behavior.intersection()
Parameters
Returns
List of geometries if constructed from a GeoSeries or PySparkDataFrame.
List of the corresponding indices if constructed from a np.array.
The result depends on how the index is constructed. When constructed
from a np.array, this method returns indices like GeoPandas. When
constructed from a GeoSeries or PySparkDataFrame, it returns geometries.Unlike GeoPandas, Sedona does not support geometry input of type
np.array or GeoSeries. Use
GeoSeries.intersects directly instead.nearest()
Parameters
Returns
List of geometries if constructed from a GeoSeries or PySparkDataFrame.
List of the corresponding indices if constructed from a np.array.
The result depends on how the index is constructed. When constructed
from a np.array, this method returns indices like GeoPandas. When
constructed from a GeoSeries or PySparkDataFrame, it returns geometries.Unlike GeoPandas, Sedona does not support geometry input of type
np.array or GeoSeries.
query()
Parameters
Spatial predicate to filter results. Must be either ‘intersects’ (default) or ‘contains’.
Returns
List of geometries if constructed from a GeoSeries or PySparkDataFrame.
List of the corresponding indices if constructed from a np.array.
The result depends on how the index is constructed. When constructed
from a np.array, this method returns indices like GeoPandas. When
constructed from a GeoSeries or PySparkDataFrame, it returns geometries.Unlike GeoPandas, Sedona does not support geometry input of type
np.array or GeoSeries. Use
GeoSeries.intersects directly instead.
