Rasterio 1.2b1


Sean Gillies
 

Hi all,

Wheels for Python versions 3.6-3.8 and manylinux1 and macos (built with xcode 9.3) are on PyPI this morning. I'd appreciate it if you could give it a try: python -m pip install rasterio==1.2b1.

At last, these wheels include GDAL 3.2.0 and PROJ 7.2.0. Please note that these wheels include no PROJ data. You must provide your own data or set PROJ_NETWORK=ON in your environment to use the PROJ CDN. See https://proj.org/resource_files.html for details.

I'm particularly interested in feedback about including leaving out the PROJ data. If it's going to impact the way you deploy rasterio, this is the time to let us know.

Yours,

--
Sean Gillies


Alan Snow
 

Thanks for working on this Sean!

I verified that PROJ_NETWORK=ON works with a basic test:

rio_geom.py:
from rasterio.warp import transform_geom

geometry = [
{
"type": "Polygon",
"coordinates": [
[
[-94.07955380199459, 41.69085871273774],
[-94.06082436942204, 41.69103313774798],
[-94.06063203899649, 41.67932439500822],
[-94.07935807746362, 41.679150041277325],
[-94.07955380199459, 41.69085871273774],
]
],
}
]


print(transform_geom("+proj=latlon", "+proj=utm +zone=10 +datum=NAD27", geometry))

$ python rio_geom.py
[{'type': 'Polygon', 'coordinates': [[(2914912.501340564, 5039833.18814224), (2916474.3810722474, 5040429.817378172), (2916971.9920050735, 5039127.068439782), (2915410.0220987815, 5038530.542053506), (2914912.501340564, 5039833.18814224)]]}]
$ PROJ_NETWORK=ON python rio_geom.py
[{'type': 'Polygon', 'coordinates': [[(2914912.2992929644, 5039834.208342302), (2916474.1765534407, 5040430.837641376), (2916971.7831669645, 5039128.087552843), (2915409.815547156, 5038531.561302773), (2914912.2992929644, 5039834.208342302)]]}]


Guillaume Lostis <g.lostis@...>
 

Hi Sean,

Thanks a lot for this upcoming release, I am really looking forward to using some of its new features!

Out of interest, the 1.2b1 wheels do not seem to be lighter than the 1.1.8 wheels even though they do not contain PROJ data. Is that because on the other hand GDAL 3.2.0 and/or PROJ 7.2.0 are heavier than their counterparts from release 1.1.8?

Also Sean and Alan, would you expect there to be problems if I were to have pyproj<3.0.0 and rasterio>=1.2 installed in my Python environment, due to their different PROJ versions, or would that still work OK?

Best,

Guillaume

On Tue, Dec 15, 2020 at 6:59 PM Alan Snow <alansnow21@...> wrote:
Thanks for working on this Sean!

I verified that PROJ_NETWORK=ON works with a basic test:

rio_geom.py:
from rasterio.warp import transform_geom

geometry = [
{
"type": "Polygon",
"coordinates": [
[
[-94.07955380199459, 41.69085871273774],
[-94.06082436942204, 41.69103313774798],
[-94.06063203899649, 41.67932439500822],
[-94.07935807746362, 41.679150041277325],
[-94.07955380199459, 41.69085871273774],
]
],
}
]


print(transform_geom("+proj=latlon", "+proj=utm +zone=10 +datum=NAD27", geometry))

$ python rio_geom.py
[{'type': 'Polygon', 'coordinates': [[(2914912.501340564, 5039833.18814224), (2916474.3810722474, 5040429.817378172), (2916971.9920050735, 5039127.068439782), (2915410.0220987815, 5038530.542053506), (2914912.501340564, 5039833.18814224)]]}]
$ PROJ_NETWORK=ON python rio_geom.py
[{'type': 'Polygon', 'coordinates': [[(2914912.2992929644, 5039834.208342302), (2916474.1765534407, 5040430.837641376), (2916971.7831669645, 5039128.087552843), (2915409.815547156, 5038531.561302773), (2914912.2992929644, 5039834.208342302)]]}]


