Route ST_Transform and sd_order through the injected CRS engine - #1102
Merged
Conversation
…ed CRS engine Add a `with_crs_engine` helper in sedona-proj that resolves the CRS engine from the `SedonaOptions` runtime when config options are present, falling back to `LazyProjEngine` otherwise. This keeps the `SedonaOptions` -> runtime engine extraction below sedona-proj in the crate graph so the geometry CRS functions can honor an injected engine. ST_Transform now passes its `config_options` through the helper instead of calling the process-global PROJ engine directly. sd_order gains an `invoke_batch_from_args` override so it can do the same. The sedona-raster-functions `crs_utils::with_crs_engine` becomes a thin delegator to the shared helper.
paleolimbot
approved these changes
Jul 31, 2026
paleolimbot
left a comment
Member
There was a problem hiding this comment.
Looks like the benchmark needs config options for the tester as well, but when CI is green this looks great.
No need to do it here if you'd rather not, but I believe that these two functions can also move to sedona-functions now (and we can drop the datafusion dependencies of sedona-proj.
The ST_Transform benchmark reprojects (EPSG:4326 -> EPSG:3857), which now needs a real CrsEngine on the tester since the default one errors. Add scalar_with_crs_engine / invoke_scalar_with_crs_engine and use them from the proj benchmark to inject LazyProjEngine, mirroring the reprojecting-function tests. The existing scalar / invoke_scalar keep their signatures and delegate with no engine.
…f sedona-proj Relocate the ST_Transform and sd_order (OrderLngLat) CRS functions from sedona-proj to sedona-functions, and move the SedonaOptions -> runtime CRS engine resolution (with_crs_engine) into sedona-common, where its config-less fallback is the erroring DefaultCrsEngine rather than the global PROJ engine. The session registers LazyProjEngine as the default, so real invocations are unaffected; reprojecting tests and the benchmark inject LazyProjEngine. The concrete PROJ engine (ProjCrsEngine/LazyProjEngine/with_global_proj_engine) stays in sedona-proj, which no longer hosts DataFusion UDFs and drops its datafusion-expr, sedona-functions, sedona-expr, and arrow dependencies.
…s / inject engine
james-willis
marked this pull request as ready for review
August 1, 2026 19:21
Contributor
Author
|
I moved those functions. @paleolimbot asked for a rereview because those changes are substantial. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Migrates the two geometry CRS functions (
ST_Transform,sd_order) off the process-global PROJ engine and onto theSedonaOptions-injectedCrsEngine, mirroring the raster functions. TheSedonaOptions-> runtime engine extraction now lives in awith_crs_enginehelper insedona-proj(with a config-less fallback toLazyProjEngine) so it sits belowsedona-projin the crate graph. Part of #1082.