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

MinimumBoundingRectangle()[source]
__init__(spatialRDD: SpatialRDD, Radius: float)[source]
Parameters:
  • spatialRDD – SpatialRDD

  • Radius – float

getCenterLineStringRDDAsSpatialRDD() LineStringRDD[source]
getCenterPointAsSpatialRDD() PointRDD[source]
getCenterPolygonAsSpatialRDD() PolygonRDD[source]
getCenterRectangleRDDAsSpatialRDD() RectangleRDD[source]

sedona.spark.core.SpatialRDD.linestring_rdd module

class sedona.spark.core.SpatialRDD.linestring_rdd.LineStringRDD[source]

Bases: SpatialRDD

MinimumBoundingRectangle()[source]
__init__

Represents a single multimethod.

sedona.spark.core.SpatialRDD.point_rdd module

class sedona.spark.core.SpatialRDD.point_rdd.PointRDD[source]

Bases: SpatialRDD

MinimumBoundingRectangle()[source]
__init__

Represents a single multimethod.

sedona.spark.core.SpatialRDD.polygon_rdd module

class sedona.spark.core.SpatialRDD.polygon_rdd.PolygonRDD[source]

Bases: SpatialRDD

MinimumBoundingRectangle()[source]
__init__

Represents a single multimethod.

sedona.spark.core.SpatialRDD.rectangle_rdd module

class sedona.spark.core.SpatialRDD.rectangle_rdd.RectangleRDD[source]

Bases: SpatialRDD

MinimumBoundingRectangle()[source]
__init__

Represents a single multimethod.

sedona.spark.core.SpatialRDD.spatial_rdd module

class sedona.spark.core.SpatialRDD.spatial_rdd.JvmGrids(jgrid, sc: SparkContext)[source]

Bases: object

__init__(jgrid, sc: SparkContext) None

Method generated by attrs for class JvmGrids.

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.

cache()[source]
count()[source]
persist(storage_level: StorageLevel)[source]
saveAsObjectFile(location: str)[source]
unpersist()[source]
class sedona.spark.core.SpatialRDD.spatial_rdd.SpatialPartitioner(name, jvm_partitioner)[source]

Bases: object

__init__(name, jvm_partitioner) None

Method generated by attrs for class SpatialPartitioner.

classmethod from_java_class_name(jvm_partitioner) SpatialPartitioner[source]
getGrids() List[Envelope][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

MinimumBoundingRectangle()[source]
__init__(sc: SparkContext | None = None)[source]
analyze() bool[source]

Analyze SpatialRDD :return: bool,

property approximateTotalCount: int

return:

boundary() Envelope[source]
Returns:

property boundaryEnvelope: Envelope

return:

buildIndex(indexType: str | IndexType, buildIndexOnSpatialPartitionedRDD: bool) bool[source]
Parameters:
  • indexType

  • buildIndexOnSpatialPartitionedRDD

Returns:

countWithoutDuplicates() int[source]
Returns:

countWithoutDuplicatesSPRDD() int[source]
Returns:

property fieldNames: List[str]

return:

flipCoordinates()[source]
getCRStransformation()[source]
Returns:

getJvmSpatialPartitionedRDD() JvmSpatialRDD[source]
getPartitioner() SpatialPartitioner[source]
Returns:

getRawJvmSpatialRDD() JvmSpatialRDD[source]
getRawSpatialRDD(**kwargs)
getSampleNumber() int[source]
Returns:

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.

get_srdd()[source]
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 jvm_grids: JvmGrids
property name
property rawJvmSpatialRDD: JvmSpatialRDD
property rawSpatialRDD

return:

saveAsGeoJSON(path: str)[source]
Parameters:

path

Returns:

saveAsWKB(path: str)[source]
Parameters:

path

Returns:

saveAsWKT(path: str)[source]
Parameters:

path

Returns:

setRawSpatialRDD(jrdd)[source]
Returns:

setSampleNumber(sampleNumber: int) bool[source]
Returns:

set_srdd(srdd)[source]
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

__init__(sparkContext: SparkContext) None

Method generated by attrs for class SpatialRDDFactory.

create_circle_rdd(**kwargs)
create_linestring_rdd(**kwargs)
create_point_rdd(**kwargs)
create_polygon_rdd(**kwargs)
create_rectangle_rdd(**kwargs)
create_spatial_rdd(**kwargs)

Module contents