121 Commits

Author SHA1 Message Date
Alan D. Snow
9880c5c40f
DEP: Python 3.10+ & GDAL 3.6+ (#3440) 2025-12-05 08:47:04 -06:00
Jefferson Silvério
87255a2e54
Update sieve() docs (Issue #3383) (#3384)
* fix: remove float32 from _sieve docstring.

* doc: remove float32 from sieve
2025-09-08 09:35:17 -05:00
Adam J. Stewart
4cd7af046d
rasterio.merge: rasterio.bool_ is not an rst link (#3345) 2025-05-20 10:28:53 -06:00
Ryan Grout
a156d1aeb3
Force uint8 dtype for geometry mask. Return boolean view. (#3272) 2024-12-06 09:48:00 -07:00
Christian Clauss
7a741ee370
Fix typos discovered by codespell (#3264)
* Fix typos discovered by codespell

* crasher

Co-authored-by: Sean Gillies <sean.gillies@gmail.com>

---------

Co-authored-by: Sean Gillies <sean.gillies@gmail.com>
2024-11-28 20:09:20 -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
Sean Gillies
afc33d87a4
Allow rasterize() output to be captured in datasets (#3131)
* Allow rasterize() output to be captured in datasets.

Resolves #1018.

* Run pyupgrade on changed files
2024-08-10 17:58:41 -06:00
Pieter Roggemans
7f94c46eee
ENH: enable support for extra dtypes in features.shapes: int8 and float64 (#3125)
* ENH: enable support for more dtypes in features.shapes

* Update CHANGES.txt

* int8 needs gdal 3.7

* Add extra types to docstring

* Apply feedback: int8 only from version 3.7
2024-08-05 18:13:07 -06:00
Sean Gillies
8427430551
Re-enable non-string dtype for rasterize() (#3045)
* Re-enable non-string dtype for rasterize()

A test that passed but wasn't testing what it claimed to test has
been deleted.

Resolves #3043

* Update change log and version

* Switch to more explicit if/elif/else for dtype logic

Also fix a URL in a test that recently broke (fsspec change maybe?)
2024-03-26 10:36:33 -06:00
Sean Gillies
3a04244a97
Rel 1.4a1 (#3037)
* Rasterio 1.4a1

* Add an __init__.py to _vendor/

* Explicitly mention rasterio._vendor in package config

* Add missing pyparsing dependency (vendored snuggs)

* Update metadata and change log

* Set new release date

* use nodata value when provided in boundless vrt doc (#3026)

* Add some debugging output

* Temporarily increase log level

* Don't assert on dtype in rasterize

* New pre-release date

* Version is 1.4dev

---------

Co-authored-by: Sean Gillies <seangillies@Seans-MacBook-Air.local>
Co-authored-by: Vincent Sarago <vincent.sarago@gmail.com>
2024-03-01 15:57:38 -07:00
Sean Gillies
9520b69cd1
Simplify rasterize (#3003)
* Simplify rasterize by restricting default output to float64/int64

Like numpy.array(). This allows us to deprecate several dtype
helper functions.

GDAL 3.5 doesn't support int64, so we will replace with int32.

* Remove another helper.

* Enable fallback to uint32 for GDAL 3.5

Address other tests failing on 3.4

* Remove unneeded tests, parametrize some.

* Remove unused import.

* Add change log entry.

* Spelling correction.
2024-01-09 11:32:47 -07:00
Stephen Knox
5c441ed748
docs: minor docs changes (#2991)
Improves docs for features.geometry_mask()
2024-01-02 08:28:30 -07:00
Sean Gillies
ffa3053012
rasterize(): given an empty shapes sequence return an empty or filled array (#2993)
* Given an empty shapes sequence, rasterize() returns an empty array

Resolves #2743

* Add PR number to change log
2023-12-21 14:27:43 -07:00
Sean Gillies
ccca0cb9be Merge tag '1.3.7' into main 2023-05-22 18:05:41 -06:00
Sean Gillies
5dd56f352e
Extend sieve's input to allow opened datasets and multiband objects (#2838)
* Extend sieve's input to allow opened datasets and multiband objects

Resolves #2782

* Remove commented code, clean up imports
2023-05-22 14:14:58 -06:00
Sean Gillies
578a3c5bfc
Int8 related backports from main (#2834)
* Take into account GDAL >= 3.7 GDT_Int8 signed int8 datatype (fixes #2635) (#2656)

* ENH: Added int8 dtype to rasterize (#2780)

---------

Co-authored-by: Even Rouault <even.rouault@spatialys.com>
Co-authored-by: Alan D. Snow <alansnow21@gmail.com>
2023-05-18 13:33:53 -06:00
Alan D. Snow
4a7ba6dc8d
ENH: Added int8 dtype to rasterize (#2780) 2023-03-16 21:29:52 -05:00
Alan D. Snow
51efb0d7a8
LNT: Use flake8 to find undefined variables & unused imports (#2693) 2023-01-10 12:48:09 -06:00
Emily Selwood
aa54361939
DOC: Update documentation on rasterio.features.rasterize (#2666) 2022-12-01 10:44:53 -06:00
Sean Gillies
3debd662c2 Merge branch 'maint-1.3' into main 2022-10-19 15:40:35 -06:00
Sean Gillies
4b1e369069
Remove _loading, copy it into __init__ (#2594)
* Remove _loading, it's done in __init__ now

Resolves #2593

* import sys

* Correct imports

* We already require python >= 3.8

* Add PR number to change log
2022-09-26 18:02:54 -06:00
Alan D. Snow
c17bc35a80
DOC: Add intersphinx for matplotlib & numpy (#2527) 2022-07-21 16:52:22 -06: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
Vincent Sarago
ba5e90c487
mapbox -> rasterio (#2321) 2021-10-22 09:04:05 -06:00
Sean Gillies
7724adfc43 Merge tag '1.2.9' 2021-10-01 14:17:38 -06:00
Sean Gillies
5f2e559478 Compute geometry_window more accurately for rotated rasters
Resolves #2303
2021-10-01 11:16:58 -06:00
Sean Gillies
6292959538 Merge branch 'maint-1.2' 2021-09-07 11:21:43 -06:00
Adam J. Stewart
adef906d01
Various fixes to documentation (#2256)
* Various fixes to documentation

* Remove in-line shell prompts

* Fix rasterize shapes type

* Convert todo's to comments

* Revert back to todo directive
2021-08-18 10:30:55 -06:00
Sean Gillies
64fd509ed1 Resolves #2266 2021-08-17 15:51:56 -06:00
Sean Gillies
02d65cfd16 Finish merge of 1.2.4 2021-05-31 17:10:57 -06:00
Sean Gillies
2de62d2ead Merge tag '1.2.4' 2021-05-31 16:26:51 -06:00
Sean Gillies
7114fb7fb5
Save GDAL CInt16 data (#2185)
* Save GDAL CInt16 data

* _getnpdtype translates "complex_int16" to complex64.
2021-05-25 21:41:40 -06:00
Yann-Sebastien Tremblay-Johnston
8cb216ca83
wrap imports with add_dll_directory if win and python >= 3.8 (#2129)
add newline to EOF

instead of env var, fallback to glob for gdal*.dll in PATH

update changelog

remove backtick

Co-authored-by: Sean Gillies <sean@mapbox.com>
2021-03-31 13:10:22 -06:00
Sean Gillies
3847cc2410
Rewrite of from_bounds and geometry_window (#2116)
* Rewrite of from_bounds and geometry_window

Resolves #2112

* Remove unused parameters from call to geometry_window
2021-02-15 08:31:24 -07:00
Ian Schneider
201a8d0143
flatten multipolygon to avoid holes in output (#2014)
related to 1274, a multipolygon was resulting in the same behavior
2020-10-15 12:49:12 -06:00
Brendan Ward
22043389e4
Add support for bounds of GeometryCollection (#1915)
* Add support for bounds of GeometryCollection; resolves #1914

* Fix broken test for invalid geometries, and catch more
2020-04-29 12:23:24 -06:00
Sean Gillies
d74afa1b0f Filter more categories of invalid geoms
Resolves #1815
2020-02-14 08:54:41 -07:00
Sean Gillies
b15a8f69f9 Note why shapes doesn't work with uint32 or float64
Final follow up on #1717.
2020-01-08 13:23:02 -07:00
Sean Gillies
eba69296bc Add resource and performance notes to rasterize() docstring 2019-09-25 15:33:57 -06:00
Sean Gillies
104b63b33c Handle shape skipping warnings and update change log 2019-09-13 14:23:28 -06:00
Sean Gillies
9e30d22d6d
Switch sharing kwarg default to False (#1775)
* Switch sharing kwarg default to False

Resolves #1705

* Replace GDALOpenShared with GDALOpen except in one shim

* Revert two open_dataset to GDALOpen

* Run tests under gdb

* Increment ref count in WarpedVRTBase

* Open a new dataset handle in WarpedVRT

* Remove gdb

* Remove exceptions from open_dataset in _shim1

Makes usage much easier

* Fix in-memory dataset leaks in _reproject
2019-09-13 08:05:14 -06:00
Sean Gillies
33230f9c8d Merge tag '1.0.27' 2019-09-05 18:17:07 -06:00
Sean Gillies
f829cf0226 No more right multplication with instances of Affine
That usage is deprecated.
2019-09-05 11:45:15 -06:00
Sean Gillies
073339ce57 Merge branch 'maint-1.0' 2019-08-06 18:42:38 -06:00
Sean Gillies
b806345964 fill value instead of default_value
Thanks @brendan-ward!

Resolves #1738
2019-07-30 15:49:03 -06:00
Sean Gillies
df11584101 Use default_value when shape's value is None
Resolves #1738
2019-07-30 15:04:02 -06:00
Brendan Ward
3d8836d9b1 Warn on rasterizing invalid / empty geometries instead of failing (#1680)
* Raise warnings rather than exceptions for invalid / empty shapes in rasterize

* Add test for geo interface for is_geom_valid and fix for travis builds

--no-use-pep517 flag for pip install of local environment is needed to get pip install working

* Make warning for invalid / empty geometry in rasterization more clear
2019-05-03 11:18:09 -06:00
Sean Gillies
98126f2abc
Add full support for numpy masked arrays to features.shapes() (#1523)
Resolves #1517
2018-10-25 14:08:45 -06:00
Sean Gillies
7b8d5e248b
Avoid losing a row or column in geometry_window() (#1472)
Resolves #1436
2018-09-18 20:53:03 -06:00