Skip to content

feat: ST_IsClosed#69

Merged
kylebarron merged 3 commits into
datafusion-contrib:mainfrom
oglego:feat/ST_IsClosed
Apr 24, 2026
Merged

feat: ST_IsClosed#69
kylebarron merged 3 commits into
datafusion-contrib:mainfrom
oglego:feat/ST_IsClosed

Conversation

@oglego
Copy link
Copy Markdown
Contributor

@oglego oglego commented Apr 23, 2026

Overview

This PR implements the ST_IsClosed spatial function. I added this to the Validation functions but if this should be housed elsewhere just let me know!

Change List

  • Created ST_IsClosed UDF implementation in rust/geodatafusion/src/udf/geo/validation/is_closed.rs
  • Registered IsClosed to the Python UDFs
  • Created test_validation.py to test Python UDF for ST_IsClosed
  • Updated README and marked ST_IsClosed as completed

Test Coverage

Added a test suite in is_closed.rs covering:

  • Closed, open, and single-segment LineStrings.
  • MultiLineStrings with mixed closure statuses.
  • Standard 0-dim and 2-dim geometries (Points, Polygons).

Linting

Ran cargo clippy --all-features --tests -- -D warnings

Running Tests

Ran cargo test --all-features

Documentation

Ran cargo doc --all-features --open

refactor: update ST_IsClosed implementation and add tests

refactor: update ST_IsClosed tests with comprehensive cases

chore: fixed format on is_closed.rs

feat: add ST_IsClosed to Python bindings and update tests

chore: fix formatting

refactor: move ST_IsClosed to validation module

refactor: move IsClosed from measurement to validation

refactor: update error with IsClosed UDF

refactor: add pytest validation test for ST_IsClosed UDF
@github-actions github-actions Bot added the feat label Apr 23, 2026
@kylebarron
Copy link
Copy Markdown
Collaborator

Thanks for the PR!

I added this to the Validation functions but if this should be housed elsewhere just let me know!

Would you be able to move this to "geometry accessors"

I intended to make the layout parallel to the sections in the PostGIS reference

image

@kylebarron
Copy link
Copy Markdown
Collaborator

@oglego
Copy link
Copy Markdown
Contributor Author

oglego commented Apr 23, 2026

Thank you for reviewing! Ahh ok, that makes sense, I'll work on moving the code and will update the PR once I've got it completed!

Copy link
Copy Markdown
Collaborator

@kylebarron kylebarron left a comment

Choose a reason for hiding this comment

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

looks good to me, thanks!

@kylebarron kylebarron merged commit 733a566 into datafusion-contrib:main Apr 24, 2026
7 checks passed
@oglego
Copy link
Copy Markdown
Contributor Author

oglego commented Apr 25, 2026

Awesome! Thanks again for reviewing!

@oglego oglego deleted the feat/ST_IsClosed branch May 4, 2026 20:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants