> ## Documentation Index
> Fetch the complete documentation index at: https://docs.wherobots.com/llms.txt
> Use this file to discover all available pages before exploring further.

# GeoDataFrame

> A pandas-on-Spark DataFrame with a geometry column and the GeoPandas API.

```python theme={"system"}
from sedona.spark.geopandas import GeoDataFrame
```

```python theme={"system"}
GeoDataFrame(
    data=None,
    index=None,
    columns=None,
    dtype=None,
    copy=False,
    geometry: Any | None = None,
    crs: Any | None = None,
    **kwargs,
)
```

A pandas-on-Spark DataFrame for geospatial data with geometry columns.

GeoDataFrame extends pyspark.pandas.DataFrame to provide geospatial operations
using Apache Sedona's spatial functions. It maintains compatibility with
GeoPandas GeoDataFrame while operating on distributed datasets.

## Parameters

<ParamField path="data" type="dict, array-like, DataFrame, or GeoDataFrame" default="None">
  Data to initialize the GeoDataFrame. Can be a dictionary, array-like structure,
  pandas DataFrame, GeoPandas GeoDataFrame, or another GeoDataFrame.
</ParamField>

<ParamField path="index" type="Index or array - like" default="None">
  Index to use for the resulting frame.
</ParamField>

<ParamField path="columns" type="Index or array - like" default="None">
  Column labels to use for the resulting frame.
</ParamField>

<ParamField path="dtype" default="None" />

<ParamField path="copy" default="False" />

<ParamField path="geometry" type="Any | None" default="None">
  Column name, array of geometries, or GeoSeries to use as the active geometry.
  If None, will look for existing geometry columns.
</ParamField>

<ParamField path="crs" type="Any | None" default="None">
  Coordinate Reference System for the geometries.
</ParamField>

<ParamField path="kwargs" />

<Note>
  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).

  Performance Considerations:

  * Operations are distributed across Spark cluster
  * Avoid converting to GeoPandas (.to\_geopandas()) on large datasets
  * Use .sample() for testing with large datasets
  * Spatial joins are optimized for distributed processing

  Geometry Column Management:

  * Supports multiple geometry columns
  * One geometry column is designated as 'active' at a time
  * Active geometry is used for spatial operations and plotting
  * Use set\_geometry() to change the active geometry column
</Note>

**See also**

* `geopandas.GeoDataFrame`: The GeoPandas equivalent
* `sedona.spark.geopandas.GeoSeries`: Series with geometry data

## Examples

```python theme={"system"}
>>> from shapely.geometry import Point, Polygon
>>> from sedona.spark.geopandas import GeoDataFrame
>>> import pandas as pd
>>>
>>> # Create from dictionary with geometry
>>> data = {
...     'name': ['A', 'B', 'C'],
...     'geometry': [Point(0, 0), Point(1, 1), Point(2, 2)]
... }
>>> gdf = GeoDataFrame(data, crs='EPSG:4326')
>>> gdf
     name   geometry
0       A   POINT (0 0)
1       B   POINT (1 1)
2       C   POINT (2 2)
>>>
>>> # Spatial operations
>>> buffered = gdf.buffer(0.1)
>>> buffered.area
0    0.031416
1    0.031416
2    0.031416
dtype: float64
>>>
>>> # Spatial joins
>>> polygons = GeoDataFrame({
...     'region': ['Region1', 'Region2'],
...     'geometry': [
...         Polygon([(-1, -1), (1, -1), (1, 1), (-1, 1)]),
...         Polygon([(0.5, 0.5), (2.5, 0.5), (2.5, 2.5), (0.5, 2.5)])
...     ]
... })
>>> result = gdf.sjoin(polygons, how='left', predicate='within')
>>> result['region']
0    Region1
1    Region2
2    Region2
dtype: object
```

## Properties

