29 Commits

Author SHA1 Message Date
Alan D. Snow
51efb0d7a8
LNT: Use flake8 to find undefined variables & unused imports (#2693) 2023-01-10 12:48:09 -06:00
Eric Hutton
3786bc7dd8
Fix broadcasting of coords in rasterio.transform.xy (#2538)
* broadcast arrays to 1d arrays

* update ensure_arr tests for broadcasting coordinates

* make tests/test_transform.py a staticmethod

* add tests for ensure_arr_input that use zs

* change _ensure_arr_input to return numpy arrays, not lists

* transform ValueError into TransformError
2022-08-16 10:31:35 -06:00
Alan D. Snow
8403830422
MNT: Update tests & code compatibility for GDAL 3+ (#2452) 2022-05-10 08:16:49 -06:00
Yann-Sebastien Tremblay-Johnston
d459128461
fix issue with incorrect keyword argument causing heights to be ignored when using transform mixins with rpcs (#2422) 2022-04-05 15:21:31 -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
97e472830d
Branch after testing for __iter__ and open up to all numeric types (#2285)
Resolves #2283
2021-09-08 15:56:58 -06:00
Sean Gillies
22636eac82 Resolves #2242 2021-07-14 13:26:20 -06:00
Vincent Sarago
f587fb72ba Gcptransform (#1773)
* add GDALGCPsToGeoTransform

* add method to fall back to gcps geo transform when gcps are found

* add GDALGCPsToGeoTransform output in gcps info

* add GCPS class

* add GCPS in rasterio.control and update tests

* add from_gcps method

* return Affine and revert rio info change

* revert unrelated change

* add & for cython

* fix

* add tests

* Update rasterio/transform.py

Co-Authored-By: Sean Gillies <sean.gillies@gmail.com>

* /gcpslist/gcps/
2019-09-09 16:22:23 -06:00
Sean Gillies
33b59c0dad
Work around some minor breaking changes in GDAL 2.3 (#1388) 2018-06-26 07:44:36 -06:00
Sean Gillies
f0d3eb0bfb Fix last lingering window errors 2017-06-28 15:05:16 +02:00
Sean Gillies
361112e825 Refactor and test improvements
Traded the `int_reshape` function for a `round_shape` method on
the Window class with better docs and clearer semantics.
2017-06-16 17:20:15 +02:00
Matthew Perry
06ed3251a3 test rowcol inverse 2016-07-08 13:41:17 -07:00
Matthew Perry
c824b9e917 initial take on rowcol/xy naming and signature change 2016-07-08 13:41:17 -07:00
Matthew Perry
dce67addb3 deprecate ul and test corners 2016-07-08 09:44:48 -07:00
Matthew Perry
afb95d6592 merge master 2016-07-08 08:33:39 -07:00
Kevin Wurster
0ae044317a tastes_like_gdal() now recognizes the GDAL identity transform 2016-06-25 00:51:10 -04:00
Kevin Wurster
5a82b3693d Function for converting between (row, col) and (x, y). User determines if the returned coordinates are for the pixel center or a corner. 2016-06-25 00:16:37 -04:00
Kevin Wurster
6fb1113c3d rasterio.transform.guard_transform() raises a TypeError if a GDAL geotransform is encountered, NOT a ValueError. 2016-06-20 00:03:06 -04:00
Kevin Wurster
40cbc26d73 Switch src.transform to an instance of affine.Affine() and add a warning deprecating src.affine.
Switch src.affine to src.transform in tests
2016-06-05 14:29:34 -04:00
Matthew Perry
f1c501e5aa additional tests for rio cmds 2016-04-05 12:16:19 -04:00
Matthew Perry
21b37f86a0 from_bounds failure 2016-03-16 12:05:14 -04:00
Brendan Ward
90260b9be5 Added warnings for Affine.identity() input / output. Added enums for GDAL errors. 2015-11-17 22:19:57 -08:00
Kevin Wurster
3490f6f42b Added DatasetReader.window_bounds() to easily get a window's corner coordinates. 2015-05-26 21:26:11 -04:00
Sean Gillies
45c2baf0e4 Merge remote-tracking branch 'origin/ez-transform' into oh-nineteen-pre 2015-03-11 19:15:49 -06:00
Sean Gillies
a807d1bd51 Closes #282.
At the heart of this was a subtle indexing error due to calling
round() instead of math.floor(). Fixing that needed a cascade of
fixes to expectated values in various tests.

Finally, core logic in the merge command was rewritten for
correctness and clarity.
2015-03-11 15:11:52 -06:00
Sean Gillies
4de49137b1 Add affine transform factories from_origin, from_bounds
To simplify and clarify the reprojection example.
2015-03-03 16:57:32 -07:00
Sean Gillies
93a6e4017c Remove redundant assertions. 2015-02-09 10:30:21 -07:00
Sean Gillies
c79e88fd42 Add window_transform method.
Closes #215
2015-02-09 09:55:43 -07:00
Sean Gillies
943fa8e099 New layout, tests moved. 2014-09-01 22:00:56 -06:00