Skip to content

feat(rust/sedona-geometry): Let CrsTransform handle M coordinate#619

Merged
paleolimbot merged 1 commit intoapache:mainfrom
yutannihilation:feat/transform_m
Feb 14, 2026
Merged

feat(rust/sedona-geometry): Let CrsTransform handle M coordinate#619
paleolimbot merged 1 commit intoapache:mainfrom
yutannihilation:feat/transform_m

Conversation

@yutannihilation
Copy link
Contributor

This is a followup of #606. Before addressing ST_Force3DM() and ST_Force4D(), I want to confirm if my approach is correct.

This pull request changes CrsTransform to have two additional methods to handle M coordinate (accordingly, transform_coord_3d() is renamed to transform_coord_xyz). Maybe I could create a separate transform_m() method, but I thought it's better to do the transformation in a single call.

  • transform_xym()
  • transform_xyzm()

This also requires transform_and_write_coords() to extract and fill M coordinate.

Copy link
Member

@paleolimbot paleolimbot left a comment

Choose a reason for hiding this comment

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

Thank you!

I think this is correct...perhaps a good auxiliary check for this would be to ensure that ST_Translate has tests for the case where the XYM geometries are input and there is a deltaZ, ensuring that the M values are untouched (I think these tests already exist). I suppose we don't have a deltaM argument there, but maybe we should add one and test that Z values are untouched for XYZ and XYZM input (not for this PR since I see the tests here).

I also wonder if we've made the transform slower, but we have at least one optimization that we haven't implemented yet (transform arrays instead of scalar coordinates) and maybe that's the time to check in. Getting the default dimension math right is more important (we can always optimize easy cases later).

@paleolimbot paleolimbot changed the title Let CrsTransform handle M coordinate feat(rust/sedona-geometry): Let CrsTransform handle M coordinate Feb 14, 2026
@paleolimbot paleolimbot merged commit e123520 into apache:main Feb 14, 2026
22 of 23 checks passed
@yutannihilation yutannihilation deleted the feat/transform_m branch February 14, 2026 23:40
@yutannihilation
Copy link
Contributor Author

Thanks!

I also wonder if we've made the transform slower

This was my main concern. But, I agree with you that we can optimize later.

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.

2 participants