| Name | Description |
| - | - |
| [`active_geometry_name`](/reference/wherobots-db/python/geopandas/geodataframe/active_geometry_name) | Return the name of the active geometry column |
| [`area`](/reference/wherobots-db/python/geopandas/geodataframe/area) | Returns a Series containing the area of each geometry in the GeoSeries expressed in the units of the CRS. |
| [`boundary`](/reference/wherobots-db/python/geopandas/geodataframe/boundary) | Returns a GeoSeries of lower dimensional objects representing each geometry's set-theoretic boundary. |
| [`bounds`](/reference/wherobots-db/python/geopandas/geodataframe/bounds) | Returns a DataFrame with columns minx, miny, maxx, maxy values containing the bounds for each geometry. |
| [`centroid`](/reference/wherobots-db/python/geopandas/geodataframe/centroid) | Returns a GeoSeries of points representing the centroid of each geometry. |
| [`convex_hull`](/reference/wherobots-db/python/geopandas/geodataframe/convex_hull) | Return a GeoSeries of geometries representing the convex hull of each geometry. |
| [`crs`](/reference/wherobots-db/python/geopandas/geodataframe/crs) | |
| [`cx`](/reference/wherobots-db/python/geopandas/geodataframe/cx) | Select geometries that intersect a coordinate bounding box. |
| [`envelope`](/reference/wherobots-db/python/geopandas/geodataframe/envelope) | Returns a GeoSeries of geometries representing the envelope of each geometry. |
| [`exterior`](/reference/wherobots-db/python/geopandas/geodataframe/exterior) | Return the outer boundary of each polygon geometry. |
| [`geom_type`](/reference/wherobots-db/python/geopandas/geodataframe/geom_type) | Returns a series of strings specifying the geometry type of each geometry of each object. |
| [`has_m`](/reference/wherobots-db/python/geopandas/geodataframe/has_m) | Return a Series of dtype('bool') with value True for features that have an m-component. |
| [`has_sindex`](/reference/wherobots-db/python/geopandas/geodataframe/has_sindex) | Check the existence of the spatial index without generating it. |
| [`has_z`](/reference/wherobots-db/python/geopandas/geodataframe/has_z) | Returns a Series of dtype('bool') with value True for features that have a z-component. |
| [`interiors`](/reference/wherobots-db/python/geopandas/geodataframe/interiors) | Return a Series of lists containing polygon interior rings. |
| [`is_ccw`](/reference/wherobots-db/python/geopandas/geodataframe/is_ccw) | Return a Series of dtype('bool') with value True if a LineString or LinearRing is counter-clockwise. |
| [`is_closed`](/reference/wherobots-db/python/geopandas/geodataframe/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`](/reference/wherobots-db/python/geopandas/geodataframe/is_empty) | Returns a Series of dtype('bool') with value True for empty geometries. |
| [`is_ring`](/reference/wherobots-db/python/geopandas/geodataframe/is_ring) | Return a Series of dtype('bool') with value True for features that are closed. |
| [`is_simple`](/reference/wherobots-db/python/geopandas/geodataframe/is_simple) | Returns a Series of dtype('bool') with value True for geometries that do not cross themselves. |
| [`is_valid`](/reference/wherobots-db/python/geopandas/geodataframe/is_valid) | Returns a Series of dtype('bool') with value True for geometries that are valid. |
| [`length`](/reference/wherobots-db/python/geopandas/geodataframe/length) | Returns a Series containing the length of each geometry in the GeoSeries. |
| [`sindex`](/reference/wherobots-db/python/geopandas/geodataframe/sindex) | Returns a spatial index for the GeoSeries. |
| [`total_bounds`](/reference/wherobots-db/python/geopandas/geodataframe/total_bounds) | Returns a tuple containing minx, miny, maxx, maxy values for the bounds of the series as a whole. |
| [`type`](/reference/wherobots-db/python/geopandas/geodataframe/type) | Return the geometry type of each geometry in the GeoSeries. |
| [`unary_union`](/reference/wherobots-db/python/geopandas/geodataframe/unary_union) | Returns a geometry containing the union of all geometries in the GeoSeries. |

## Methods

| Name | Description |
| - | - |
| [`affine_transform`](/reference/wherobots-db/python/geopandas/geodataframe/affine_transform) | Return a GeoSeries with transformed geometries. |
| [`buffer`](/reference/wherobots-db/python/geopandas/geodataframe/buffer) | Returns a GeoSeries with all geometries buffered by the specified distance. |
| [`build_area`](/reference/wherobots-db/python/geopandas/geodataframe/build_area) | Create an areal geometry formed by the constituent linework. |
| [`clip`](/reference/wherobots-db/python/geopandas/geodataframe/clip) | Clip geometries to a polygonal or rectangular mask. |
| [`clip_by_rect`](/reference/wherobots-db/python/geopandas/geodataframe/clip_by_rect) | Returns a GeoSeries of the portions of geometry within the given rectangle. |
| [`concave_hull`](/reference/wherobots-db/python/geopandas/geodataframe/concave_hull) | Return a GeoSeries of geometries representing the concave hull of vertices of each geometry. |
| [`constrained_delaunay_triangles`](/reference/wherobots-db/python/geopandas/geodataframe/constrained_delaunay_triangles) | Return the constrained Delaunay triangulation of each polygon. |
| [`contains`](/reference/wherobots-db/python/geopandas/geodataframe/contains) | Returns a Series of dtype('bool') with value True for each aligned geometry that contains other. |
| [`contains_properly`](/reference/wherobots-db/python/geopandas/geodataframe/contains_properly) | Returns a Series of dtype('bool') with value True for each aligned geometry that properly contains other. |
| [`copy`](/reference/wherobots-db/python/geopandas/geodataframe/copy) | Make a copy of this GeoDataFrame object. |
| [`count_coordinates`](/reference/wherobots-db/python/geopandas/geodataframe/count_coordinates) | Return a Series of dtype('int') with the number of coordinate tuples in each geometry. |
| [`count_geometries`](/reference/wherobots-db/python/geopandas/geodataframe/count_geometries) | Return a Series of dtype('int') with the number of geometries in each multi-geometry or geometry collection. |
| [`count_interior_rings`](/reference/wherobots-db/python/geopandas/geodataframe/count_interior_rings) | Return a Series of dtype('int') with the number of interior rings (holes) in each polygon geometry. |
| [`covered_by`](/reference/wherobots-db/python/geopandas/geodataframe/covered_by) | Returns a Series of dtype('bool') with value True for each aligned geometry that is entirely covered by other. |
| [`covers`](/reference/wherobots-db/python/geopandas/geodataframe/covers) | Returns a Series of dtype('bool') with value True for each aligned geometry that is entirely covering other. |
| [`crosses`](/reference/wherobots-db/python/geopandas/geodataframe/crosses) | Returns a Series of dtype('bool') with value True for each aligned geometry that cross other. |
| [`delaunay_triangles`](/reference/wherobots-db/python/geopandas/geodataframe/delaunay_triangles) | Return Delaunay triangulation of the vertices of each geometry. |
| [`difference`](/reference/wherobots-db/python/geopandas/geodataframe/difference) | Returns a GeoSeries of the points in each aligned geometry that are not in other. |
| [`disjoint`](/reference/wherobots-db/python/geopandas/geodataframe/disjoint) | Returns a Series of dtype('bool') with value True for each aligned geometry that is disjoint from other. |
| [`dissolve`](/reference/wherobots-db/python/geopandas/geodataframe/dissolve) | Dissolve geometries within groups using distributed aggregation. |
| [`distance`](/reference/wherobots-db/python/geopandas/geodataframe/distance) | Returns a Series containing the distance to aligned other. |
| [`dwithin`](/reference/wherobots-db/python/geopandas/geodataframe/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`](/reference/wherobots-db/python/geopandas/geodataframe/estimate_utm_crs) | Return the estimated UTM CRS based on the bounds of the dataset. |
| [`explode`](/reference/wherobots-db/python/geopandas/geodataframe/explode) | Explode multi-part geometries into separate rows. |
| [`extract_unique_points`](/reference/wherobots-db/python/geopandas/geodataframe/extract_unique_points) | Return a GeoSeries of MultiPoints representing all distinct vertices of each geometry. |
| [`force_2d`](/reference/wherobots-db/python/geopandas/geodataframe/force_2d) | Force the dimensionality of a geometry to 2D. |
| [`force_3d`](/reference/wherobots-db/python/geopandas/geodataframe/force_3d) | Force the dimensionality of a geometry to 3D. |
| [`frechet_distance`](/reference/wherobots-db/python/geopandas/geodataframe/frechet_distance) | Returns a Series containing the discrete Fréchet distance to aligned other. |
| [`from_arrow`](/reference/wherobots-db/python/geopandas/geodataframe/from_arrow) | Construct a GeoDataFrame from a Arrow table object based on GeoArrow extension types. |
| [`from_dict`](/reference/wherobots-db/python/geopandas/geodataframe/from_dict) | Construct a GeoDataFrame from a dictionary. |
| [`from_features`](/reference/wherobots-db/python/geopandas/geodataframe/from_features) | Construct a GeoDataFrame from GeoJSON-like features. |
| [`from_file`](/reference/wherobots-db/python/geopandas/geodataframe/from_file) | Alternate constructor to create a GeoDataFrame from a file. |
| [`geom_equals`](/reference/wherobots-db/python/geopandas/geodataframe/geom_equals) | Returns a Series of dtype('bool') with value True for each aligned geometry equal to other. |
| [`geom_equals_exact`](/reference/wherobots-db/python/geopandas/geodataframe/geom_equals_exact) | Return True for geometries that equal aligned other to a given tolerance, otherwise False. |
| [`geom_equals_identical`](/reference/wherobots-db/python/geopandas/geodataframe/geom_equals_identical) | Return True for geometries that are identical to aligned other, otherwise False. |
| [`get_coordinates`](/reference/wherobots-db/python/geopandas/geodataframe/get_coordinates) | Get coordinates as a distributed pandas-on-Spark DataFrame. |
| [`get_geometry`](/reference/wherobots-db/python/geopandas/geodataframe/get_geometry) | Returns the n-th geometry from a collection of geometries (0-indexed). |
| [`hausdorff_distance`](/reference/wherobots-db/python/geopandas/geodataframe/hausdorff_distance) | Returns a Series containing the Hausdorff distance to aligned other. |
| [`hilbert_distance`](/reference/wherobots-db/python/geopandas/geodataframe/hilbert_distance) | Calculate the distance along a Hilbert curve. |
| [`interpolate`](/reference/wherobots-db/python/geopandas/geodataframe/interpolate) | Return a point at the specified distance along each geometry. |
| [`intersection`](/reference/wherobots-db/python/geopandas/geodataframe/intersection) | Returns a GeoSeries of the intersection of points in each aligned geometry with other. |
| [`intersection_all`](/reference/wherobots-db/python/geopandas/geodataframe/intersection_all) | Returns a geometry containing the intersection of all geometries in the GeoSeries. |
| [`intersects`](/reference/wherobots-db/python/geopandas/geodataframe/intersects) | Returns a Series of dtype('bool') with value True for each aligned geometry that intersects other. |
| [`invalid_coverage_edges`](/reference/wherobots-db/python/geopandas/geodataframe/invalid_coverage_edges) | Return edges causing invalid polygonal coverage for each geometry. |
| [`is_valid_coverage`](/reference/wherobots-db/python/geopandas/geodataframe/is_valid_coverage) | Return whether the geometry column forms a valid polygonal coverage. |
| [`is_valid_reason`](/reference/wherobots-db/python/geopandas/geodataframe/is_valid_reason) | Returns a Series of strings with the reason for invalidity of each geometry. |
| [`line_merge`](/reference/wherobots-db/python/geopandas/geodataframe/line_merge) | Return merged LineStrings. |
| [`make_valid`](/reference/wherobots-db/python/geopandas/geodataframe/make_valid) | Repairs invalid geometries. |
| [`maximum_inscribed_circle`](/reference/wherobots-db/python/geopandas/geodataframe/maximum_inscribed_circle) | Return radius lines for the largest circles within polygonal geometries. |
| [`minimum_bounding_circle`](/reference/wherobots-db/python/geopandas/geodataframe/minimum_bounding_circle) | Return a GeoSeries of geometries representing the minimum bounding circle that encloses each geometry. |
| [`minimum_bounding_radius`](/reference/wherobots-db/python/geopandas/geodataframe/minimum_bounding_radius) | Return a Series of the radii of the minimum bounding circles that enclose each geometry. |
| [`minimum_clearance`](/reference/wherobots-db/python/geopandas/geodataframe/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`](/reference/wherobots-db/python/geopandas/geodataframe/minimum_clearance_line) | Return linestrings whose endpoints define the minimum clearance. |
| [`minimum_rotated_rectangle`](/reference/wherobots-db/python/geopandas/geodataframe/minimum_rotated_rectangle) | Return the minimum rotated rectangle (oriented envelope) that encloses each geometry. |
| [`normalize`](/reference/wherobots-db/python/geopandas/geodataframe/normalize) | Return a GeoSeries of normalized geometries. |
| [`offset_curve`](/reference/wherobots-db/python/geopandas/geodataframe/offset_curve) | Returns a line at a given offset distance from each linear geometry. |
| [`orient_polygons`](/reference/wherobots-db/python/geopandas/geodataframe/orient_polygons) | Return geometries with a consistent polygon ring orientation. |
| [`overlaps`](/reference/wherobots-db/python/geopandas/geodataframe/overlaps) | Returns True for all aligned geometries that overlap other, else False. |
| [`overlay`](/reference/wherobots-db/python/geopandas/geodataframe/overlay) | Perform a distributed spatial overlay with another GeoDataFrame. |
| [`plot`](/reference/wherobots-db/python/geopandas/geodataframe/plot) | Plot a GeoDataFrame. |
| [`polygonize`](/reference/wherobots-db/python/geopandas/geodataframe/polygonize) | Create polygons formed from the linework of a GeoSeries. |
| [`project`](/reference/wherobots-db/python/geopandas/geodataframe/project) | Return the distance along each geometry nearest to other. |
| [`relate`](/reference/wherobots-db/python/geopandas/geodataframe/relate) | Returns the DE-9IM matrix string for the relationship between each geometry and other. |
| [`relate_pattern`](/reference/wherobots-db/python/geopandas/geodataframe/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`](/reference/wherobots-db/python/geopandas/geodataframe/remove_repeated_points) | Return a GeoSeries with duplicate points removed. |
| [`rename_geometry`](/reference/wherobots-db/python/geopandas/geodataframe/rename_geometry) | Renames the GeoDataFrame geometry column to the specified name. |
| [`representative_point`](/reference/wherobots-db/python/geopandas/geodataframe/representative_point) | Return a point that is guaranteed to be within each geometry. |
| [`reverse`](/reference/wherobots-db/python/geopandas/geodataframe/reverse) | Return a GeoSeries with the coordinate order reversed. |
| [`rotate`](/reference/wherobots-db/python/geopandas/geodataframe/rotate) | Return a GeoSeries with rotated geometries. |
| [`sample_points`](/reference/wherobots-db/python/geopandas/geodataframe/sample_points) | Sample points from each geometry. |
| [`scale`](/reference/wherobots-db/python/geopandas/geodataframe/scale) | Return a GeoSeries with scaled geometries. |
| [`segmentize`](/reference/wherobots-db/python/geopandas/geodataframe/segmentize) | Returns a GeoSeries with vertices added to line segments based on maximum segment length. |
| [`set_crs`](/reference/wherobots-db/python/geopandas/geodataframe/set_crs) | Set the Coordinate Reference System (CRS) of the GeoDataFrame. |
| [`set_geometry`](/reference/wherobots-db/python/geopandas/geodataframe/set_geometry) | Set the GeoDataFrame geometry using either an existing column or the specified input. |
| [`shared_paths`](/reference/wherobots-db/python/geopandas/geodataframe/shared_paths) | Return the paths shared by each geometry and other. |
| [`shortest_line`](/reference/wherobots-db/python/geopandas/geodataframe/shortest_line) | Returns the shortest line between each geometry in the GeoSeries and other. |
| [`simplify`](/reference/wherobots-db/python/geopandas/geodataframe/simplify) | Returns a GeoSeries containing a simplified representation of each geometry. |
| [`simplify_coverage`](/reference/wherobots-db/python/geopandas/geodataframe/simplify_coverage) | Simplify an edge-matched polygonal coverage using distributed joins. |
| [`sjoin`](/reference/wherobots-db/python/geopandas/geodataframe/sjoin) | Spatial join of two GeoDataFrames. |
| [`sjoin_nearest`](/reference/wherobots-db/python/geopandas/geodataframe/sjoin_nearest) | Join points to their nearest neighbors using Sedona KNN semantics. |
| [`skew`](/reference/wherobots-db/python/geopandas/geodataframe/skew) | Return a GeoSeries with skewed geometries. |
| [`snap`](/reference/wherobots-db/python/geopandas/geodataframe/snap) | Snap the vertices and segments of the geometry to vertices of the reference. |
| [`symmetric_difference`](/reference/wherobots-db/python/geopandas/geodataframe/symmetric_difference) | Return a GeoSeries of the symmetric difference of points in each aligned geometry with other. |
| [`to_arrow`](/reference/wherobots-db/python/geopandas/geodataframe/to_arrow) | Encode a GeoDataFrame to GeoArrow format. |
| [`to_crs`](/reference/wherobots-db/python/geopandas/geodataframe/to_crs) | Transform geometries to a new coordinate reference system. |
| [`to_file`](/reference/wherobots-db/python/geopandas/geodataframe/to_file) | Write the GeoDataFrame to a file. |
| [`to_geopandas`](/reference/wherobots-db/python/geopandas/geodataframe/to_geopandas) | Note: Unlike in pandas and geopandas, Sedona will always return a general Index. |
| [`to_json`](/reference/wherobots-db/python/geopandas/geodataframe/to_json) | Returns a GeoJSON representation of the GeoDataFrame as a string. |
| [`to_parquet`](/reference/wherobots-db/python/geopandas/geodataframe/to_parquet) | Write the GeoDataFrame to a GeoParquet file. |
| [`to_spark_pandas`](/reference/wherobots-db/python/geopandas/geodataframe/to_spark_pandas) | Convert the GeoDataFrame to a Spark Pandas DataFrame. |
| [`to_wkb`](/reference/wherobots-db/python/geopandas/geodataframe/to_wkb) | Encode all geometry columns in the GeoDataFrame to WKB. |
| [`to_wkt`](/reference/wherobots-db/python/geopandas/geodataframe/to_wkt) | Encode all geometry columns in the GeoDataFrame to WKT. |
| [`touches`](/reference/wherobots-db/python/geopandas/geodataframe/touches) | Returns a Series of dtype('bool') with value True for each aligned geometry that touches other. |
| [`transform`](/reference/wherobots-db/python/geopandas/geodataframe/transform) | Apply a function to geometry coordinates in distributed batches. |
| [`translate`](/reference/wherobots-db/python/geopandas/geodataframe/translate) | Return a GeoSeries with translated geometries. |
| [`union`](/reference/wherobots-db/python/geopandas/geodataframe/union) | Return a GeoSeries of the union of points in each aligned geometry with other. |
| [`union_all`](/reference/wherobots-db/python/geopandas/geodataframe/union_all) | Returns a geometry containing the union of all geometries in the GeoSeries. |
| [`voronoi_polygons`](/reference/wherobots-db/python/geopandas/geodataframe/voronoi_polygons) | Return Voronoi diagram of the vertices of each geometry. |
| [`within`](/reference/wherobots-db/python/geopandas/geodataframe/within) | Returns a Series of dtype('bool') with value True for each aligned geometry that is within other. |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.