70 Commits

Author SHA1 Message Date
Vincent Sarago
ba5e90c487
mapbox -> rasterio (#2321) 2021-10-22 09:04:05 -06:00
Sean Gillies
2efb35856c
Rounding like gdal-merge as suggested by @groutr (#2311)
* Rounding like gdal-merge as suggested by @groutr

* Use only GDAL's rounding convention everywhere in rasterio

* Eliminate old window rounding implementations
2021-10-14 15:06:28 -06:00
Ryan Grout
1c548ba371
Accept PathLike objects in rasterio.open (#2231)
* Permit PathLike objects in open.

* Import Path from pathlib

* Test PathLike inputs to open.

* Allow PathLike in merge.

* Accept PathLike objects.
2021-07-27 11:06:36 -06:00
Sean Gillies
30476fd1b2
Cast nodata before filling (#2110)
* Cast nodata before filling

Resolves #2041

* Use ma.asanyarray when required

And silence a new warning
2021-02-10 19:50:49 -07:00
Ryan Grout
5aeaa3591b
Use the right dtype when checking nodataval (#2100)
* Use the right dtype when checking nodataval

Use the dtype of the first dataset if dtype is None. If dtype is not
None, then dt == dtype.

* Use np.issubdtype to check dtypes.

* Add test for out of range nodata.

* Only query float dtype when nodataval is not NaN.

* Modify warning phrasing.

At this point the nodataval could either be set by the input files or by
the user. Use a more general phrasing to just convey the fact that the
nodata value is out of range of the dtype.
2021-02-10 15:30:43 -07:00
Ryan Grout
ceb0e45bc1
Use machine epsilon in transform.rowcol (#2106)
* Use machine epsilon.

* Use window rounding methods.

* Update test checksums

* Update test expected value
2021-02-09 18:33:58 -07:00
Sean Gillies
203f78fc98
Add new merge tool arguments to support resolution of #1867 (#2054) 2020-12-03 15:45:07 -07:00
Florian
0746738acc
Support for pathlib.Path in merge (#2043)
* allow path objects

* incorporated feedback
2020-11-22 16:34:03 -07:00
Sean Gillies
023836d4c9 Merge tag '1.1.7' 2020-09-29 17:20:12 -06:00
Sean Gillies
d646ae0939 xfail resampling tests entirely for GDAL 1.11 2020-09-17 16:53:47 -06:00
Sean Gillies
205883a1bf xfail mode resampling for GDAL 1.x 2020-09-17 16:09:15 -06:00
Guillaume Lostis
7ff4c7a68d Add resampling method option to merge (#1945)
* Add resampling argument to merge

* Expose resampling option in rio merge

* Add tests for rio merge resampling

* Add xfail test for gauss resampling in rio merge
2020-09-15 12:35:45 -06:00
Sean Gillies
098693734a Merge branch 'maint-1.1' 2020-09-15 08:14:59 -06:00
Sean Gillies
01dbe0471b
Allow merge to open one dataset at a time (#1994)
And use this option in rio-merge.

Resolves #1831
2020-09-09 15:38:52 -06:00
Guillaume Lostis
ce00d482fa
Add resampling method option to merge (#1945)
* Add resampling argument to merge

* Expose resampling option in rio merge

* Add tests for rio merge resampling

* Add xfail test for gauss resampling in rio merge
2020-06-09 09:29:38 -06:00
Sean Gillies
925718ea5c Merge branch 'maint-1.1' 2020-06-02 18:49:22 -06:00
Sean Gillies
15d8dd7592
Fix type mismatch (#1938)
* Fix types

* Fix one more type mismatch, xfail 2 tests for GDAL < 2

Resolves #1932

Co-authored-by: Denis Rykov <rykovd@gmail.com>
2020-05-30 10:49:00 -06:00
Norman Barker
908b6da46e enabled output of merge to have additional bands (#1933)
* enabled output of merge to have additional bands

* return dataset index in merge callable

* added custom callable test func

* add support for specifying output dtype when merging

* removed funcsigs and used kwargs for copyto func
2020-05-29 15:36:30 -06:00
Norman Barker
5af075c1c0
enabled output of merge to have additional bands (#1933)
* enabled output of merge to have additional bands

* return dataset index in merge callable

* added custom callable test func

* add support for specifying output dtype when merging

* removed funcsigs and used kwargs for copyto func
2020-05-29 15:35:32 -06:00
Sean Gillies
2a6baa0038 Restore missing CliRunner 2020-02-13 18:08:56 -07:00
Sean Gillies
02d8483ace Merge branch 'maint-1.1' 2020-02-13 13:55:15 -07:00
Guillaume Lostis
ef8a82fd08 Runner fixture (#1853)
* Use runner fixture in all tests

* Remove unused imports and args from some tests
2019-12-19 15:37:59 -07:00
Sean Gillies
9ec7187c5e
Increase merge tool's default precision from 7 to 10 (#1840)
Resolves #1837
2019-12-06 08:34:29 -07: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 C. Gillies
a04e25e930 Click 6.7 and 7 compatibility 2018-09-26 12:35:56 -06:00
Sean C. Gillies
33028b92aa Pass nodata cmd option to open call
Resolves #1345

Also exposes a bug in testing code that I have fixed. In hindsight,
it looks like we tailored the test to expect the buggy behavior.
2018-05-18 17:25:27 -06:00
Erik Seglem
7b2e9eca2b Refactor force overwrite to overwrite. 2018-04-20 14:13:35 -04:00
Jonas Sølvsteen
0bcae7769d Revert "revert 1ddcdf3"
This reverts commit 66ca449dc52510af2698f81d6cdd0117acfa1be5.
2018-02-15 10:03:25 +01:00
Jonas Sølvsteen
66ca449dc5 revert 1ddcdf3 2018-02-15 09:31:12 +01:00
Jonas
1e0c24a285
Merge branch 'master' into merge-indexes 2018-02-15 08:32:54 +01:00
Jonas Sølvsteen
1ddcdf39aa fix fixture 2017-12-19 15:03:24 +01:00
Jonas Sølvsteen
35224690f7 add indexes / bidx parameter to merge 2017-12-19 14:13:16 +01:00
Jonas Sølvsteen
81fc732be0 sources --> datasets 2017-12-06 20:35:14 +01:00
Brendan Ward
fded0b1d44 Converted a few test xfails to skip, dropped or modified a few others 2017-11-30 20:13:16 -08:00
Brendan Ward
bf8d4f3509 More consistent GDAL version handling in tests 2017-11-29 08:59:31 -08:00
Sean Gillies
e3d0ab29d7 Improve consistency of bounds handling. 2017-06-12 11:21:38 +02:00
Sean Gillies
d7ea5bfbfe xfail some pixel value senstivie tests when gdal < 2 2017-06-11 17:14:29 +02:00
Sean Gillies
b8b5df23b9 Add deprecation warning for old style range tuples 2017-06-11 16:15:02 +02:00
Sean Gillies
3089c728da New impl for Window class
An offset and length representation of windows avoids unnecessary
additions and subtractions that can lead to loss of precision.

A consequence is that we can no longer assert equality between
instances of Window and range tuples because Window no longer
subclasses tuple.

Rasterio is now ready for floating point windows.
2017-06-10 18:42:49 +02:00
Matthew Perry
8df0d4fd44 pytest warnings 2017-05-23 05:22:10 -06:00
Sean Gillies
bc998464ba Resolves #392 2016-12-02 17:24:47 +01:00
Sean Gillies
9355513d39 Get env from main ctx
Migrate all tests over to invoking main_group with a named command.
2016-07-27 14:51:36 -06:00
Kevin Wurster
ef952def3b Merge master. 2016-06-14 21:09:27 -07:00
Kevin Wurster
a71f3f0f1f Explicitly construct Affine() transforms rather than instantiating from Affine.from_gdal() 2016-06-14 10:44:03 -07:00
Kevin Wurster
92b64f9c8a Raise an exception if 'affine' _and_ 'transform' are passed to rasterio.open(). Issue a warning if 'affine' is used. Raise an exception if 'transform' is not an instance of 'affine.Affine()'. 2016-06-13 16:50:42 -07:00
Amit Kapadia
70ae537355 test that rio merge copies the colormap 2016-06-06 14:08:50 -07:00
Erik Seglem
a31e3c8c16 Standardize on import numpy as np. 2016-06-01 22:47:33 -04:00
Sean Gillies
12f8fc7e3f New, lazier AWS sessions
New Env class and tests.
More logging, tests, safer environment
Remove usage (deprecated) of rasterio.drivers()
Also pep8 cleanups throughout the tests and a fix for unchecked
dtypes when opening a dataset in 'w' mode.
Now we can simply import warnings in __init__.py. In the
deprecations tests, we needed to see a single warning only one
time to avoid multiple drivers() warnings.
Add a global env.
Add rasterio.env.setenv()
2016-04-28 15:26:55 -06:00
Kevin Wurster
b9205b1fcb Remove references to read_band() but not the actual method. 2016-04-12 20:50:50 -04:00
Kevin Wurster
d60d40c3ca Remove references to write_band() but not the actual method. 2016-04-12 20:45:56 -04:00