121 Commits

Author SHA1 Message Date
Vincent Sarago
ba5e90c487
mapbox -> rasterio (#2321) 2021-10-22 09:04:05 -06:00
Sean Gillies
5146eaa517 Our test server doesn't work on macos or windows
Perhaps some defficiency in multiprocessing, which is superseded
by concurrent.futures.
2021-10-15 13:08:08 -06:00
Sean Gillies
8ed1845b62 Move class to outer scope
Quite optimistic that this resolves #2309
2021-10-12 12:07:18 -06:00
Sean Gillies
e0704ab856 Merge tag '1.2.10' 2021-10-11 08:55:21 -06:00
Sean Gillies
621a6ba2b6 Require GDAL 3 for retry test 2021-10-06 17:46:56 -06:00
Sean Gillies
99bbabc411 Also tests for a range request retry 2021-10-06 17:10:01 -06:00
Sean Gillies
fb90df40d4
Raise WarpOperationError (new) if ChunkAndWarpMulti/Image fail (#2305)
* 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
2021-10-05 11:34:27 -06:00
Sean Gillies
6292959538 Merge branch 'maint-1.2' 2021-09-07 11:21:43 -06:00
Sean Gillies
4773c70059
Switch from OSRAutoIdentifyEPSG to OSRFindMatches (#2279)
* 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
2021-09-03 10:43:07 -06:00
Sean Gillies
2de62d2ead Merge tag '1.2.4' 2021-05-31 16:26:51 -06:00
Sean Gillies
124752017f Revert to EPSG:3857 2021-05-25 21:21:34 -06:00
Sean Gillies
9f6d98ffcc Mark aligned pixels test xfail
PROJ 8 has new mercator projection code

Also avoid a warning from merge()
2021-05-25 21:08:24 -06:00
Mike Taves
3c630f8a30
Python3 classes does not need to inherit from object (#2150) 2021-04-12 12:47:35 -06:00
Sean Gillies
a715da9a07 Backport changes from #2089 2021-03-31 13:01:06 -06:00
Martijn Visser
4eaaf5d97e
Add a Resampling.sum method (#2089)
* 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
2021-02-12 09:31:13 -07:00
Even Rouault
1d43837d15
Add a Resampling.rms method (#2056)
For root mean square / quadratic mean.
Added in GDAL 3.3 per https://github.com/OSGeo/gdal/pull/3210
2020-12-04 16:52:04 -07:00
Yann-Sebastien Tremblay-Johnston
ea8220bf45
Don't use approximate transformer if using rpcs & passing RPC_DEM kwarg (#2047)
* 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
2020-11-23 17:12:08 -07:00
Yann-Sebastien Tremblay-Johnston
11ae663ff4
Warp add rpcs (#2031)
* [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>
2020-11-13 18:26:58 -07:00
Yann-Sebastien Tremblay-Johnston
1ca42295e7
Enable reproject to better handle computation of dst_transform when reprojecting from gcps (#2030)
* [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>
2020-11-12 11:14:26 -07:00
Sean Gillies
098693734a Merge branch 'maint-1.1' 2020-09-15 08:14:59 -06:00
Sean Gillies
3e91ad345c Migrate test from EPSG:2163 to a PROJ4 based projection 2020-09-13 16:38:08 -06:00
Sean Gillies
68015548d1 Check lengths of coordinate arrays before calling into C
Resolves #1952
2020-09-11 12:34:30 -06:00
Sean Gillies
bb106e903a Merge branch 'maint-1.1' 2020-09-09 08:39:18 -06:00
Alan D. Snow
57c2efd01e
ENH: Add support for objects with __array__ in reproject() (#1959) 2020-07-13 17:46:18 -06:00
Alan D. Snow
3ae51c8e5e
ENH: Add support for objects with __geo_interface__ in transform_geom (#1958)
* 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>
2020-07-08 11:56:38 -06:00
Sean Gillies
925718ea5c Merge branch 'maint-1.1' 2020-06-02 18:49:22 -06:00
Sean Gillies
0e9602608d
Remove CHECK_WITH_INVERT_PROJ=YES default (#1942)
* 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
2020-06-02 14:55:42 -06:00
Sean Gillies
0fd2bc5712 Add a new exception for invalid resampling algs
Resolves #1930
2020-05-21 16:28:52 -06:00
Alan D. Snow
94c0e54e03
optimized transform_geom for repeated transformations by allowing users to pass in geometry arrays (#1827) 2020-02-11 15:52:16 -07:00
Alan D. Snow
2b5f319c73 add ability to calculate dst_transform if not provided (#1552) 2019-09-12 15:33:15 -06:00
Sean Gillies
49e650971c Remove unavoidable warning from write_colormap()
Also eliminate a numpy warning in test_warp.py
2019-09-03 14:14:40 -06:00
Sean Gillies
3641127850
Maintain traditional axis order strategy everywhere (#1733)
* Maintain traditional axis order strategy everywhere

* Require GDAL 3 builds to pass

* Remove invalid comment and update change log
2019-07-29 14:19:33 -06:00
Sean Gillies
f934c3428a
Change _CRS class to make WKT canonical (#1597)
* 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
2019-01-22 11:17:12 -07:00
Sean Gillies
ff04dd5c1a Add another test of nodata initialization 2018-12-18 11:02:14 -07:00
Sean Gillies
a4aea02b05
Turn on exceptions and use Py_ssize_t for index arrays (#1573)
* Turn on exceptions and use Py_ssize_t for index arrays

Towards resolving #1076

* retvalt -> retval

* Update change log

* Add new test
2018-12-10 12:20:41 -07:00
Sean Gillies
c87fd9ac79
Re-applying PR #1546 to maint-1.0 via patch (#1549) 2018-11-15 19:18:37 -07:00
Sean Gillies
7c97247ac5
Do not use the WRAPDATELINE transform option with 2.2 (#1468)
* Skip transform options with GDAL 2.2

* Resolve #1446

* Another test for issue 1446

* Add data file
2018-09-13 20:29:56 -06:00
Sean Gillies
41bbc36e69
Resolve #1446 (#1447) 2018-08-29 09:02:19 -06:00
Jonas
f7762ae91d support geometry type LinearRing (#1432)
* support geometry type LinearRing

* fix bugs in test_is_valid_geom_ring
2018-07-31 17:10:22 -06:00
Sean C. Gillies
e5a6efc4fd Update change log 2018-07-27 10:04:42 -06:00
Sean C. Gillies
02c31e6d34 Merge branch 'maint-1.0' of github.com:mapbox/rasterio into maint-1.0 2018-07-27 09:56:17 -06:00
Kirill Kouzoubov
3d8856de45 Populate pan{Src|Dst}Bands indexes when reprojecting (#1424)
* 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.
2018-07-27 09:43:12 -06:00
Denis Rykov
24aa1d95b4 Add new dst_width and dst_height parameters (#1409) 2018-07-24 13:49:40 -06:00
Sean Gillies
db9a22483e
dst_alpha, not dst_alpa (#1417)
Also set color interpretation and remove nodata on the temp warp output
dataset.

Resolves #1415
2018-07-23 13:41:23 -06:00
Sean C. Gillies
22e0550a75 Prevent integer overflow (#1401) 2018-07-05 11:17:49 -06:00
Sean C. Gillies
077c59c8c0 Resolves #1395 2018-07-02 16:43:07 -06:00
Sean C. Gillies
a5cea54c56 Resolves #853 2018-06-21 17:25:22 -06:00
Sean C. Gillies
f200bf8ca6 Resolves #984 2018-06-21 13:46:15 -06:00
Sean C. Gillies
f46bfcd88e Clean up warp option creation and _reproject call 2018-06-21 11:41:22 -06:00
Sean C. Gillies
246cb614ec Update warp resampling test expectations
The large differences between nearest neighbor and other algs
should have been a red flag, but I didn't notice it before.
2018-06-19 13:40:44 -06:00