feat(rust/sedona-functions): Implement ST_Force2D() and ST_Force3D()#606
feat(rust/sedona-functions): Implement ST_Force2D() and ST_Force3D()#606paleolimbot merged 15 commits intoapache:mainfrom
ST_Force2D() and ST_Force3D()#606Conversation
paleolimbot
left a comment
There was a problem hiding this comment.
Thank you! A few optional suggestions but also this is a huge improvement over the current situation as is.
and I'm not sure if it's worth making the trait complex.
I think it is, although feel free to file a follow-up ticket to track support of M values in transforms. M values are not heavily used although we (and PostGIS) have generally tried hard to make sure that we don't implement logic that can never extend to XYM geometries. We will probably have to make the trait more complex at some point anyway because the current version I don't think is all that performant in the context of huge arrays of coordinates.
| Some("POINT Z (3 4 5)"), | ||
| Some("POINT ZM (8 9 10 11)"), |
There was a problem hiding this comment.
Should a POINT M work here?
| Some("POINT EMPTY"), | ||
| Some("POINT Z EMPTY"), | ||
| Some("POINT (1 2)"), | ||
| Some("POINT Z (3 4 5)"), |
| Some("POINT EMPTY"), | ||
| Some("POINT (1 2)"), | ||
| Some("POINT Z (3 4 5)"), | ||
| Some("POINT (6 7)"), |
Co-authored-by: Dewey Dunnington <dewey@dunnington.ca>
|
I see, then I'll address the M dimension variants in another pull request.
This pull request doesn't close #554, so I don't think another ticket is needed :) |
ST_Force2D() and ST_Force3D()ST_Force2D() and ST_Force3D()
Part of #554
This pull request enhances
CrsTransformto change the number or types of dimensions by introducing these two changestransform_coord_3d()takes the dimension of the input coordinate because otherwise there's no way to distinguish if the z value ofcoordis from the original input or is filled.transform_coord()doesn't need this, but I'm not fully sureoutput_dim()returns the dimension of the outputThis pull request implements only
ST_Force2D()andST_Force3D(). In order to implement the variants related to M dimension,ST_Force3DMandST_Force4D, probablyCrsTransformneeds to provide more methods that handles M dimension. But, probably these will be used only byST_Force3DMandST_Force4D, and I'm not sure if it's worth making the trait complex.