63 Commits

Author SHA1 Message Date
Alan D. Snow
51efb0d7a8
LNT: Use flake8 to find undefined variables & unused imports (#2693) 2023-01-10 12:48:09 -06:00
Alan D. Snow
50db10b7c1 TST: Update S3 paths (#2647) 2022-11-18 11:20:53 -06:00
Alan D. Snow
8403830422
MNT: Update tests & code compatibility for GDAL 3+ (#2452) 2022-05-10 08:16:49 -06:00
Sean Gillies
a9150e10c0
Scaling on the right of mult preserves origin (#2364)
Resolves #2346
2021-12-13 09:07:32 -07:00
Vincent Sarago
ba5e90c487
mapbox -> rasterio (#2321) 2021-10-22 09:04:05 -06:00
Yann-Sebastien Tremblay-Johnston
1b5f96d6e5
fix some tests (#2226)
add additional monkeypatch

skip on windows for now, unclear what intent of test is

removed third slash that is the anchor ('/') on posix but would be 'C' on windows

make ParsedPath.from_uri consistent with as_posix usage in init

fix tests
2021-10-15 10:13:02 -06:00
Denis Rykov
689e141413
Use boto3 method to get session credentials (#2255) 2021-08-16 15:02:08 -06:00
Alan D. Snow
3b071cdc9f
ENH: WarpedVRT - pass warp_extras into _calculate_default_transform (#2207) 2021-06-18 10:30:46 -06:00
Alan D. Snow
cb4cfa9fc4
ENH: Add transformer_options to WarpedVRT (#2195)
* ENH: Add transformer_options to WarpedVRT

* REF: Merge transformer_options into warp_extras
2021-06-18 09:18:53 -06:00
Alan D. Snow
3ed1b74c33
ENH: Improve support for gcps/rpcs with WarpedVRT (#2193)
* ENH: Improve support for gcps/rcps with WarpedVRT

* TST: rcps -> rpcs
2021-06-18 09:12:41 -06:00
Idan Miara
f9225ea2a9
rasterio/_warp.pyx - remove deprecated parameters that were marked to be removed in 1.1 (#2197)
* tests/test_warpedvrt.py - use non deprecated parameters and remove `test_deprecated_param` which is not applicable anymore

* rasterio/vrt.py, rasterio/_warp.pyx - remove deprecated parameters that were marked to be removed in 1.1

* CHANGES.txt - add: WarpedVRT: Remove deprecated dst_* parameters (#2197).
2021-06-09 14:38:49 -06:00
Sean Gillies
09fc48265a Guard against gauss resampling
Resolves #2190
2021-05-29 17:05:20 -06:00
Sean Gillies
7f7bbec0a2 Allow GDAL to do the right thing w.r.t GCPs and warping
Resolves #2086
2021-01-24 14:23:08 -07:00
Vincent Sarago
c9c3e1a56c
make sure the WarpedVRT dataset is marked as closed on ctx exit (#2093)
* make sure the WarpedVRT dataset is marked as closed on ctx exit

* rely on inherited methods
2021-01-22 14:37:38 -07:00
Sean Gillies
4e6d48544b Warn about WarpedVRT dataset's mode instead of raising 2020-09-28 09:52:08 -06:00
Sean Gillies
d442b69030
Consolidate dataset stop methods and test for issue #2000 (#2001)
* Consolidate dataset stop methods and test for issue #2000

* Try reverting to see if warped vrt tests will fail

* Undo previous commit

* Make WarpedVRT safer

We're only calling GDALClose now if reference counts are 0 and
insisting that the dataset passed to WarpedVRT be opened in
read-only mode.

Resolves #2000
2020-09-24 17:45:06 -06:00
Sean Gillies
a2e2f1abe5
Handle two more WarpedVRT use cases (#1936)
* Resolves #1921

* Change notes

Better organization of code, with comments
2020-06-02 09:27:52 -06:00
Sean Gillies
0e9dd47761
Fix broken sampling for WarpedVRT datasets (#1851)
Resolves #1833
2019-12-18 08:07:49 -07:00
Sean Gillies
1830c6b0bd Add out_dtype to WarpedVRTReaderBase.read()
Resolves #1849
2019-12-16 09:58:10 -07:00
Sean Gillies
94affc4fe3
Trust in GDAL's reference counting (#1800)
* Trust in GDAL's reference counting

Towards resolving #1799

* Require GDAL 2

* Revert to local dataset handle

* Run tests under gdb

* Implement GDALDatasetH reference counting in stop()

This keeps datasets used in a WarpedVRT from crashing GDAL and
Python when they are closed before the VRT.

* Bump version

* Remove gdb
2019-10-03 13:49:52 -06:00
Sean Gillies
9e30d22d6d
Switch sharing kwarg default to False (#1775)
* Switch sharing kwarg default to False

Resolves #1705

* Replace GDALOpenShared with GDALOpen except in one shim

* Revert two open_dataset to GDALOpen

* Run tests under gdb

* Increment ref count in WarpedVRTBase

* Open a new dataset handle in WarpedVRT

* Remove gdb

* Remove exceptions from open_dataset in _shim1

Makes usage much easier

* Fix in-memory dataset leaks in _reproject
2019-09-13 08:05:14 -06:00
Sean Gillies
8e66f864db
Issue1744bis (#1768)
* No more right multplication with instances of Affine

That usage is deprecated.

* Add a `dtype` keyword argument to the WarpedVRT constructor

It functions like gdalwarp's `-wt` and resolves #1744.

* Add an xfail-ing test

* Add another test with WarpedVRT nodata set
2019-09-05 14:15:34 -06:00
Sean Gillies
3216f2d797
Add a test to reproduce issue #1744 (#1767)
* Add a test to reproduce issue #1744

* Add missing data file
2019-09-05 11:28:58 -06:00
Sean Gillies
df378ba657 Make src_crs the first default for WarpedVRT destination crs
The crs of the source dataset is the second.

Resolves #1755
2019-08-22 15:54:18 -06:00
Sean Gillies
452699a333
None means none, not default (#1522)
* None means none, not default

We've changed the constructor's nodata defaults to use a flag
that is neither None nor a float.

Resolves #1503

* Test and feature require GDAL 2.2
2018-10-25 14:07:56 -06:00
Sean C. Gillies
95a49db885 Skip test with GDAL < 2.1 2018-06-22 15:50:48 -06:00
Sean C. Gillies
d9eadb82ff Raise an exception when asked to add an alpha band 2018-06-22 15:27:13 -06:00
Sean C. Gillies
516c3a02fa Add test for adding an alpha band in the single band case 2018-06-20 12:23:02 -06:00
Sean C. Gillies
d3ca5a6b2e Require GDAL 2.1 for all tests with add_alpha=True 2018-06-19 13:53:19 -06:00
Sean C. Gillies
63925dbfe0 Add support for source alpha when warping
Also add an assertion that source masks are accessed when reading
masks from a WarpedVRT.
2018-06-19 11:31:49 -06:00
Sean C. Gillies
b041e35f96 Update test and change log 2018-06-18 21:31:36 -06:00
Sean C. Gillies
5fbcff2ea9 Require GDAL 2 for this test 2018-06-18 14:53:52 -06:00
Sean C. Gillies
313f009cda Un xfail, these tests pass 2018-06-18 14:37:59 -06:00
Sean C. Gillies
b4acb7df03 Remove redundant test 2018-06-18 13:53:08 -06:00
Sean C. Gillies
e229d82ed7 Add failing tests for VRT/boundless overview hits 2018-06-18 11:06:27 -06:00
Sean C. Gillies
f5027cf9d8 Simplify version negotiating logic 2018-06-16 08:54:04 -06:00
Sean C. Gillies
866498034e Skip test for GDAL < 2 2018-06-15 15:53:17 -06:00
Sean C. Gillies
6f91107f27 Walk nonzero mask values to 255
Disallow boundless reads from WarpedVRT
2018-06-15 11:24:21 -06:00
Sean C. Gillies
a5d236bbd4 Skip test 2018-06-15 10:13:59 -06:00
Sean C. Gillies
f1c2ad64b2 Replace warped VRT with in-memory "straight" VRT 2018-06-15 08:18:53 -06:00
Sean C. Gillies
b5ff28add1 add_alpha=False means never add an alpha band, default is None
Resolves #1372
2018-06-12 16:27:07 -06:00
Sean C. Gillies
73ca8cfe6f Ensure VRT alpha band nodataval is set
Resolves #1371.

Also adds a few more relevant tests.
2018-06-12 16:05:29 -06:00
Sean C. Gillies
ce09606598 Require GDAL >= 2.1 for test 2018-06-04 06:37:42 -07:00
Sean C. Gillies
2d3eb2ba9d Add test of deprecated params 2018-06-03 23:00:32 -07:00
Sean C. Gillies
75e5ae29b6 Do the right thing for sources with .msk and no nodata
The right thing being to add an alpha band to the VRT.
2018-06-03 22:47:46 -07:00
Sean C. Gillies
14d09535b4 Skip test_warped_vrt_dst_alpha for GDAL < 2.1 2018-06-03 21:29:00 -07:00
Sean C. Gillies
b55c6faaaa Straighten out warped VRT nodata and masks 2018-06-03 15:32:37 -06:00
Sean C. Gillies
3728f1433e CRS bug fixes, new features, and deprecations 2018-05-29 22:21:25 -06:00
Jonas Sølvsteen
b1fc4c2732 remove test for src_transform again 2018-04-20 08:12:46 +02:00
Jonas Sølvsteen
5d5cbf12fa set both src_transform and dst_transform 2018-04-06 16:49:34 +02:00