sedona.spark.core.SpatialRDD package
Submodules
sedona.spark.core.SpatialRDD.circle_rdd module
- class sedona.spark.core.SpatialRDD.circle_rdd.CircleRDD(spatialRDD: SpatialRDD, Radius: float)[source]
Bases:
SpatialRDD
- __init__(spatialRDD: SpatialRDD, Radius: float)[source]
- Parameters:
spatialRDD – SpatialRDD
Radius – float
- getCenterLineStringRDDAsSpatialRDD() LineStringRDD [source]
- getCenterPolygonAsSpatialRDD() PolygonRDD [source]
- getCenterRectangleRDDAsSpatialRDD() RectangleRDD [source]
sedona.spark.core.SpatialRDD.linestring_rdd module
sedona.spark.core.SpatialRDD.point_rdd module
sedona.spark.core.SpatialRDD.polygon_rdd module
sedona.spark.core.SpatialRDD.rectangle_rdd module
sedona.spark.core.SpatialRDD.spatial_rdd module
- class sedona.spark.core.SpatialRDD.spatial_rdd.JvmGrids(jgrid, sc: SparkContext)[source]
Bases:
object
- class sedona.spark.core.SpatialRDD.spatial_rdd.JvmSpatialRDD(jsrdd, sc: SparkContext, tp: SpatialType)[source]
Bases:
object
- __init__(jsrdd, sc: SparkContext, tp: SpatialType) None
Method generated by attrs for class JvmSpatialRDD.
- persist(storage_level: StorageLevel)[source]
- class sedona.spark.core.SpatialRDD.spatial_rdd.SpatialPartitioner(name, jvm_partitioner)[source]
Bases:
object
- classmethod from_java_class_name(jvm_partitioner) SpatialPartitioner [source]
- class sedona.spark.core.SpatialRDD.spatial_rdd.SpatialRDD(sc: SparkContext | None = None)[source]
Bases:
object
- CRSTransform(sourceEpsgCRSCode: str, targetEpsgCRSCode: str) bool [source]
Function transforms coordinates from one crs to another one :param sourceEpsgCRSCode: crs, Coordinate Reference System to transform from :param targetEpsgCRSCode: crs, Coordinate Reference System to transform to :return: bool, True if transforming was correct
- buildIndex(indexType: str | IndexType, buildIndexOnSpatialPartitionedRDD: bool) bool [source]
- Parameters:
indexType
buildIndexOnSpatialPartitionedRDD
- Returns:
- getJvmSpatialPartitionedRDD() JvmSpatialRDD [source]
- getPartitioner() SpatialPartitioner [source]
- Returns:
- getRawJvmSpatialRDD() JvmSpatialRDD [source]
- getRawSpatialRDD(**kwargs)
- getSourceEpsgCode() str [source]
Function which returns source EPSG code when it is assigned. If not an empty String is returned. :return: str, source epsg code.
- getTargetEpsgCode() str [source]
Function which returns target EPSG code when it is assigned. If not an empty String is returned. :return: str, target epsg code.
- property grids: List[Envelope] | None
Returns grids for SpatialRDD, it is a list of Envelopes.
>> spatial_rdd.grids >> [Envelope(minx=10.0, maxx=12.0, miny=10.0, maxy=12.0)] :return:
- property indexedRDD
return:
- property indexedRawRDD
- property jvmSpatialPartitionedRDD: JvmSpatialRDD
- property name
- property rawJvmSpatialRDD: JvmSpatialRDD
- property rawSpatialRDD
return:
- property spatialPartitionedRDD
- spatialPartitioning(partitioning: str | GridType | SpatialPartitioner | List[Envelope], num_partitions: int | None = None) bool [source]
Calculate partitions and assign items in this RDD to a partition.
- Parameters:
partitioning – Partitioning type or existing SpatialPartitioner (e.g., one obtained from another SpatialRDD to align partitions among input data)
num_partitions – If partitioning is a GridType, the target number of partitions into which the RDD should be split.
- Returns:
True on success
- spatialPartitioningWithoutDuplicates(partitioning: str | GridType | SpatialPartitioner | List[Envelope], num_partitions: int | None = None) bool [source]
Calculate partitions and assign items in this RDD to a partition without introducing duplicates. This is not the desired behaviour for executing joins but is the correct option when partitioning in preparation for a distributed write.
- Parameters:
partitioning – Partitioning type or existing SpatialPartitioner (e.g., one obtained from another SpatialRDD to align partitions among input data)
num_partitions – If partitioning is a GridType, the target number of partitions into which the RDD should be split.
- Returns:
True on success
sedona.spark.core.SpatialRDD.spatial_rdd_factory module
- class sedona.spark.core.SpatialRDD.spatial_rdd_factory.SpatialRDDFactory(sparkContext: SparkContext)[source]
Bases:
ABC
- create_circle_rdd(**kwargs)
- create_linestring_rdd(**kwargs)
- create_point_rdd(**kwargs)
- create_polygon_rdd(**kwargs)
- create_rectangle_rdd(**kwargs)
- create_spatial_rdd(**kwargs)