Alan Snow
 

Is that because on the other hand GDAL 3.2.0 and/or PROJ 7.2.0 are heavier than their counterparts from release 1.1.8?
The new wheel now includes the proj.db, which is close to the size of grids that were removed. Also, PROJ requires more dependencies, so that is also a likely factor.

would you expect there to be problems if I were to have pyproj<3.0.0 and rasterio>=1.2 installed in my Python environment, due to their different PROJ versions, or would that still work OK?
It might work, but I wouldn't recommend it. At the very least, there are different versions proj.db in each one. If you do go that route, I would recommend you proceed with caution.


vincent.sarago@...
 

I just installed rasterio==1.2.0b1 on a fresh virtual env (with no GDAL/PROJ env set) and I'm getting a proj error 

Python 3.8.6 (v3.8.6:db455296be, Sep 23 2020, 13:31:39) 
[Clang 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from rasterio.crs import CRS
>>> CRS.from_epsg(4326)
ERROR 1: PROJ: proj_create_from_database: cannot build geodeticCRS 4326: SQLite error on SELECT extent.description, extent.south_lat, extent.north_lat, extent.west_lon, extent.east_lon, scope.scope, (CASE WHEN scope.scope LIKE '%large scale%' THEN 0 ELSE 1 END) AS score FROM usage JOIN extent ON usage.extent_auth_name = extent.auth_name AND usage.extent_code = extent.code JOIN scope ON usage.scope_auth_name = scope.auth_name AND usage.scope_code = scope.code WHERE object_table_name = ? AND object_auth_name = ? AND object_code = ? ORDER BY score, usage.auth_name, usage.code: no such table: usage
Traceback (most recent call last):
  File "rasterio/_crs.pyx", line 278, in rasterio._crs._CRS.from_epsg
  File "rasterio/_err.pyx", line 190, in rasterio._err.exc_wrap_int
rasterio._err.CPLE_AppDefinedError: PROJ: proj_create_from_database: cannot build geodeticCRS 4326: SQLite error on SELECT extent.description, extent.south_lat, extent.north_lat, extent.west_lon, extent.east_lon, scope.scope, (CASE WHEN scope.scope LIKE '%large scale%' THEN 0 ELSE 1 END) AS score FROM usage JOIN extent ON usage.extent_auth_name = extent.auth_name AND usage.extent_code = extent.code JOIN scope ON usage.scope_auth_name = scope.auth_name AND usage.scope_code = scope.code WHERE object_table_name = ? AND object_auth_name = ? AND object_code = ? ORDER BY score, usage.auth_name, usage.code: no such table: usage
 
During handling of the above exception, another exception occurred:
 
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/vincentsarago/Workspace/venv/py38/lib/python3.8/site-packages/rasterio/crs.py", line 333, in from_epsg
    obj._crs = _CRS.from_epsg(code)
  File "rasterio/_crs.pyx", line 280, in rasterio._crs._CRS.from_epsg
rasterio.errors.CRSError: The EPSG code is unknown. PROJ: proj_create_from_database: cannot build geodeticCRS 4326: SQLite error on SELECT extent.description, extent.south_lat, extent.north_lat, extent.west_lon, extent.east_lon, scope.scope, (CASE WHEN scope.scope LIKE '%large scale%' THEN 0 ELSE 1 END) AS score FROM usage JOIN extent ON usage.extent_auth_name = extent.auth_name AND usage.extent_code = extent.code JOIN scope ON usage.scope_auth_name = scope.auth_name AND usage.scope_code = scope.code WHERE object_table_name = ? AND object_auth_name = ? AND object_code = ? ORDER BY score, usage.auth_name, usage.code: no such table: usage

Not sure what's going on :-( 
 


Alan Snow
 

I think this is the problem: https://pyproj4.github.io/pyproj/stable/gotchas.html#internal-proj-error-sqlite-error-on-select