-
Notifications
You must be signed in to change notification settings - Fork 221
Closed
Labels
axis-orderIssue related to axis order changes introduced in PROJ 6.Issue related to axis order changes introduced in PROJ 6.
Description
Issue:
When creating a transformer via transformer.from_proj and calling transform on a coordinate set, I expect the same result as calling transform via a transformer created by transformer.from_crs. This does not hold. When creating a transformer via .from_crs the X and Y are switched. See code below.
using:
python 3.7
pyproj 2.4.2.post1
Code:
print(__version__)
RDX = 103392.0
RDY = 468608.6
p1 = 'epsg:28992'
p2 = 'epsg:4326'
t_proj = Transformer.from_proj(proj_from=Proj(init=p1), proj_to=Proj(init=p2))
t_crs = Transformer.from_crs(crs_from=p1, crs_to=p2)
print(f"FROM_PROJ => {t_proj.transform(xx=RDX, yy=RDY)}")
print(f"FROM_CRS => {t_crs.transform(xx=RDX, yy=RDY)}")
coords_proj = t_proj.transform(xx=RDX, yy=RDY)
coords_crs = t_crs.transform(xx=RDX, yy=RDY)
print("Equal", coords_crs == coords_proj)
print("Flipped", coords_crs[0] == coords_proj[1] and coords_crs[1] == coords_proj[0])
Result:
2.4.2.post1
FROM_PROJ => (4.632256139162482, 52.20316882027802)
FROM_CRS => (52.20316882027802, 4.632256139162482)
Equal False
Flipped True
I tried this for multiple epsg codes, all show the same result.
Metadata
Metadata
Assignees
Labels
axis-orderIssue related to axis order changes introduced in PROJ 6.Issue related to axis order changes introduced in PROJ 6.