Skip to content

Conversation

@petern48
Copy link
Collaborator

@petern48 petern48 commented Oct 19, 2025

closes #232

}

#[test]
fn test_empty_geometry() {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The test suite here is the same as the geos buffer test suite plus this new function, which I also copied over to geos st_buffer to be sure it works the same.

Comment on lines +105 to +107
// PostGIS returns POLYGON EMPTY for all empty geometries
let is_empty = is_geometry_empty(wkb).map_err(|e| DataFusionError::External(Box::new(e)))?;
if is_empty {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I was running into an error here with POINT EMPTY since geo apparently doesn't support it.

not_impl_err!(
"geo kernel implementation on {}, {}, or {} not supported",
"MULTIPOINT with EMPTY child",
"POINT EMPTY",
"GEOMETRYCOLLECTION"

My current workaround is to use WKBExecutor here instead of GeoTypesExecutor and use our native is_geometry_empty check.

Wondering if there's a better way we can handle empty points in our item_to_geometry() method. The docstring for geo's try_to_point() function we are in there says returning None represents an empty point. Though returning None is not a safe option, so I can't think of anything better than this workaround atm.

@petern48
Copy link
Collaborator Author

Are there any convenient existing ways to benchmark this against the geos implementation? I'm not aware of any. Not yet sure if this is faster or not

@paleolimbot
Copy link
Member

Are there any convenient existing ways to benchmark this against the geos implementation?

This should work:

# on main
cargo bench -- st_buffer
# switch to your branch
cargo bench -- st_buffer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

perf: Investigate if geo's ST_Buffer implementation is faster than current geos

2 participants