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.
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()
The results of rio-merge are much better!
Added a test of merging 4 pieces of the RGB.byte.tif file and
getting a file with the same checksums as the original.
Adjust destination windows when the ceiling is too high.
More robust nodata value determination.
Lastly, protect against accidentally overwriting input files. The
standard unix mv command is a good model. We might add -i and -n
options in the future.
A follow on to #460. Would have insisted on tests in the PR, but
it's not super clear where to start for new developers. Also, the
tool was pretty well exercised by the existing CLI test. The new
tests are a straightforward port of the CLI tests.
At the heart of this was a subtle indexing error due to calling
round() instead of math.floor(). Fixing that needed a cascade of
fixes to expectated values in various tests.
Finally, core logic in the merge command was rewritten for
correctness and clarity.