paleolimbot commented on code in PR #544:
URL: https://github.com/apache/sedona-db/pull/544#discussion_r2721764517


##########
python/sedonadb/tests/functions/test_transforms.py:
##########
@@ -31,6 +31,16 @@ def test_st_transform(eng):
     )
 
 
[email protected]("eng", [SedonaDB, PostGIS])
+def test_st_transform_3d(eng):
+    eng = eng.create_or_skip()
+    eng.assert_query_result(
+        "SELECT ST_Transform(ST_GeomFromText('POINT Z (1 1 1)'), 'EPSG:4326', 
'EPSG:4978')",
+        "POINT Z (6376201.805927448 111297.016517882 110568.792276973)",
+        wkt_precision=9,
+    )

Review Comment:
   This particular transformation is a great test case and an interesting one 
because it is 2D -> 3D. Does 2D input (e.g., POINT (-64 45)) work? I believe 
you can query the number of axes of a CRS to handle this:
   
   
https://github.com/apache/sedona-db/blob/main/c/sedona-proj/src/proj_dyn_bindgen.rs#L127-L128
   
   ...although we can do that later because I think 3D->3D is what the current 
code is set up to handle.
   
   Another good test would be 3D -> 2D (the inverse of this transform would be 
good) and 3D -> 3D like `EPSG:4326+EPSG:5701` (lon/lat with Z in meters) to 
`EPSG:4326+EPSG:8050` (lon/lat with Z in feet). You might have to get pyproj to 
render those to PROJJSON to get them to work in ST_Transform because our 
internal `deserialize_crs()` doesn't know how to parse compound CRSes yet.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to