103 Commits

Author SHA1 Message Date
Adam J. Stewart
9f04798634
Docs: fix .. note:: directive (#3347) 2025-05-20 07:06:16 -05:00
Sean Gillies
35f6fbe344
Update switch.rst (#3318)
Expand on warnings against importing gdal and rasterio together.
2025-03-03 11:20:19 -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
Andrea Giudiceandrea
c20ed3b354
Docs: avoid to import rasterio if you use the rio interactive inspector (#3177) 2024-09-29 18:19:55 -06:00
Sebastien Tremblay-Johnston
c2acc82ed2
docs: 📝 clarify usage of rpc_height in RPCTransformer usage example (#3158)
* docs: 📝 clarify usage of rpc_height in RPCTransformer usage example

Detail using a constant height offset via `rpc_height` keyword argument in instantiation of transformer.

* Apply suggestions from code review

Co-authored-by: Batuhan Kavlak <batuhan.kavlak@up42.com>

---------

Co-authored-by: Sean Gillies <sean.gillies@gmail.com>
Co-authored-by: Batuhan Kavlak <batuhan.kavlak@up42.com>
2024-09-06 11:27:52 -06:00
Sean Gillies
03464e721b
Document use of rasterio.band() shortcut (#3147) 2024-08-26 12:21:11 -06:00
Sean Gillies
7629d39f32
Add an admonition about fork to the concurrency doc (#3127)
Resolves #2979
2024-08-05 13:57:29 -06:00
Sean Gillies
5db194fe99
Sidecar support for Python openers (#3032)
* Failing test with a .msk sidecar

* POC of sidecar support for Python openers

Towards resolving #3027

* Register opener for the parent directory/folder of the given URL

Handling the error cases properly gets all our tests passing again.

* Add opener adapter classes and a factory

Still a lot of redundant code here, needs refactoring.

* Remove unused import

* Don't raise exceptions when files aren't found

Just return 1 or NULL

* Add two tests of using fsspec filesystem objs and fix a bug.

* Allow testing with tiledb.VFS

* More tests of fsspec http filesystem and .msk sidecar

* Module clean up

* Add mtime to stats, docstrings to abstract class

* Expand documentation

* Reassign name_list in loop

* Return -1 on stat failure, remove useless except clauses

* Don't set an error when OpenFile doesn't resolve

* Add eof callback
2024-02-29 10:48:18 -07:00
Sean Gillies
a3d883788f
Support writing to Python files (#2907)
* Support writing to Python files

This depends on PR #2898.

Resolves #2906.

* Update change log

* Fix PR reference

* Use CPLError to convey opener failure out of the callback

* Call CPLError with 4 arguments

* Register opener for filename and mode

Also make sure that deregistration happens on cleanup

* Remove with from test

* Update opener documentation

---------

Co-authored-by: Sean Gillies <seangillies@Seans-MacBook-Air.local>
2023-12-22 10:37:17 -07:00
Sean Gillies
6335cd7f53
Document zip, zip+https, etc 2023-12-14 09:57:42 -07:00
Yann-Sebastien Tremblay-Johnston
033b6bbf42
update docs usage (#2947) 2023-10-17 14:26:32 -06:00
Sean Gillies
b9716ce3c9
Python file opener VSI plugin (#2898)
* Rough draft of a new VSI plugin

Resolves #2888 maybe

* Getting closer

* Working implementation!

The missing piece was keeping a reference to opened files.

* Add more tests

* Add more documentation about opener

* Improvements based on feedback from @rouault

* Update docstrings

* Update the VSI topic in docs

* Don't accept fsspec OpenFile instances as opener

Instead, we'll make a way for rasterio.open to accept them as the
"fp" positional argument

* Store contexts of vsipyopener file objects

Eliminates the fsspec OpenFile special case

* Strip file mode for the zipfile case

* Update rasterio/_vsiopener.pyx

Co-authored-by: Alan D. Snow <alansnow21@gmail.com>

---------

Co-authored-by: Sean Gillies <seangillies@Seans-MacBook-Air.local>
Co-authored-by: Alan D. Snow <alansnow21@gmail.com>
2023-08-31 11:46:00 -06:00
Alan D. Snow
443e3dd406
DOC: Add note about PROJ_DEBUG in debug error documentation (#2794) 2023-03-18 07:54:54 -05:00
Sean Gillies
6bb3e52e19 Merge tag '1.3.5' into main 2023-01-25 14:05:58 -07:00
Sean Gillies
d4fc803b74 Add an admonition to topics/windowed-rw.html#reading
Resolves #1242
2023-01-23 14:22:05 -07:00
Matthias Daues
5cf71dc806
Add a comment on dtype = int8 (#2577)
Raster data of dtype = int8 leads to an error message from pprint, which requires the data to be one of the following:
int16, int32, uint8, uint16, float32
I added a comment catching this error, which can be solved by casting the data: data = data.astype('int16')
2022-09-26 18:58:42 -06:00
Alan D. Snow
125340b74b
DOC: Improve links & add Band to docs (#2537) 2022-08-09 10:32:34 -06:00
snowman2
38ad052cc2 DOC: Fix header in error handling 2022-07-23 19:46:25 -05:00
Alan D. Snow
c17bc35a80
DOC: Add intersphinx for matplotlib & numpy (#2527) 2022-07-21 16:52:22 -06:00
Alan D. Snow
f1ad179d63
DOC: Added Debugging Internal GDAL instructions (#2520)
* DOC: Added Debugging Internal GDAL instructions

* DOC: Add Example prefix to code samples

* Update docs/topics/errors.rst

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

Co-authored-by: Sean Gillies <sean.gillies@gmail.com>
2022-07-19 13:58:16 -06:00
Nicolai Mogensen
633609b9d2
Typo in switch.rst Afine -> Affine (#2521)
The instance is an `Affine` class, and not `Afine`
2022-07-13 08:10:12 -05:00
Olivier Cloux
5368c60bd8 spot dead mapbox link 2022-02-04 14:42:03 +01:00
Yann-Sebastien Tremblay-Johnston
0f1b726d1d
warn when reprojecting with RPCs using a source CRS that is not EPSG:4326 (#2363)
* add checks in order to warn agaisnt incorrect source CRS when using RPCs to reproject

* use .from_string to be consistent with _calculate_default_transform

* raise error instead

* fix test
2021-12-22 20:16:02 -07:00
Vincent Sarago
87e5293237
Merge pull request #2274 from RichardScottOZ/patch-1
Update virtual-warping.rst
2021-12-16 00:03:16 +01:00
Sean Gillies
81d542a69a
Update switch.rst
GDAL_CACHEMAX shorthand notation is not supported by rasterio.
2021-11-15 10:34:19 -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
Yann-Sebastien Tremblay-Johnston
b92c21f3c0
handle md domain prefixed by "xml" (#2228)
* handle md domain prefixed by "xml"

* add test and add note about xml prefix namespaces
2021-09-30 09:50:52 -06:00
RichardScottOZ
b50f83c06a
Update virtual-warping.rst
coordinates
2021-09-01 10:42:13 +09:30
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
Idan Miara
14834341f2
docs/topics/switch.rst - update the section abound bands (#2201) 2021-06-09 09:45:48 -06:00
Kyle Barron
52a2500af9
Docs: Change rasterio.insp to rio insp (#2071)
* Change rasterio.insp to rio insp

* Update docs/topics/tags.rst

Co-authored-by: Sean Gillies <sean.gillies@gmail.com>
2020-12-14 17:21:46 -07:00
Yann-Sebastien Tremblay-Johnston
d27877c4b3
fix subheadings beind rendered as separate pages, and fix rpc reproject example to actually use kwargs (#2038) 2020-11-14 11:17:05 -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
Yann-Sebastien Tremblay-Johnston
10809b036b
WIP: Add coordinate transformation with RPCs (#1922)
* This is part of an effort to introduce the concept of rational polynomial coeffecients to be used for coordinate transformations using GDALCreateRPCTransformer.

- Added a new UserDict subclass named RPC to control.py. This structure contains the rationa polynomial coefficients, and can be instatiated from user input or read from dataset. GDAL stores RPCs as metadata which are all string encoded. The RPC object deserializes string values to float or list appropriately, and also provides a serialization method when passing to lower level GDAL methods.
- A new _transform.pyx method called _rpc_transform, similar to _base._transform except using GDALCreateRPCTransformer and GDALRPCTransform.
- A new RPCTransformWarning to errors.py, indicating when a RPC coordinate transformation has failed.
- New includes from gdal.h and gdal_alg.h for RPC related structs and functions
- New rpcs property to DatasetBase and subclassese with appropriate getter and setters (error when read only mode). Corresponding updates to _base.pxd and _io.pxd
- Tests

* trigger new travis build

* This is part of an effort to introduce the concept of rational polynomial coeffecients to be used for coordinate transformations using GDALCreateRPCTransformer.

- Added a new UserDict subclass named RPC to control.py. This structure contains the rationa polynomial coefficients, and can be instatiated from user input or read from dataset. GDAL stores RPCs as metadata which are all string encoded. The RPC object deserializes string values to float or list appropriately, and also provides a serialization method when passing to lower level GDAL methods.
- A new _transform.pyx method called _rpc_transform, similar to _base._transform except using GDALCreateRPCTransformer and GDALRPCTransform.
- A new RPCTransformWarning to errors.py, indicating when a RPC coordinate transformation has failed.
- New includes from gdal.h and gdal_alg.h for RPC related structs and functions
- New rpcs property to DatasetBase and subclassese with appropriate getter and setters (error when read only mode). Corresponding updates to _base.pxd and _io.pxd
- Tests

trigger new travis build

* Move RPC Class to it's own file

* fix typo

* make private

* re-implement RPC with attr

* make err_bias, err_rand attributes optional, default to empty string

* default to None, rather than empty string
2020-11-02 09:26:59 -07:00
Sean Gillies
f62b5f4a24 Update docs to show GDAL_CACHEMAX requires number of bytes 2020-10-27 15:21:26 -06:00
Mark Boer
14f837533b
docs: Concurrent read/write update (#2010)
* update the threadpool example

* add benchmark number, done a VM with 4 cores

* fixes threading typo and adds a little more background on what multhreading is trying to achieve
2020-10-22 15:03:09 -06:00
Guillaume Lostis
3568c9fd86
Fix stale links (#2021) 2020-10-20 09:57:56 -06:00
Sean Gillies
a701f56bfd Replace num_cols, num_rows with width, height
Resolves #1978
2020-08-17 11:14:01 -06:00
Guillaume Lostis
6f9e6fe092 Resampling docs typo (#1902)
* Fix error in resampling example

* Fix typo in resampling doc

* Introduce sphinx autodoc links in resampling.rst
2020-04-14 13:52:42 -06:00
Sean Gillies
dea2ed88f3 Resolves #1830 2020-03-20 13:41:48 -06:00
Sean Gillies
08dad6c5f2 Resolves #1854 2020-03-13 10:29:24 -06:00
Jonas
49c5ae5d3a replace broken resampling example with working one (#1804)
* replace broken resampling example with working one

* clarify scaling factor function
2020-03-13 10:27:44 -06:00
Nikolai Janakiev
b47e3f880b Fix GDAL data model link (#1795) 2019-10-02 08:37:57 -06:00
Guillaume Lostis
bed880553f Docs (#1771)
* Remove rasterio.vfs from doc

* Fix broken links in doc

* Fix typos in doc

* Update CLI doc

* Use rst links in doc
2019-09-09 14:15:27 -06:00
Raaj Tilak Sarma
953b9bdb08 typo fix (#1730)
change `resampling` to `Resampling`
2019-07-23 10:25:50 -06:00
Sean Gillies
a2ea156b76
Note block width and height restrictions 2019-05-22 11:41:44 -06:00
Sean Gillies
1aeef56e23 Merge branch 'maint-1.0' 2019-05-15 22:22:42 -06:00
Sean Gillies
2ff5710b7a Update resampling doc
Resolves #1596
2019-05-15 17:31:55 -06:00
Sean Gillies
eebf54b74f
Add Window import example 2019-05-06 13:41:47 -06:00