Skip to content

feat: Add ST_LineMerge#78

Merged
kylebarron merged 6 commits into
datafusion-contrib:mainfrom
ianthetechie:st-linemerge-geos
Jun 12, 2026
Merged

feat: Add ST_LineMerge#78
kylebarron merged 6 commits into
datafusion-contrib:mainfrom
ianthetechie:st-linemerge-geos

Conversation

@ianthetechie

Copy link
Copy Markdown
Contributor

This adds ST_LineMerge via an optional dependency on GEOS. A pair of features control the GEOS linking: geos uses the version available on the system, and geos-static builds + statically links the library.

Fixes #77.

@github-actions github-actions Bot added the feat label May 28, 2026
Comment thread rust/geodatafusion/Cargo.toml Outdated
Comment on lines +124 to +127
// Assumptions:
// - No arrow arrays (record batches?) larger than 2GB.
// - A trip through WKB is probably the fastest path. The only other obvious option is using geo_types as an intermediate,
// but that is probably going to STILL require going out to WKB, since WKB looks to be the cheapest interchange format.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I believe these assumptions are valid, but flagging for extra visibility.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Ideally this would be refactored into an external helper to manage the conversion from GeoArrow to GEOS and back. We have some of those helpers already here and here.

Ideally if you're interested, we'd also move the core of the the operation into geoarrow-rs so that it could be shared across other libraries and not just geodatafusion. You can see what I prototyped with geoarrow-expr-geo. I started geoarrow-expr-geos with the same idea, but haven't worked on it at all.

What do you think?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah, that'd be ideal! I'm sure we're going to hit this pattern a bunch, and I agree it'd be great if we can get this done the "right" way once in a reusable manner before we start cranking out other GEOS-backed UDFs.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Cool; I haven't gotten back to this yet but probably will in the next week or so (unless you're already working on it). I think it belongs in geoarrow-rs long term too, and I've got at least one more function in my near-term needs that'll probably want GEOS so I'll try to work on that next.

Comment thread rust/geodatafusion/Cargo.toml Outdated
Comment thread rust/geodatafusion/Cargo.toml Outdated
@ianthetechie

Copy link
Copy Markdown
Contributor Author

Looks like GitHub Actions are stuck, but I think I've addressed all the feedback.

Comment thread rust/geodatafusion/src/udf/geos/processing/line_merge.rs Outdated
Comment thread .github/workflows/ci.yml Outdated
Comment on lines +26 to +29
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y libgeos-dev

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

CI is failing because your indentation is wrong

Image

@kylebarron kylebarron left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks!

@kylebarron
kylebarron merged commit b875a49 into datafusion-contrib:main Jun 12, 2026
7 checks passed
@ianthetechie
ianthetechie deleted the st-linemerge-geos branch June 12, 2026 17:14
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.

ST_LineMerge: geo or geos?

2 participants