Closed sgillies closed 3 years ago
It doesn't seem a rasterio bug.
GDAL (master branch):
$ gdaltransform -s_srs EPSG:4326 -t_srs EPSG:2163
Enter X Y [Z [T]] values separated by space, and press Return.
-120 40
-1688722.36656949 -350040.508198484 0
GDAL 2.2.3:
$ gdaltransform -s_srs EPSG:4326 -t_srs EPSG:2163
-120 40
-1684649.41338287 -350356.813765847 0
But at the same time if define SRS using RPOJ string it gives the same result as for GDAL2:
$ gdaltransform -s_srs EPSG:4326 -t_srs "+proj=laea +lat_0=45 +lon_0=-100 +x_0=0 +y_0=0 +a=6370997 +b=6370997 +units=m +no_defs"
Enter X Y [Z [T]] values separated by space, and press Return.
-120 40
-1684649.41338287 -350356.813765848 0
$ gdalinfo --version
GDAL 3.2.0dev-8f5bab77ee, released 2020/09/13
Different versions of GDAL return different PROJ strings for the same EPSG code:
GDAL (master branch):
$ gdalsrsinfo -o proj4 epsg:2163
+proj=laea +lat_0=45 +lon_0=-100 +x_0=0 +y_0=0 +datum=NAD27 +units=m +no_defs
GDAL 2.2.3:
$ gdalsrsinfo -o proj4 epsg:2163
'+proj=laea +lat_0=45 +lon_0=-100 +x_0=0 +y_0=0 +a=6370997 +b=6370997 +units=m +no_defs '
EPSG:2163 no longer supported by EPSG because datum information is required for unambiguous spatial referencing. Source: https://epsg.org/crs_2163/US-National-Atlas-Equal-Area.html
# git diff
diff --git a/tests/test_warp.py b/tests/test_warp.py
index df6c26b1..3b031846 100644
--- a/tests/test_warp.py
+++ b/tests/test_warp.py
@@ -221,7 +221,7 @@ def test_transform_bounds_densify():
# This transform is non-linear along the edges, so densification produces
# a different result than otherwise
src_crs = CRS.from_epsg(4326)
- dst_crs = CRS.from_epsg(2163)
+ dst_crs = CRS.from_proj4("+proj=laea +lat_0=45 +lon_0=-100 +x_0=0 +y_0=0 +a=6370997 +b=6370997 +units=m +no_defs")
assert np.allclose(
transform_bounds(src_crs, dst_crs, -120, 40, -80, 64, densify_pts=0),
(-1684649.41338, -350356.81377, 1684649.41338, 2234551.18559),
$ pytest -q -k 'test_transform_bounds_densify and not test_transform_bounds_densify_out_of_bounds'
Test data present.
. [100%]
1 passed, 1809 deselected in 4.39s
Ooh, so very close in https://travis-ci.com/github/rasterio/rasterio-wheels/builds/208241915. Linux wheels look good https://travis-ci.com/github/rasterio/rasterio-wheels/jobs/458767026, but there's a duplicate library error from delocate in the macos case: https://travis-ci.com/github/rasterio/rasterio-wheels/jobs/458767028. Perhaps it's related to https://github.com/matthew-brett/delocate/issues/53. Will dig a little more this weekend.
Bounds densification test is failing: https://travis-ci.com/github/rasterio/rasterio-wheels/jobs/384267867#L2747-L2762.
To date we haven't been able to test https://github.com/mapbox/rasterio + GDAL 3.1 because the GDAL builds time out https://travis-ci.org/github/mapbox/rasterio/jobs/723190297 so I can't say yet if this is a real change in results or a rasterio bug.