* Raise WarpOperationError (new) if ChunkAndWarpMulti/Image fail
We've been hiding these errors and allowing chunks of a warp
operation to pass with no data copied to the output.
Note that the error message isn't very detailed. In a lot of
cases it's a generic "TIFF read block error" and doesn't surface
root causes like server errors.
* Temporarily home in on one test
* Make 503 more predictable
The exact request range varies a little bit with GDAL version
* Skip test on pythons < 3.7
* Switch from OSRAutoIdentifyEPSG to OSRFindMatches
Resolves#2273
* Keep older code in _matches for use with GDAL versions < 3
* Save all matches for an authority in order
* Generalize assertion on CRS WKT from gdalinfo
* Add a Resampling.sum method
For weighted sum.
Added in GDAL 3.1 per https://github.com/OSGeo/gdal/pull/2366
I copied the approach used in #2056 to add and test this.
* resampling method sum not supported for read/write
* Resampling.sum fill in expected nonzero
* Don't use approximate transformer if using rpcs & passing RPC_DEM kwarg
* [rpc_no_approx_transformer_with_dem] split test
* [rpc_no_approx_transformer_with_dem] update docstring
* [warp_add_rpcs] initial update to reproject to support rpcs
* catch kwargs in _calculate_default_transform
* fix allocation of crs to wrong dataset (was src, now dst) in _calculate_default_transform. Specifically where we went from GDALCreateGenImgProjTransformer -> GDALCreateGenImgProjTransformer2
* pass kwargs to calculate_default_transform (to be passed to transformer
* update docstrings
* update documentation
* add debug messages for kwargs used to set Transformer options
* Don't capitalize RPC_DEM transformer option value, as it might be a path
* includes existing changes from https://github.com/mapbox/rasterio/pull/2030, better support for computation of calculate_default_transform with just gcps or rpcs
* adds testse
* Remove an empty line
Mainly to trigger a new build on travis-ci.com
* add new test file (Largely derived from RGB.byte.tif)
* Fix incorrectly encoding RPC metadata as transform options
Was checking for transformer option RPC_DEM in the RPC metadata by mistake
Co-authored-by: Sebastien Tremblay-Johnston <sebastien.tremblayjohnston@mdacorporation.com>
Co-authored-by: Sean Gillies <sean@mapbox.com>
Co-authored-by: Sean Gillies <sean.gillies@gmail.com>
* [update_warp_gcps] Enable reproject to better handle computation of dst_transform when reprojecting from gcps
* Remove weird auto import from pylance? and unused from_gcps import
Co-authored-by: Sebastien Tremblay-Johnston <sebastien.tremblayjohnston@mdacorporation.com>
* ENH: Add support for objects with __geo_interface__ in transform_geom
* Use getattr for __geo_interface__
Co-authored-by: Sean Gillies <sean.gillies@gmail.com>
Co-authored-by: Sean Gillies <sean.gillies@gmail.com>
* Remove CHECK_WITH_INVERT_PROJ=YES default
Resolves#1248
* Perform check in calculate_default_transform
* Use CHECK_WITH_INVERT_PROJ for GDAL 1.11 and PROJ 4
* Refactor of _CRS class to make WKT canonical
* Finish work on making WKT canonical
Many test assertions needed update
* Accept {'init': 'EPSG:xxxx'}
Also removed commented code
* Restore previous rio-info behavior when there's an EPSG code
* Remove unneeded import
* Use from_proj4 in from_epsg
* Rewrite of _CRS to keep an OGRSpatialReferenceH (#1602)
* Rewrite of _CRS to keep an OGRSpatialReferenceH
Rewrite of CRS to use _CRS by composition, not inheritance
New OGRErr handling function exc_wrap_ogrerr
* Remove commented code
* Add back in the error stack check for ImportFromProj
Also fix up docstrings
* Populate `pan{Src|Dst}Bands` indexes when reprojecting
This is addressing issue #1350. Basically warping for cases other than
- Warping first band
- Warping all bands
didn't work, because of the way warping structure was configured. With this
change we actually populate `pan{Src|Dst}Bands` parameters properly.
Also when destination is an `ndarray` and there are multiple bands being
processed destination bands are assumed to be `1,2,..N` if the output size
matches the number of bands being processed simultaneously. So you can extract
say bands `4,7,19` into a `3xHxW` `ndarray`.
* Being explicit about resampling strategy in the test
Use `nearest` resampling strategy in `test_issue1350`, in case the difference in
test failure across GDAL versions is due to that.
* Update test for issue 1350 following feedback
* Skip reproject test for gdal 2.2.x series
There was a regression in 2.2.x series of GDAL, where warping would use
`panDstBands` instead of `panSrcBands` when warping into a 1 band destination.
Regression was fixed in 2.2.4 release of GDAL.