I'm trying to convert the (x,y,z) coordinate from a compound CRS to another one. I came across this example online, and it does work for me.
import pyproj
cmpd_crs = pyproj.crs.CompoundCRS(name="WGS 84 + EGM96 height", components=["EPSG:4326", "EPSG:5773"])
trans = pyproj.Transformer.from_crs(cmpd_crs, "EPSG:4979") # epsg 4979 is Geographic 3D CRS
trans.transform(45, -122, 10)
This reports
(45.0, -122.0, -10.386833190917969)
However, when I tried to do other transformations between compound CRS using EPSG codes, it doesn't work. For example:
import pyproj
c1 = pyproj.crs.CompoundCRS(name="NAD83+cgvd28",components=["EPSG:4617","EPSG:5713"])
c2 = pyproj.crs.CompoundCRS(name="NAD83+cgvd2013",components=["EPSG:4617","EPSG:6647"])
transformer = pyproj.Transformer.from_crs(c1,c2)
transformer.transform(45, -122, 10)
This reports (without any change)
(45.0, -122.0, 10.0)
And
import pyproj
c1 = pyproj.crs.CompoundCRS(name="WGS84 + EGM96", components=["EPSG:4326", "EPSG:5773"])
c2 = pyproj.crs.CompoundCRS(name="NAD83+cgvd2013",components=["EPSG:4617","EPSG:6647"])
transformer = pyproj.Transformer.from_crs(c1,c2)
transformer.transform(45, -122, 10)
This reports (without any change)
(45.0, -122.0, 10.0)
Also
import pyproj
c1 = pyproj.crs.CompoundCRS(name="NAD83+cgvd28",components=["EPSG:4617","EPSG:5713"])
transformer = pyproj.Transformer.from_crs(c1,"EPSG:6649")
transformer.transform(45, -122, 10)
This reports (still without any change)
(45.0, -122.0, 10.0)
Any insights? Thanks a lot!!