58 Commits

Author SHA1 Message Date
Sean Gillies
ec3894458f Allow local files to be opened when expired credentials exist
Resolves #1712
2019-07-12 15:07:23 -06:00
Sean Gillies
c9ce706bca
Default to DummySession if boto3 can't be imported (#1709)
* Default to DummySession if boto3 can't be imported

Resolves #1708

* Update change log and increment version to 1.0.25dev
2019-06-17 14:39:43 -06:00
Sean Gillies
99a5ea0ea2 Remove mock from compat module
Resolves #1651
2019-03-07 07:52:42 -07:00
Sean Gillies
ff94da7f74
Check for data files at builtin locations (#1639)
* Check for data files at builtin locations

If we have them, don't set GDAL_DATA or PROJ_LIB.

Resolves #1631

* Include mock on Python 2.7
2019-02-25 20:40:06 -07:00
Sean Gillies
bdf9b567ba
Patch GDAL_DATA into environment (#1618)
* Patch GDAL_DATA and PROJ_LIB into environment on import of _env

* Move patching to rasterio.env

* Make assertion more generic
2019-02-04 16:50:31 -07: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
74e59ba650
Patch environ gdal data (#1560)
* Patch os.environ, adding GDAL_DATA

* Turn up verbosity

* Simplify assertion

* Debugging

* Remove GDAL_DATA before test

* Update version, remove printed

* Change CRS inequality test

* Patch os.environ on import of _crs module

* Remove public API functions

* Skip wheel marked tests

* Delete obsolete test
2018-11-26 18:52:38 -05: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
sshuair
b137308499 Add support for Alibaba Cloud OSS file (Cloud Optimized GeoTIFF) (#1535)
* add webp to the available compression enum (#1515)

* Add webp to enums.Compression and increment version

* add oss(alibaba cloud OSS files) support

* add docs for oss session

* remove useless comment

* add test for OSSSession and Env with OSS

* fix spell of test session
2018-11-05 13:26:33 -07:00
Sean Gillies
f6bb027feb Add missing offsets and scales properties
Resolves #1527
2018-10-29 13:23:26 -06:00
Sean Gillies
1551cabd77
Resolve #1520 and #1521 (#1524)
* Resolve #1520 and #1521

* Remove commented code, restore credential fetch in __init__
2018-10-25 16:20:29 -06:00
Sean Gillies
d5f2cd623e Don't clobber credentials in the outer Env
Resolves #1507
2018-10-23 16:41:52 -06:00
Sean C. Gillies
2342df065a Remove debug logging, require credentials for https test 2018-09-17 16:19:12 -06:00
Sean C. Gillies
ef132535e5 Unset AWS_ACCESS_KEY_ID 2018-09-17 11:18:03 -06:00
Sean C. Gillies
84f7372737 Test that Env works with a DummySession 2018-09-17 10:56:45 -06:00
Sean Gillies
8510a599d8
Generalize to support cloud providers other than AWS (#1429)
* Generalize to support cloud providers other than AWS

* Move session stuff to a new module (#1430)

* Remove commented code, add deprecation warning and change notes
2018-09-13 10:55:23 -06:00
Sean Gillies
c3b2499487
Rc1 (#1390)
* Add missing test for decorator

* Bump version, update change log, add a test docstring
2018-06-27 10:16:45 -06:00
Sean C. Gillies
e50af4cdf7 Resolves #1362 2018-06-20 14:18:51 -06:00
Sean C. Gillies
016d173ee5 Removed commented code 2018-05-11 12:29:55 -06:00
Sean C. Gillies
58b95de29b Resolves #1011
And more!
2018-05-11 11:44:41 -06:00
Sean C. Gillies
7c6f398e34 Resolves #1337 2018-05-07 15:35:37 -06:00
Brendan Ward
0daad71fce Add GDAL version check for positional arguments 2017-12-18 21:00:27 -08:00
Brendan Ward
a3ffaa1f18 Added is_max_version and reason to require_gdal_version decorator 2017-12-13 20:49:15 -08:00
Brendan Ward
a3de8c868a Added GDAL version decoration and used for reproject 2017-12-10 21:26:34 -08:00
Brendan Ward
e0f62813e4 Moved comments to reason, skipped test_memoryfile module 2017-11-30 07:01:52 -08:00
Brendan Ward
bf8d4f3509 More consistent GDAL version handling in tests 2017-11-29 08:59:31 -08:00
Brendan Ward
8caf01f151 wrap GDAL version checking into class 2017-11-28 08:53:33 -08:00
Sean Gillies
c443affdd6 Stop open's inner Env from clobbering outer env creds
Resolves #1075
2017-10-09 12:04:04 -06:00
Sean Gillies
7d30282589 Merge pull request #1042 from mapbox/iss875
Special handling for GDAL_CACHEMAX
2017-05-22 12:05:23 +02:00
Kevin Wurster
77fc38d4f1 Test for GDAL_CACHEMAX. Update another test for new integer normalization. 2017-05-10 23:19:13 -04:00
James McBride
8d655baff0 Test de-registration of GTiff driver 2017-05-08 08:54:02 -07:00
Kevin Wurster
4bce1e8456 Actually keep track of whether or not the drivers are registered. 2017-04-26 23:31:03 -04:00
Kevin Wurster
dce70ca72d Remove unnecessary 'rasterio.Env()' calls. 2017-04-13 19:36:11 -04:00
Sean Gillies
787d618720 Merge pull request #997 from mapbox/issue996
Better defined and tested concurrent Envs
2017-03-28 16:20:58 +02:00
Sean Gillies
a7e6747aa7 Make discovered_options a thread local variable 2017-03-24 14:13:35 +01:00
Sean Gillies
861e45ad71 Inheritance and isolation of config for child threads
The main thread uses CPLSetConfigOption and thus child threads
inherit from main's configuration. Child threads use the thread
local version and are thus isolated from each other.

Tests of this behavior have been added and documentation added
to _env (and soon to the manual).
2017-03-17 12:55:35 +01:00
Kevin Wurster
86a2eab52a Flag tests requiring network access with '@pytest.mark.network'. Running "$ pytest -m 'not network'" will skip the tests requiring network access. 2017-03-16 21:35:35 -04:00
Ben Lewis
6d60417fb1 update tests concerning local._env 2017-03-15 12:07:23 +11:00
Kevin Wurster
2d221046bc Test environment discovery with the environment defaults. 2017-02-13 19:00:54 -05:00
Kevin Wurster
94162bb012 Test fix. 2017-02-13 18:23:06 -05:00
Kevin Wurster
db8fe2381f Don't explicitly cast config option names to uppercase. GDAL does this on its own and we want to know if this behavior ever changes. 2017-02-13 18:20:41 -05:00
Kevin Wurster
279901a40e Probe the GDAL environment when the outermost 'rasterio.Env()' starts to see if any of the input config options also exist in the GDAL environment. Previously they would have been overwritten when 'rasterio.Env()' tears down, but now they are preserved and reinstated. See the note above 'rasterio.env._env' for more information. 2017-02-13 18:14:13 -05:00
Kevin Wurster
9d298e2087 Don't include casting to uppercase in normalization process. Apparently GDAL does that on its own. Add docstrings for GDAL config accessors. 2017-02-13 17:48:00 -05:00
Kevin Wurster
069960b7cb Option to disable key and value normalization. 2017-02-13 17:36:26 -05:00
Kevin Wurster
b137b6d209 Set 'rasterio.env._env = None' when tearing down the outer environment. 2017-02-06 15:26:48 -05:00
Kevin Wurster
b3cd5cc1b6 Ensure rasterio.Env() tears down properly when no parent environment exists. 2017-02-06 14:53:37 -05:00
Sean Gillies
2564e93658 Finish renaming, add a exc_wrap_vsilfile() 2017-01-11 13:01:30 +01:00
Sean Gillies
83d4b05026 Switch to configuring GDAL only when Env is entered 2016-10-05 11:41:18 +02:00
Sean Gillies
2f1ee243ba Push and pop error handler within Env context
Closes #876
Closes #902
2016-10-05 11:41:18 +02:00
Sean Gillies
816ff3e8c4 Test that --aws-profile > environment variables 2016-07-26 13:03:29 -06:00