apache / apache/sedona

bug: Sedona ST_Crosses doesn't support GeometryCollection

Open
#2,417 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
Java
Stars
2.4k
Forks
784
Avg merge
1d 12h
Merged PRs (30d)
58

Description

```sql
select st_crosses(st_geomfromtext('linestring (1 1, 1 2)'), st_geomfromtext('geometrycollection (point (1 1))'));

Caused by: java.lang.IllegalArgumentException: Operation does not support GeometryCollection arguments
at org.locationtech.jts.geom.Geometry.checkNotGeometryCollection(Geometry.java:1735)
at org.locationtech.jts.geom.GeometryRelate.relate(GeometryRelate.java:203)
at org.locationtech.jts.geom.Geometry.relate(Geometry.java:1006)
at org.locationtech.jts.geom.Geometry.crosses(Geometry.java:803)
at org.apache.sedona.common.Predicates.crosses(Predicates.java:47)
at org.apache.spark.sql.sedona_sql.expressions.ST_Crosses.evalGeom(Predicates.scala:176)
at org.apache.spark.sql.sedona_sql.expressions.ST_Predicate.eval(Predicates.scala:61)
```

Once this is fixed, we should remove [this workaround](https://github.com/apache/sedona/blob/9ea7c23633cf97b30a662465aa061feecfdaa79c/python/sedona/spark/geopandas/geoseries.py#L1221-L1230) in geopandas.

Contributor guide

Open the contributing guide

Research direction

Start with org.apache.sedona.common.Predicates.crosses and the Scala ST_Crosses path shown in the stack trace, then inspect the GeometryCollection workaround in python/sedona/spark/geopandas/geoseries.py at lines 1221-1230. Verify the SQL example no longer raises for GeometryCollection arguments, and remove the workaround once the predicate supports it.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, python, scala, sql
Domain
databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.