33from numpy .testing import assert_allclose , assert_almost_equal
44
55from pyproj import Proj , __proj_version__ , transform
6- from test .conftest import PROJ_GTE_92 , grids_available
6+ from test .conftest import PROJ_911 , PROJ_GTE_92 , PROJ_GTE_911 , grids_available
77
88
99def test_transform ():
@@ -52,6 +52,7 @@ def test_transform():
5252 assert_allclose (numpy .maximum .reduce (numpy .ravel (y3 - y1 )), 0 , atol = 1e-4 )
5353
5454
55+ @pytest .mark .xfail (PROJ_911 , reason = "Patch applied in conda-forge changes behavior" )
5556def test_transform_single_point_nad83_to_nad27 ():
5657 # projection 1: UTM zone 15, grs80 ellipse, NAD83 datum
5758 # (defined by epsg code 26915)
@@ -67,30 +68,36 @@ def test_transform_single_point_nad83_to_nad27():
6768 (569704.566 , 4269024.671 ),
6869 decimal = 3 ,
6970 )
70- expected_xy2 = (569722.342 , 4268814.028 )
71- if PROJ_GTE_92 :
72- expected_xy2 = (569720.46 , 4268813.88 )
73- if grids_available (
74- "ca_nrc_ntv2_0.tif" , "us_noaa_nadcon5_nad27_nad83_1986_conus.tif"
71+ expected_xy2 = (569722 , 4268814 )
72+ if PROJ_GTE_911 :
73+ expected_xy2 = (569720 , 4268813 )
74+ if (
75+ PROJ_GTE_92
76+ and grids_available (
77+ "us_noaa_nadcon5_nad27_nad83_1986_conus.tif" , check_network = False
78+ )
79+ ) or grids_available ():
80+ expected_xy2 = (569722 , 4268814 )
81+ elif grids_available (
82+ "ca_nrc_ntv2_0.tif" , "ca_nrc_ntv1_can.tif" , check_network = False
7583 ):
76- expected_xy2 = (569722.394 , 4268814.27 )
77- elif grids_available ("ca_nrc_ntv2_0.tif" , "ca_nrc_ntv1_can.tif" ):
78- expected_xy2 = (569706.333 , 4268817.68 )
79- elif grids_available ("us_noaa_conus.tif" ):
80- expected_xy2 = (569722.342 , 4268814.028 )
84+ expected_xy2 = (569706 , 4268817 )
85+ elif grids_available ("us_noaa_conus.tif" , check_network = False ):
86+ expected_xy2 = (569722 , 4268814 )
8187
8288 assert_almost_equal (
8389 (x2 , y2 ),
8490 expected_xy2 ,
85- decimal = 3 ,
91+ decimal = 0 ,
8692 )
8793 assert_almost_equal (
88- p2 (x2 , y2 , inverse = True ),
94+ p2 (x2 , y2 , inverse = True , errcheck = True ),
8995 (- 92.200 , 38.567 ),
9096 decimal = 3 ,
9197 )
9298
9399
100+ @pytest .mark .xfail (PROJ_911 , reason = "Patch applied in conda-forge changes behavior" )
94101def test_transform_tuple_nad83_to_nad27 ():
95102 # projection 1: UTM zone 15, grs80 ellipse, NAD83 datum
96103 # (defined by epsg code 26915)
@@ -112,32 +119,39 @@ def test_transform_tuple_nad83_to_nad27():
112119 (4298200.739 , 4353698.725 , 4292319.005 ),
113120 decimal = 3 ,
114121 )
115- expected_x2 = (567721.149 , 351747.558 , 728569.133 )
116- expected_y2 = (4297989.112 , 4353489.645 , 4292106.305 )
117- if PROJ_GTE_92 :
118- expected_x2 = (567719.249 , 351748.119 , 728568.053 )
119- expected_y2 = (4297989.776 , 4353487.434 , 4292108.075 )
120- if grids_available ("us_noaa_nadcon5_nad27_nad83_1986_conus.tif" ):
121- expected_x2 = (567721.401 , 351747.526 , 728569.212 )
122- expected_y2 = (4297989.733 , 4353489.752 , 4292106.351 )
123- elif grids_available ("ca_nrc_ntv2_0.tif" , "ca_nrc_ntv1_can.tif" ):
124- expected_x2 = (567705.072 , 351727.113 , 728558.917 )
125- expected_y2 = (4297993.157 , 4353490.111 , 4292111.678 )
126- elif grids_available ("us_noaa_conus.tif" ):
127- expected_x2 = (567721.149 , 351747.558 , 728569.133 )
128- expected_y2 = (4297989.112 , 4353489.645 , 4292106.305 )
122+ expected_x2 = (567721 , 351747 , 728569 )
123+ expected_y2 = (4297989 , 4353489 , 4292106 )
124+ if PROJ_GTE_911 :
125+ expected_x2 = (567719 , 351748 , 728568 )
126+ expected_y2 = (4297989 , 4353487 , 4292108 )
127+ if (
128+ PROJ_GTE_92
129+ and grids_available (
130+ "us_noaa_nadcon5_nad27_nad83_1986_conus.tif" , check_network = False
131+ )
132+ ) or grids_available ():
133+ expected_x2 = (567721 , 351747 , 728569 )
134+ expected_y2 = (4297989 , 4353489 , 4292106 )
135+ elif grids_available (
136+ "ca_nrc_ntv2_0.tif" , "ca_nrc_ntv1_can.tif" , check_network = False
137+ ):
138+ expected_x2 = (567705 , 351727 , 728558 )
139+ expected_y2 = (4297993 , 4353490 , 4292111 )
140+ elif grids_available ("us_noaa_conus.tif" , check_network = False ):
141+ expected_x2 = (567721 , 351747 , 728569.133 )
142+ expected_y2 = (4297989 , 4353489 , 4292106 )
129143
130144 assert_almost_equal (
131145 x2 ,
132146 expected_x2 ,
133- decimal = 3 ,
147+ decimal = 0 ,
134148 )
135149 assert_almost_equal (
136150 y2 ,
137151 expected_y2 ,
138- decimal = 3 ,
152+ decimal = 0 ,
139153 )
140- lons2 , lats2 = p2 (x2 , y2 , inverse = True )
154+ lons2 , lats2 = p2 (x2 , y2 , inverse = True , errcheck = True )
141155 assert_almost_equal (
142156 lons2 ,
143157 (- 92.220 , - 94.720 , - 90.370 ),
0 commit comments