38 Commits

Author SHA1 Message Date
Sean Gillies
0300961040 Add new test file 2022-04-14 15:38:11 -06:00
Samuel Kogler
c68d74ddb5
Fix error in reproject when destination is a tuple. (#2369)
* Fix error in reproject when destination is a tuple.

* Add unit test for reprojecting to specified output bands.

Co-authored-by: Sean Gillies <sean.gillies@gmail.com>
2022-04-11 15:18:47 -06:00
Howard Butler
8de1211af0
BUG: Do not print strings that might be null in our debug log for _matches (#2416)
* Do not print strings that might be null in our debug log for _matches

* add a test to verify we can consume COMPDCS
2022-03-29 17:33:58 -06:00
Vincent Sarago
822bf4750e
use local GOES16 file and ignore tests failure for previous GDAL version (#2367)
* use local Goes16 file for tests

* change err level for test

* ignore fail for gdal <3.3

* compare version
2021-12-15 14:07:10 -07:00
Vincent Sarago
ba5e90c487
mapbox -> rasterio (#2321) 2021-10-22 09:04:05 -06:00
Yann-Sebastien Tremblay-Johnston
344a34041b
Add Transformer classes (#2225)
* initial

* add TransformDirection enum, fix cython compiler issues

* make RPCTransformWarning more generic

* include GDALGCP* in gdal.pxi

* add GCPTransformer

* typo

* move xy and rowcol to TransformerBase

* change existing transform methods to use new *Transformer classes

* normalize transform direction, update docstrings

* update docstrings

* make subsubheadings of Coordinate Transform subheading

* Add new docs transform topic

* add to index

* update docstrings

* update docstring

* Add rasterio.rpc to docs

* update georeferencing.rst

* update transform.srst

* relax isinstance check for RPCTransformer

* catch invalid transform input to get_transformer

* replace None with identity transform so we test the correct ValueError

* update AffineTransformer

* add tests

* rename method to map singleton coordinate to array-like and validate all coordiantes have same dimensions

* update test

* add more tests

* update docstring of GCPTransformer init

* fix copy+paste error

* relax check on xy transformed values due to floating point precision

* remove unused imports

* fix tests and address comments

Co-authored-by: Sean Gillies <sean@mapbox.com>
2021-10-13 14:19:33 -06:00
Sean Gillies
beb50adb5b Use numpy.isclose when merging float data
Resolves #2163
2021-04-26 13:57:34 -06:00
Sean Gillies
b58cff5783
Update CRS of test dataset to be precisely EPSG:32618 (#2091)
* Update CRS of test dataset to be precisely EPSG:32618

Leaving two new GDAL functions in gdal.pxi for future use.

* Update builds to use PROJ 7.2.1 and GDAL 3.2.1
2021-01-20 11:20:04 -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
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
afde5481ef
Crs env (#1544)
* Refactor to make data search testable

* Test ensure_env with faked sys.prefix and _env file location

* raising=False

* Don't call fixture function, use it as a fixture

* Re-applying PR #1546 to maint-1.0 via patch (#1549)

* Refactor to make data search testable

* Test ensure_env with faked sys.prefix and _env file location

* raising=False

* Don't call fixture function, use it as a fixture

* Add function to get context if needed

* added support for ESRI wkt strings - resolves issue #1537 (#1538)

* updated _handle_crswkt to use CRS.from_wkt; resolved issue #1540 (#1541)

* updated _handle_crswkt to use CRS.from_wkt; resolved issue #1540

* added test for datasetreader opening dataset with ESRI projection wkt string

* Handle GDAL's comments about WKT to PROJ conversion

* Bring Env inside methods if needed

* New test of compound CRS that was crashing 1.0.9
2018-11-16 15:16:44 -07:00
Sean C. Gillies
f627e146d4 Eliminate all valid shortcut from the boundless masked case
Resolves #1449
2018-09-19 08:41:22 -06: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
Mike Toews
306f2e60aa Correctly calculate bounds on a rotated raster (#1422)
* Add rotated.tif to test data

import numpy as np
import rasterio
from affine import Affine

a = Affine.translation(100, 200) * Affine.rotation(30) * Affine.scale(20, -10)

with rasterio.open('rotated.tif', 'w', 'GTiff', width=10, height=15, count=1,
                   crs=None, transform=a, dtype='uint8',
                   compress='packbits') as ds:
    ds.write(np.arange(15 * 10).reshape((1, 15, 10)).astype('B'))

* correctly calculate bounds on a rotated raster
2018-07-25 11:14:40 -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
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
vincentsarago
216e138cdb fix and add tests 2018-04-04 12:48:40 -04:00
Sean Gillies
1bc395f27d Add subdatasets method and surface in rio-info 2017-08-29 00:15:41 -06:00
Sean Gillies
b3b01e07e6 Add a test of using an LZW-compressed tiff in memoryfile 2017-05-25 15:46:59 +02:00
Sean Gillies
f203009433 Add MemoryFile doc
An make vrt file reference relative.
2016-11-21 16:08:51 +01:00
Sean Gillies
24adf237f5 Add GCP support to rio-warp 2016-10-25 17:43:11 +02:00
Sean Gillies
87e1d9a710 RGBA test dataset and other follow ups on #881 2016-09-16 17:30:28 +02:00
Matthew Perry
ff7108566d add failing testcase to demonstrate #679 2016-04-27 13:05:41 -04:00
Matthew Perry
8ca9f01399 treat non-invertable gdal errors as warnings 2016-04-11 13:45:32 -04:00
James McBride
68e8163faa Added an example to docs on using a shapefile to mask a raster.
This includes the very simple shapefile used to do the masking. I
suspect though that including a shapefile in the repository is
undesirable.
2016-03-28 21:25:07 -07:00
Matthew Perry
46de77f3cd test for right-edge data loss 2016-03-16 15:38:29 -04:00
Even Rouault
80433405c0 Fix crash in meta() method with zero-band rasters
Some GDAL datasets like HDF5 have just a list of subdatasets, but no
raster band themselves. DatasetReader.meta currently segfaults on such
datasets.
2016-03-05 19:07:21 +01:00
Sean Gillies
dd15b4ae53 Merge branch 'master' into vfs
Conflicts:
	rasterio/__init__.py
2015-11-09 14:44:14 -07:00
Sean Gillies
49938067bc No blocksizes in untiled profiles
Closes #502
2015-10-22 12:30:22 -06:00
Sean Gillies
4667e40ee9 Merge branch 'master' into vfs
Conflicts:
	rasterio/rio/info.py
2015-10-20 21:56:08 -06:00
Sean Gillies
4c1e09b599 Merge pull request #485 from mapbox/perrygeo-window_full_cover
Perrygeo's window full cover
2015-09-25 09:26:18 -06:00
Sean Gillies
30547d45d1 Fix computation of output image size and extents.
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.
2015-09-24 22:53:00 -06:00
Sean Gillies
c9ebdbcdbd Add compression and interleaving properties
Plus supporting enums, and tests, and surface these in the profile
property.
2015-09-23 13:25:06 -06:00
Sean Gillies
8c68844f0a Add zip file 2015-08-30 22:22:04 -06:00
Sean Gillies
084692aa2c Addition of a --rebuild option plus resampl method tagging.
rio-pyramid renamed rio-overview.

Plus many small fixes suggested by Brendan Ward.
2015-07-14 13:21:41 -06:00
Sean Gillies
fd584bd862 CC0 for test images. 2014-11-13 11:14:16 -07:00
Sean Gillies
a86f9fe579 Final layout tweaks.
Remove test data from sdists. Check for it when running tests and
direct users to download location. No automated download... I don't
expect many users to be running the tests from an sdist.

Closes #133.
2014-09-02 09:57:44 -06:00
Sean Gillies
943fa8e099 New layout, tests moved. 2014-09-01 22:00:56 -06:00