58 Commits

Author SHA1 Message Date
Sean Gillies
24d79d54af
Merge 1.4.3 (#3270)
* Eliminate boundless reads in merge, new compositing implementation (#3234)

* Eliminate boundless reads in merge, new compositing implementation

Resolves #3228

* Fix nits

* Compare non-zero mean of arrays

* Implement and use Window.align()

Combines the effects of Window.round_offsets and
Window.round_lengths, producing the same effect as gdal_merge.py

* Remove unused math import

* Add more docs about align()

Also increase the fraction used in round_offsets() to be
consistent with align()

* Move align() to a private func, use two existing methods in tests

* Add a test for merging WarpedVRTs (#3237)

Resolves #3196

* Backport of #3217 (#3243)

* Backport of #3217

* Update change log

* Increment GDAL and Python versions for CI (#3244)

* Rewrite _matches() to better support to_authority() and to_epsg() (#3255)

* Rewrite _matches() to better support to_authority() and to_epsg()

Resolves #3239

* Remove list() call and update change log

* Use to_epsg() in is_epsg_code() (#3258)

* Use to_epsg() in is_epsg_code()

Resolves #3248

* Update change log

* Allow MRF compression to surface in properties (#3259)

* Allow MRF compression to surface in properties

Resolves #3256

* Update change log

* Register drivers at most once per process (#3260)

* Register drivers at most once per process

Resolves #3250

* Appease flake8

* Add a note about GDAL_SKIP in the change log

* Support all GDALFillNodata() options in rasterio.fill (#3265)

* Support all GDALFillNodata() options

Resolve #3175.

* Cast values to str and update docs

* Update change log

* Prevent rasterio from trying to open a dataset object (#3266)

Resolves #3105.

* Fix typos discovered by codespell (#3264) (#3267)

* Fix typos discovered by codespell

* crasher



---------

Co-authored-by: Christian Clauss <cclauss@me.com>

* Fix erroneous masking of 0-valued data (#3268)

* Fix erroneous masking of 0-valued data

Resolves #3245

* Add an assertion about data values and update change log

* This is 1.4.3

---------

Co-authored-by: Christian Clauss <cclauss@me.com>
2024-12-02 10:43:14 -07:00
Alan D. Snow
fd4163d4b5
DEP: GDAL 3.5+, numpy 1.24+ (#3166)
* DEP: Python 3.10+, GDAL 3.5+, numpy 1.24+

* Apply suggestions from code review

* DEP: GDAL 3.5+, numpy 1.24+

* Fix

* remove python 3.13 from conda matrix

---------

Co-authored-by: Sean Gillies <sean.gillies@gmail.com>
2024-09-09 21:59:11 -06:00
Sean Gillies
87a582a391
Update code to Python 3.9 usage (#3132)
* Run pyupgrade --py39-up

* Run darker on previous pyupgrade changes
2024-08-10 18:22:54 -06:00
Jan Žák
caff38c7c0
BUG: Update write_mask to accept numpy booleans (#2707) 2023-01-11 13:31:27 -06:00
Alan D. Snow
840ea6305d
CLN: Remove unnecessary GDALVersion runtime checks (#2685)
Co-authored-by: Even Rouault <even.rouault@spatialys.com>
2022-12-27 13:20:54 -06:00
Even Rouault
e4ecc02b9e
Take into account GDAL >= 3.7 GDT_Int8 signed int8 datatype (fixes #2635) (#2656) 2022-11-20 22:30:33 -06:00
Sean Gillies
2c40386851
Silence non-informative errors from _delete_dataset_if_exists (#2548)
* Silence GDAL error logging in _delete_dataset_if_exists

Resolves #2525

* Silence non-informative log messages from _delete_dataset_if_exists

Resolves #2525
2022-08-11 17:40:10 -06:00
Alan D. Snow
3b325cec04
MNT: Remove GDAL 3.1 compatibility checks (#2463) 2022-06-23 17:21:39 -05:00
Sean Gillies
212ad76a4c
Snowman2 int64 (#2467)
* ENH: Add support for Int64 & UInt64 for GDAL 3.5+

* Use ubuntu-small, not full, also xfail a test for GDAL 3.5.0

Co-authored-by: snowman2 <alansnow21@gmail.com>
2022-05-29 20:37:56 -06:00
Sean Gillies
c11fc1c93d Check mask flags in latest masked array writing tests 2022-05-11 13:26:58 -06:00
Sean Gillies
9751abf2fb Improve comments
Towards resolving #2461
2022-05-10 08:07:26 -06:00
Sean Gillies
d15fc46cd8
Accept masked arrays and fill or write a mask (#2460)
Resolves #2347
2022-05-10 07:44:07 -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
Sean Gillies
d40aec3124 GDAL version decorator for latest test 2021-09-28 12:44:08 -06:00
Sean Gillies
413bacf137 Add support for enum and tuple type creation options
Resolves #2102.
2021-09-28 12:39:15 -06:00
Sean Gillies
4773c70059
Switch from OSRAutoIdentifyEPSG to OSRFindMatches (#2279)
* Switch from OSRAutoIdentifyEPSG to OSRFindMatches

Resolves #2273

* Keep older code in _matches for use with GDAL versions < 3

* Save all matches for an authority in order

* Generalize assertion on CRS WKT from gdalinfo
2021-09-03 10:43:07 -06:00
Sean Gillies
df446d4cc8 Check signed byte values read 2021-05-20 14:54:59 -06:00
Sean Gillies
6dbf74b643 Close error handling environment *after* dataset closes
Resolves #2088
2021-01-24 13:23:39 -07:00
Alan D. Snow
6a8e8ab1c9
ENH: Auto-detect driver based on extension (#2008) 2020-10-05 13:15:25 -06:00
Sean Gillies
a36e31a543 Raise RasterioIOError for failed creation of datasets in w mode
Resolves #1796
2020-02-24 16:44:09 -07:00
Sean Gillies
983b9610ac Merge tag '1.0.26' 2019-08-26 10:59:02 -06:00
Sean Gillies
7d316a5437
Require width/height when opening a MemoryFile in w+ mode (#1752)
Resolves #1748
2019-08-21 17:39:53 -06:00
Sean Gillies
073339ce57 Merge branch 'maint-1.0' 2019-08-06 18:42:38 -06:00
Sean Gillies
3641127850
Maintain traditional axis order strategy everywhere (#1733)
* Maintain traditional axis order strategy everywhere

* Require GDAL 3 builds to pass

* Remove invalid comment and update change log
2019-07-29 14:19:33 -06:00
Sean Gillies
73390f2b33 Fix improper usage and add docs for the BIGTIFF option
Resolves #1647
2019-03-04 10:24:45 -07:00
Sean Gillies
012d3faa82 Skip test that can't pass on 32-bit system 2019-02-28 08:42:04 -07:00
Kirill Kouzoubov
37699288e4 Add support for signed 8 bit images (#1595)
Even though GDAL only has unsigned GDT_Byte raster data type, signed vs unsigned
images can be differentiated via PIXELTYPE property. It is set to 'SIGNEDBYTE'
for signed 8-bit images. This is how GDAL's native python binding compute
numpy.dtype from dataset object.
2019-02-07 17:22:15 -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
Robert Sare
4b0d3dd69e Mark tests that call GDAL binaries (#1555) (#1557)
* add webp to the available compression enum (#1515)

* Add webp to enums.Compression and increment version

* Add link to dev discussion group

* fix year specified in version 1.0.9 date (#1530)

Year specified in version 1.0.9 date is 2019, which is in the future at this time. Set to 2018, which is in the past.

* Update docstring for plotting_extent (#1516)

* 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

* Fix a typo (probably) (#1526)

* Fix a typo (probably)

* Update url for manylinux

* Update README.rst

Co-Authored-By: ismailsunni <imajimatika@gmail.com>

* Update README.rst

Co-Authored-By: ismailsunni <imajimatika@gmail.com>

* Remove unused string

* modified _osr_from_crs to use CRS.from_user_input (#1546)

* modified _osr_from_crs to use CRS.from_user_input

* update to use tmpdir fixture for pytest

* update comparison for error output for rio warp

* updated to always attempt to MorphFromESRI to prevent exception from being raised

* added test to test warping with ESRI wkt

* updated data_dir to be used as fixture

* removed duplicate import of CRSError

* reordered initialization of spatial reference to prevent memory leaks

* updated to raise CRSError of auth != EPSG

* Revert "modified _osr_from_crs to use CRS.from_user_input (#1546)" (#1548)

This reverts commit b120a00a05e4f6174c02e855cc016fde9b54c4e0.

* Mark tests using gdal binaries

* Add pytest import
2018-11-21 09:58:28 -07:00
Alan D. Snow
30f400d427 added ValueError if driver is missing when getting writer for driver (#1443) 2018-09-13 10:45:53 -06:00
Sean C. Gillies
567e2c6056 Fix assertion 2018-06-20 13:00:56 -06:00
Sean C. Gillies
baf957e2e0 Change dst_alpha from 4 to src.count + 1
Resolves #1382
2018-06-20 12:15:39 -06:00
Sean C. Gillies
efee1076f8 Clean up test condition and add tests of deprecation 2018-05-24 14:38:00 -06:00
Sean C. Gillies
ba7b4f76b1 Deprecate creation kwds in profiles
Addresses concerns raised in #1332
2018-05-24 13:57:27 -06:00
Sean C. Gillies
9f1fea66be Cleanup 2018-04-25 16:57:01 -06:00
Sean C. Gillies
f5434180b6 Do not save opening options in tags 2018-04-25 09:44:40 -06:00
James McBride
659a59484d Fix dtype check in dataset write
It looks like the previously implemented data type check was not ever
being entered, due to checking for a 'type' attribute on a string. Since
the _init_dtype attribute is now always a string, remove this check and
related handling, so that now dtypes are checked for validity, providing
a more useful error message in case of an invalid dtype. Fixes #1008.
2017-05-05 22:24:39 -07:00
Sean Gillies
294b61b77a Use raw strings for regex 2017-03-28 16:21:41 +02:00
Kevin Wurster
b3cd5cc1b6 Ensure rasterio.Env() tears down properly when no parent environment exists. 2017-02-06 14:53:37 -05:00
Matthew Perry
9d90842a1f merge master 2016-06-30 13:29:51 -04:00
Sean Gillies
863434735c New io module
Resolves #743
Replaces #793
2016-06-30 10:29:30 -06:00
Sean Gillies
d8ec3e6ca2 New blacklist policy
Replaces the BAD_WRITE_DRIVERS list in _io.
2016-06-29 09:50:09 -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
Matthew Perry
185142ca2d bring bad drivers list up and sync tests 2016-06-13 20:44:19 -04: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
Matthew Perry
ebc5ec06e4 disable netcdf writes, fixes #647 2016-06-13 18:12:26 -04:00
James Hiebert
a0a4289b51 Adds a CRS.to_dict method and updates comparisons 2016-06-05 09:32:58 -07:00
James Hiebert
c8185796f4 Removes the crs_wkt property from DatasetReader
With the addition of the simpler `wkt` property to the CRS class, this
commit removes the crs_wkt property and methods to simplify the
interface
2016-06-04 11:03:03 -07:00