Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 1 addition & 68 deletions python/sedona/spark/geopandas/geodataframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,73 +45,6 @@
# IMPLEMENTATION STATUS TRACKING
# ============================================================================

IMPLEMENTATION_STATUS = {
"IMPLEMENTED": [
"area",
"buffer",
"crs",
"geometry",
"active_geometry_name",
"sindex",
"rename_geometry",
"copy",
"sjoin",
"to_parquet",
],
"NOT_IMPLEMENTED": [
"to_geopandas",
"_to_geopandas",
"geom_type",
"type",
"length",
"is_valid",
"is_valid_reason",
"is_empty",
"is_simple",
"is_ring",
"is_ccw",
"is_closed",
"has_z",
"boundary",
"centroid",
"convex_hull",
"envelope",
"exterior",
"interiors",
"unary_union",
"count_coordinates",
"count_geometries",
"count_interior_rings",
"get_precision",
"get_geometry",
"concave_hull",
"delaunay_triangles",
"voronoi_polygons",
"minimum_rotated_rectangle",
"extract_unique_points",
"offset_curve",
"remove_repeated_points",
"set_precision",
"representative_point",
"minimum_bounding_circle",
"minimum_bounding_radius",
"minimum_clearance",
"normalize",
"make_valid",
"reverse",
"segmentize",
"transform",
"force_2d",
"force_3d",
"line_merge",
"union_all",
"intersection_all",
"contains",
"contains_properly",
],
"PARTIALLY_IMPLEMENTED": ["set_geometry"], # Only drop=True case is not implemented
}

IMPLEMENTATION_PRIORITY = {
"HIGH": [
"to_geopandas",
Expand Down Expand Up @@ -254,7 +187,7 @@ class GeoDataFrame(GeoFrame, pspd.DataFrame):
- 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 IMPLEMENTATION_STATUS)
- Not all GeoPandas methods are implemented yet (see Sedona GeoPandas docs).

Performance Considerations:
- Operations are distributed across Spark cluster
Expand Down
96 changes: 1 addition & 95 deletions python/sedona/spark/geopandas/geoseries.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,100 +60,6 @@
# IMPLEMENTATION STATUS TRACKING
# ============================================================================

IMPLEMENTATION_STATUS = {
"IMPLEMENTED": [
"area",
"buffer",
"bounds",
"centroid",
"contains",
"crs",
"distance",
"envelope",
"geometry",
"intersection",
"intersects",
"is_empty",
"is_simple",
"is_valid",
"is_valid_reason",
"length",
"make_valid",
"relate",
"set_crs",
"to_crs",
"to_geopandas",
"to_wkb",
"to_wkt",
"x",
"y",
"z",
"has_z",
"get_geometry",
"boundary",
"total_bounds",
"estimate_utm_crs",
"isna",
"isnull",
"notna",
"notnull",
"from_xy",
"copy",
"geom_type",
"sindex",
],
"NOT_IMPLEMENTED": [
"clip",
"contains_properly",
"convex_hull",
"count_coordinates",
"count_geometries",
"count_interior_rings",
"explode",
"force_2d",
"force_3d",
"from_file",
"from_shapely",
"from_arrow",
"line_merge",
"reverse",
"segmentize",
"to_json",
"to_arrow",
"to_file",
"transform",
"unary_union",
"union_all",
"intersection_all",
"type",
"is_ring",
"is_ccw",
"is_closed",
"get_precision",
"concave_hull",
"delaunay_triangles",
"voronoi_polygons",
"minimum_rotated_rectangle",
"exterior",
"extract_unique_points",
"offset_curve",
"interiors",
"remove_repeated_points",
"set_precision",
"representative_point",
"minimum_bounding_circle",
"minimum_bounding_radius",
"minimum_clearance",
"normalize",
"m",
],
"PARTIALLY_IMPLEMENTED": [
"fillna", # Limited parameter support (no 'limit' parameter)
"from_wkb",
"from_wkt", # Limited error handling options (only 'raise' supported)
],
}

IMPLEMENTATION_PRIORITY = {
"HIGH": [
"contains",
Expand Down Expand Up @@ -281,7 +187,7 @@ class GeoSeries(GeoFrame, pspd.Series):
- 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 IMPLEMENTATION_STATUS)
- Not all GeoPandas methods are implemented yet (see Sedona GeoPandas docs).

Performance Considerations:
- Operations are distributed across Spark cluster
Expand Down
43 changes: 43 additions & 0 deletions python/tests/geopandas/test_sjoin_match.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import pytest
import geopandas as gpd
from shapely.geometry import Point
from sedona.geopandas import sjoin
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
from sedona.geopandas import sjoin
from sedona.spark.geopandas import sjoin

I tried running this locally and found that there are also multiple issues with this test code (more than just this), that prevent it from running properly. Simple things like data types issues. @bunnysocks Do you need help with setting up your developer environment? You can follow these directions for setting it up, so you can test locally. Getting it working by following those instructions should work pretty smoothly. The logic this PR proposes is on the right track, but it will be very helpful for you to run the tests locally to avoid simple errors. Feel free to ping if you get stuck or need help, including with dev env setup.

e.g failed CI run
https://github.com/apache/sedona/actions/runs/18967529015/job/54243890091?pr=2466

from geopandas.tools import sjoin as gpd_sjoin
from geopandas import GeoDataFrame

class TestSJoinDWithinMatch:
def setup_method(self):
# Create test GeoDataFrames
self.gdf1 = gpd.GeoDataFrame(
{"id": [1, 2, 3]},
geometry=[Point(0, 0), Point(1, 1), Point(2, 2)],
crs="EPSG:4326"
)
self.gdf2 = gpd.GeoDataFrame(
{"id": ["a", "b", "c"]},
geometry=[Point(0.1, 0.1), Point(1.5, 1.5), Point(10, 10)],
crs="EPSG:4326"
)

def test_dwithin_equivalence(self):
"""Ensure Sedona and GeoPandas produce same results for dwithin() join."""
distance = 0.3

# Sedona join
sedona_result = sjoin(self.gdf1, self.gdf2, predicate="dwithin", distance=distance)
# GeoPandas join
gpd_result = gpd_sjoin(self.gdf1, self.gdf2, predicate="dwithin", distance=distance)

assert isinstance(sedona_result, GeoDataFrame)
assert isinstance(gpd_result, GeoDataFrame)

# Sort and compare IDs
sedona_pairs = set(zip(sedona_result["id_left"], sedona_result["id_right"]))
gpd_pairs = set(zip(gpd_result["id_left"], gpd_result["id_right"]))
assert sedona_pairs == gpd_pairs

def test_dwithin_small_distance(self):
"""Ensure small distance returns fewer or no matches."""
small_distance = 0.01
sedona_small = sjoin(self.gdf1, self.gdf2, predicate="dwithin", distance=small_distance)
assert len(sedona_small) <= 1
Loading