from sedona.spark.geopandas import GeoSeries
GeoSeries(
data=None,
index=None,
dtype=None,
name=None,
copy=False,
fastpath=False,
crs=None,
**kwargs,
)
Parameters
array-like, GeoDataFrame, GeoSeries, or pandas Series
default:"None"
The input data for the GeoSeries.
array - like
default:"None"
The index for the GeoSeries.
dtype
default:"None"
Data type for the GeoSeries.
str
default:"None"
Name of the GeoSeries.
bool
default:"False"
Whether to copy the input data.
bool
default:"False"
Internal parameter for fast initialization.
pyproj.CRS
default:"None"
Coordinate Reference System for the GeoSeries.
This implementation differs from GeoPandas in several ways:
- Uses Spark for distributed processing
- Geometries are stored in WKB (Well-Known Binary) format internally
- Some methods may have different performance characteristics
- Not all GeoPandas methods are implemented yet (see Sedona GeoPandas docs).
- Operations are distributed across Spark cluster
- Avoid calling .to_geopandas() on large datasets
- Use .sample() for testing with large datasets
geopandas.GeoSeries: The GeoPandas equivalentsedona.spark.geopandas.GeoDataFrame: DataFrame with geometry column
Examples
>>> from shapely.geometry import Point, Polygon
>>> from sedona.spark.geopandas import GeoSeries
>>>
>>> # Create from geometries
>>> s = GeoSeries([Point(0, 0), Point(1, 1)], crs='EPSG:4326')
>>> s
0 POINT (0 0)
1 POINT (1 1)
dtype: geometry
>>>
>>> # Spatial operations
>>> s.buffer(0.1).area
0 0.031416
1 0.031416
dtype: float64
>>>
>>> # CRS operations
>>> s_utm = s.to_crs('EPSG:32633')
>>> s_utm.crs
<Projected CRS: EPSG:32633>
Name: WGS 84 / UTM zone 33N
...
>>> from shapely.geometry import Point
>>> import geopandas as gpd
>>> import pandas as pd
>>> from sedona.spark.geopandas import GeoSeries
Example 1: Initialize with GeoDataFrame
>>> gdf = gpd.GeoDataFrame({'geometry': [Point(1, 1), Point(2, 2)]})
>>> gs = GeoSeries(data=gdf)
>>> print(gs)
0 POINT (1 1)
1 POINT (2 2)
Name: geometry, dtype: geometry
Example 2: Initialize with GeoSeries
>>> gseries = gpd.GeoSeries([Point(1, 1), Point(2, 2)])
>>> gs = GeoSeries(data=gseries)
>>> print(gs)
0 POINT (1 1)
1 POINT (2 2)
dtype: geometry
Example 3: Initialize with pandas Series
>>> pseries = pd.Series([Point(1, 1), Point(2, 2)])
>>> gs = GeoSeries(data=pseries)
>>> print(gs)
0 POINT (1 1)
1 POINT (2 2)
dtype: geometry
Properties
| Name | Description |
|---|---|
area | Returns a Series containing the area of each geometry in the GeoSeries expressed in the units of the CRS. |
boundary | Returns a GeoSeries of lower dimensional objects representing each geometry’s set-theoretic boundary. |
bounds | Returns a DataFrame with columns minx, miny, maxx, maxy values containing the bounds for each geometry. |
centroid | Returns a GeoSeries of points representing the centroid of each geometry. |
convex_hull | Return a GeoSeries of geometries representing the convex hull of each geometry. |
crs | The Coordinate Reference System (CRS) as a pyproj.CRS object. |
cx | Select geometries that intersect a coordinate bounding box. |
envelope | Returns a GeoSeries of geometries representing the envelope of each geometry. |
exterior | Return the outer boundary of each polygon geometry. |
geom_type | Returns a series of strings specifying the geometry type of each geometry of each object. |
geometry | |
has_m | Return a Series of dtype(‘bool’) with value True for features that have an m-component. |
has_sindex | Check the existence of the spatial index without generating it. |
has_z | Returns a Series of dtype(‘bool’) with value True for features that have a z-component. |
interiors | Return a Series of lists containing polygon interior rings. |
is_ccw | Return a Series of dtype(‘bool’) with value True if a LineString or LinearRing is counter-clockwise. |
is_closed | Return a Series of dtype(‘bool’) with value True if a LineString’s or LinearRing’s first and last points are equal. |
is_empty | Returns a Series of dtype(‘bool’) with value True for empty geometries. |
is_ring | Return a Series of dtype(‘bool’) with value True for features that are closed. |
is_simple | Returns a Series of dtype(‘bool’) with value True for geometries that do not cross themselves. |
is_valid | Returns a Series of dtype(‘bool’) with value True for geometries that are valid. |
length | Returns a Series containing the length of each geometry in the GeoSeries. |
m | Return the m coordinate of point geometries in a GeoSeries |
sindex | Returns a spatial index for the GeoSeries. |
total_bounds | Returns a tuple containing minx, miny, maxx, maxy values for the bounds of the series as a whole. |
type | Return the geometry type of each geometry in the GeoSeries. |
unary_union | Returns a geometry containing the union of all geometries in the GeoSeries. |
x | Return the x location of point geometries in a GeoSeries |
y | Return the y location of point geometries in a GeoSeries |
z | Return the z location of point geometries in a GeoSeries |
Methods
| Name | Description |
|---|---|
affine_transform | Return a GeoSeries with transformed geometries. |
buffer | Returns a GeoSeries with all geometries buffered by the specified distance. |
build_area | Create an areal geometry formed by the constituent linework. |
clip | Clip geometries to a polygonal or rectangular mask. |
clip_by_rect | Returns a GeoSeries of the portions of geometry within the given rectangle. |
concave_hull | Return a GeoSeries of geometries representing the concave hull of vertices of each geometry. |
constrained_delaunay_triangles | Return the constrained Delaunay triangulation of each polygon. |
contains | Returns a Series of dtype(‘bool’) with value True for each aligned geometry that contains other. |
contains_properly | Returns a Series of dtype(‘bool’) with value True for each aligned geometry that properly contains other. |
copy | Make a copy of this GeoSeries object. |
count_coordinates | Return a Series of dtype(‘int’) with the number of coordinate tuples in each geometry. |
count_geometries | Return a Series of dtype(‘int’) with the number of geometries in each multi-geometry or geometry collection. |
count_interior_rings | Return a Series of dtype(‘int’) with the number of interior rings (holes) in each polygon geometry. |
covered_by | Returns a Series of dtype(‘bool’) with value True for each aligned geometry that is entirely covered by other. |
covers | Returns a Series of dtype(‘bool’) with value True for each aligned geometry that is entirely covering other. |
crosses | Returns a Series of dtype(‘bool’) with value True for each aligned geometry that cross other. |
delaunay_triangles | Return Delaunay triangulation of the vertices of each geometry. |
difference | Returns a GeoSeries of the points in each aligned geometry that are not in other. |
disjoint | Returns a Series of dtype(‘bool’) with value True for each aligned geometry that is disjoint from other. |
distance | Returns a Series containing the distance to aligned other. |
dwithin | Returns a Series of dtype(‘bool’) with value True for each aligned geometry that is within a set distance from other. |
estimate_utm_crs | Returns the estimated UTM CRS based on the bounds of the dataset. |
explode | Explode multi-part geometries into multiple single geometries. |
extract_unique_points | Return a GeoSeries of MultiPoints representing all distinct vertices of each geometry. |
fillna | Fill NA values with geometry (or geometries). |
force_2d | Force the dimensionality of a geometry to 2D. |
force_3d | Force the dimensionality of a geometry to 3D. |
frechet_distance | Returns a Series containing the discrete Fréchet distance to aligned other. |
from_arrow | Construct a GeoSeries from a Arrow array object with a GeoArrow extension type. |
from_file | Alternate constructor to create a GeoDataFrame from a file. |
from_wkb | Alternate constructor to create a GeoSeries from a list or array of WKB objects |
from_wkt | Alternate constructor to create a GeoSeries from a list or array of WKT objects |
from_xy | Alternate constructor to create a :class:~geopandas.GeoSeries of Point geometries from lists or arrays of x, y(, z) coordinates |
geom_equals | Returns a Series of dtype(‘bool’) with value True for each aligned geometry equal to other. |
geom_equals_exact | Return True for geometries that equal aligned other to a given tolerance, otherwise False. |
geom_equals_identical | Return True for geometries that are identical to aligned other, otherwise False. |
get_coordinates | Get coordinates as a distributed pandas-on-Spark DataFrame. |
get_geometry | Returns the n-th geometry from a collection of geometries (0-indexed). |
hausdorff_distance | Returns a Series containing the Hausdorff distance to aligned other. |
hilbert_distance | Calculate the distance along a Hilbert curve. |
interpolate | Return a point at the specified distance along each geometry. |
intersection | Returns a GeoSeries of the intersection of points in each aligned geometry with other. |
intersection_all | Returns a geometry containing the intersection of all geometries in the GeoSeries. |
intersects | Returns a Series of dtype(‘bool’) with value True for each aligned geometry that intersects other. |
invalid_coverage_edges | Return edges causing invalid polygonal coverage for each geometry. |
is_valid_coverage | Return whether the geometry column forms a valid polygonal coverage. |
is_valid_reason | Returns a Series of strings with the reason for invalidity of each geometry. |
isna | Detect missing values. |
isnull | Alias for isna method. |
line_merge | Return merged LineStrings. |
make_valid | Repairs invalid geometries. |
maximum_inscribed_circle | Return radius lines for the largest circles within polygonal geometries. |
minimum_bounding_circle | Return a GeoSeries of geometries representing the minimum bounding circle that encloses each geometry. |
minimum_bounding_radius | Return a Series of the radii of the minimum bounding circles that enclose each geometry. |
minimum_clearance | Return a Series containing the minimum clearance distance, which is the smallest distance by which a vertex of the geometry could be moved to produce an invalid geometry. |
minimum_clearance_line | Return linestrings whose endpoints define the minimum clearance. |
minimum_rotated_rectangle | Return the minimum rotated rectangle (oriented envelope) that encloses each geometry. |
normalize | Return a GeoSeries of normalized geometries. |
notna | Detect non-missing values. |
notnull | Alias for notna method. |
offset_curve | Returns a line at a given offset distance from each linear geometry. |
orient_polygons | Return geometries with a consistent polygon ring orientation. |
overlaps | Returns True for all aligned geometries that overlap other, else False. |
plot | Plot a GeoSeries. |
polygonize | Create polygons formed from the linework of a GeoSeries. |
project | Return the distance along each geometry nearest to other. |
relate | Returns the DE-9IM matrix string for the relationship between each geometry and other. |
relate_pattern | Returns a Series of dtype(‘bool’) with value True if the DE-9IM relationship between each geometry and other matches the specified pattern. |
remove_repeated_points | Return a GeoSeries with duplicate points removed. |
representative_point | Return a point that is guaranteed to be within each geometry. |
reverse | Return a GeoSeries with the coordinate order reversed. |
rotate | Return a GeoSeries with rotated geometries. |
sample_points | Sample points from each geometry. |
scale | Return a GeoSeries with scaled geometries. |
segmentize | Returns a GeoSeries with vertices added to line segments based on maximum segment length. |
set_crs | Set the Coordinate Reference System (CRS) of a GeoSeries. |
shared_paths | Return the paths shared by each geometry and other. |
shortest_line | Returns the shortest line between each geometry in the GeoSeries and other. |
simplify | Returns a GeoSeries containing a simplified representation of each geometry. |
simplify_coverage | Simplify an edge-matched polygonal coverage using distributed joins. |
skew | Return a GeoSeries with skewed geometries. |
snap | Snap the vertices and segments of the geometry to vertices of the reference. |
symmetric_difference | Return a GeoSeries of the symmetric difference of points in each aligned geometry with other. |
to_arrow | Encode a GeoSeries to GeoArrow format. |
to_crs | Returns a GeoSeries with all geometries transformed to a new coordinate reference system. |
to_file | Write the GeoSeries to a file. |
to_geoframe | |
to_geopandas | Convert the GeoSeries to a GeoPandas GeoSeries. |
to_json | Returns a GeoJSON string representation of the GeoSeries. |
to_parquet | Write the GeoSeries to a GeoParquet file. |
to_spark_pandas | |
to_wkb | Convert GeoSeries geometries to WKB |
to_wkt | Convert GeoSeries geometries to WKT |
touches | Returns a Series of dtype(‘bool’) with value True for each aligned geometry that touches other. |
transform | Apply a function to geometry coordinates in distributed batches. |
translate | Return a GeoSeries with translated geometries. |
union | Return a GeoSeries of the union of points in each aligned geometry with other. |
union_all | Returns a geometry containing the union of all geometries in the GeoSeries. |
voronoi_polygons | Return Voronoi diagram of the vertices of each geometry. |
within | Returns a Series of dtype(‘bool’) with value True for each aligned geometry that is within other. |

