Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

switch to morecantile3 #418

Merged
merged 7 commits into from
Sep 14, 2021
Merged

switch to morecantile3 #418

merged 7 commits into from
Sep 14, 2021

Conversation

vincentsarago
Copy link
Member

ref #417

@vincentsarago
Copy link
Member Author

🤔 recent changes in rasterio break tests 😭

@vincentsarago
Copy link
Member Author

💥 I can't get CI to run because we need rio-cogeo, which also pin morecantile to >=2.1,<2.2 but in order to make CI run in rio-cogeo (if I update it to morecantile 3) I'll need rio-tiler 3 🤦

🔁 dependencies 🕳️

@vincentsarago
Copy link
Member Author

vincentsarago commented Sep 13, 2021

Tests are failing because for an unknown reason the bounds returned by rasterio==1.2.8 are not the same as the one for rasterio==1.2.6 and it now considers the tile/point to be outside the bounds.

from rasterio.crs import CRS
from rasterio.warp import transform_bounds
in_crs = CRS.from_wkt('PROJCS["WGS_1984_Lambert_Azimuthal_Equal_Area",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]],PROJECTION["Lambert_Azimuthal_Equal_Area"],PARAMETER["latitude_of_center",45],PARAMETER["longitude_of_center",-100],PARAMETER["false_easting",0],PARAMETER["false_northing",0],UNIT["metre",1],AXIS["Easting",EAST],AXIS["Northing",NORTH]]')
out_crs = CRS.from_epsg(4326)
bbox = (-4410000.000000002, 1453684.1641738773, -1506678.966595509, 4309999.999999999)
print(transform_bounds(in_crs, out_crs, *bbox, densify_pts=21))

# rasterio 1.2.6
>> (-179.91600712033699, 42.116151939674644, 179.04299285803737, 76.46962486562524)

# rasterio 1.2.8
>> (-160.73152298505175, 32.22950673496283, -108.2439562098202, 71.16432886506686)


#weirder: results from pyproj
from pyproj import CRS, Transformer
in_crs = CRS.from_wkt('PROJCS["WGS_1984_Lambert_Azimuthal_Equal_Area",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]],PROJECTION["Lambert_Azimuthal_Equal_Area"],PARAMETER["latitude_of_center",45],PARAMETER["longitude_of_center",-100],PARAMETER["false_easting",0],PARAMETER["false_northing",0],UNIT["metre",1],AXIS["Easting",EAST],AXIS["Northing",NORTH]]')
out_crs = CRS.from_epsg(4326)
tr = Transformer.from_crs(in_crs, out_crs, always_xy=True)
bbox = (-4410000.000000002, 1453684.1641738773, -1506678.966595509, 4309999.999999999)
print(tr.transform_bounds(*bbox, densify_pts=21))

### Pyproj 3.2 and 3.1
>> (166.11052567893609, 42.116151939674644, -124.50200312011823, 76.46962486562524)

@vincentsarago vincentsarago merged commit 78566d5 into rio-tiler-v3 Sep 14, 2021
@vincentsarago vincentsarago deleted the morecantileV3 branch September 14, 2021 12:32
vincentsarago added a commit that referenced this pull request Oct 19, 2021
* switch to morecantile3 (#418)

* switch to morecantile3

* remove python 3.6

* make sure to use rio-cogeo2.3.1 in tests

* 🤦

* use rio-cogeo from github

* update fixtures and tests

* update changelog

* deprecate metadata methods (#425)

* zxy -> xyz in SpatialMixin.tile_exits method (#419)

* No max size (#422)

* remove default max_size for part and feature

* ignore type, failing in python 3.9

* use rio-cogeo alpha

* Use RIO_TILER_MAX_THREADS instead of MAX_THREADS (#432)

* MAX_THREADS to RIO_TILER_MAX_THREADS

* Update env variable in docs

* Add to changelog

* Update CHANGES.md

Co-authored-by: Vincent Sarago <[email protected]>

* allow non-earth dataset (#429)

* allow non-earth dataset

* fix stac

* metadata/info returns `geographic_bounds`

* add test for non earth object tile reading

* add notebook

* update changelog

* update docs

* update

* revert and remove min/max zoom in __init__

* edit changes

* Use httpx (#431)

* Replace requests with httpx

* Use httpx instead of requests

* Use httpx in notebooks

* Add tox to dev requirements

* Revert change and remove unused import

* update changelog

Co-authored-by: Vincent Sarago <[email protected]>

* add new statistics methods and band names in ImageData object (#427)

* add new statistics methods and band names in ImageData object

* update base classes and tests

* MultiBandReader.statistics should use self.preview as COGReader

* update tests

* start migration docs

* update docs

* remove `band_expression` option in MultiBandReader (#437)

* Asset expression indexes (#438)

* change asset_expression type and add asset_indexes

* update changelog

* moar docs

* Allow float tile_buffer (#405)

* Add tests of the expected behaviour

* Add `tile_buffer` `float` support in `COGReader.tile()`

* :facepalm

Co-authored-by: Bernhard Stadlbauer <[email protected]>
Co-authored-by: vincentsarago <[email protected]>

* update docs and allow backward compat for indexes in MultiBaseReader

* Range colormap (#439)

* add range colormap support

* update docs

* update types

* s/range/intervals/g

* remove deprecated code and update docs (#440)

* remove deprecated code and update docs

* update changelog

Co-authored-by: Rodrigo Almeida <[email protected]>
Co-authored-by: bstadlbauer <[email protected]>
Co-authored-by: Bernhard Stadlbauer <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant