Hi all,
The 1.0.3 wheels I built for OSX and uploaded to PyPI included a GDAL library with no curl support. I've made a post-release that fixes this problem. If you installed one of these wheels, please `pip install -U pip` to get 1.0.3.post1.
|
|
Hi Sean! After updating rasterio I get the following error:
In [1]: from rasterio import open
In [2]: open('tests/data/raster/rgb.jp2')
---------------------------------------------------------------------------
CPLE_OpenFailedError Traceback (most recent call last)
rasterio/_base.pyx in rasterio._base.DatasetBase.__init__()
rasterio/_shim.pyx in rasterio._shim.open_dataset()
rasterio/_err.pyx in rasterio._err.exc_wrap_pointer()
CPLE_OpenFailedError: 'tests/data/raster/rgb.jp2' not recognized as a supported file format.
During handling of the above exception, another exception occurred:
RasterioIOError Traceback (most recent call last)
<ipython-input-2-19e7b16f33e4> in <module>()
----> 1 open('tests/data/raster/rgb.jp2')
~/sandbox/telluric/env/lib/python3.5/site-packages/rasterio/env.py in wrapper(*args, **kwds)
401 else:
402 pass
--> 403 return f(*args, **kwds)
404
405 return wrapper
~/sandbox/telluric/env/lib/python3.5/site-packages/rasterio/__init__.py in open(fp, mode, driver, width, height, count, crs, transform, dtype, nodata, sharing, **kwargs)
215 # None.
216 if mode == 'r':
--> 217 s = DatasetReader(path, driver=driver, **kwargs)
218 elif mode == 'r+':
219 s = get_writer_for_path(path)(path, mode, driver=driver, **kwargs)
rasterio/_base.pyx in rasterio._base.DatasetBase.__init__()
RasterioIOError: 'tests/data/raster/rgb.jp2' not recognized as a supported file format.
All works without any problems with rasterio 1.0.2:
In [1]: from rasterio import open
In [2]: open('tests/data/raster/rgb.jp2')
Out[2]: <open DatasetReader name='tests/data/raster/rgb.jp2' mode='r'>
|
|
Thanks for the report, Denis. I had upgraded GDAL to 2.3.1 in these wheel builds, and was blaming my inability to access these jp2 files on a lack of credentials, but maybe something has changed between Rasterio and JP2 in 2.3.0? I'm going to revert to 2.2.4, the version in the 1.0.2 wheels.
toggle quoted message
Show quoted text
On Mon, Sep 10, 2018 at 7:10 AM Denis Rykov < rykovd@...> wrote: Hi Sean!
After updating rasterio I get the following error:
In [1]: from rasterio import open
In [2]: open('tests/data/raster/rgb.jp2')
---------------------------------------------------------------------------
CPLE_OpenFailedError Traceback (most recent call last)
rasterio/_base.pyx in rasterio._base.DatasetBase.__init__()
rasterio/_shim.pyx in rasterio._shim.open_dataset()
rasterio/_err.pyx in rasterio._err.exc_wrap_pointer()
CPLE_OpenFailedError: 'tests/data/raster/rgb.jp2' not recognized as a supported file format.
During handling of the above exception, another exception occurred:
RasterioIOError Traceback (most recent call last)
<ipython-input-2-19e7b16f33e4> in <module>()
----> 1 open('tests/data/raster/rgb.jp2')
~/sandbox/telluric/env/lib/python3.5/site-packages/rasterio/env.py in wrapper(*args, **kwds)
401 else:
402 pass
--> 403 return f(*args, **kwds)
404
405 return wrapper
~/sandbox/telluric/env/lib/python3.5/site-packages/rasterio/__init__.py in open(fp, mode, driver, width, height, count, crs, transform, dtype, nodata, sharing, **kwargs)
215 # None.
216 if mode == 'r':
--> 217 s = DatasetReader(path, driver=driver, **kwargs)
218 elif mode == 'r+':
219 s = get_writer_for_path(path)(path, mode, driver=driver, **kwargs)
rasterio/_base.pyx in rasterio._base.DatasetBase.__init__()
RasterioIOError: 'tests/data/raster/rgb.jp2' not recognized as a supported file format.
All works without any problems with rasterio 1.0.2:
In [1]: from rasterio import open
In [2]: open('tests/data/raster/rgb.jp2')
Out[2]: <open DatasetReader name='tests/data/raster/rgb.jp2' mode='r'>
|
|
On lundi 10 septembre 2018 14:29:39 CEST Sean Gillies wrote: Thanks for the report, Denis. I had upgraded GDAL to 2.3.1 in these wheel builds, and was blaming my inability to access these jp2 files on a lack of credentials, but maybe something has changed between Rasterio and JP2 in 2.3.0? I'm going to revert to 2.2.4, the version in the 1.0.2 wheels. Sean, Your wheels use openjpeg for GDAL JPEG2000 capability, right ? There has been a change in GDAL ./configure in 2.3.0 related to openjpeg detection. It now requires pkg-config to be available to detect openjpeg. Even -- Spatialys - Geospatial professional services http://www.spatialys.com
|
|
Even,
Thanks for the pointer!
In configuring my GDAL 2.3.1 builds, pkg-config and openjpeg were found: checking for pkg-config... (cached) /usr/local/bin/pkg-config checking pkg-config is at least version 0.25... yes checking for OPENJPEG... yes checking for opj_setup_decoder in -lopenjp2... yes
(full logs here:
and I'm able to open GDAL's jp2 test files with the 1.0.3.post1 wheel (for python 3.6 and OSX).
Denis, I think your issue is different than the one I've reported here. What's your operating system and did you install from the sdist or install a binary wheel?
On lundi 10 septembre 2018 14:29:39 CEST Sean Gillies wrote:
> Thanks for the report, Denis. I had upgraded GDAL to 2.3.1 in these wheel
> builds, and was blaming my inability to access these jp2 files on a lack of
> credentials, but maybe something has changed between Rasterio and JP2 in
> 2.3.0? I'm going to revert to 2.2.4, the version in the 1.0.2 wheels.
Sean,
Your wheels use openjpeg for GDAL JPEG2000 capability, right ? There has been
a change in GDAL ./configure in 2.3.0 related to openjpeg detection. It now
requires pkg-config to be available to detect openjpeg.
Even
-- Sean Gillies
|
|
OS: Ubuntu 16.04.5 Wheel: rasterio-1.0.3.post1-cp35-cp35m-manylinux1_x86_64.whl Full example:
$ pip install -U rasterio
Collecting rasterio
Using cached https://files.pythonhosted.org/packages/48/9c/ed4e2b5b3150ee39052bf580de0e67c8c2e5b58eb89833a174c8e8694d5f/rasterio-1.0.3.post1-cp35-cp35m-manylinux1_x86_64.whl
Requirement already satisfied, skipping upgrade: attrs in ./env/lib/python3.5/site-packages (from rasterio) (17.4.0)
Requirement already satisfied, skipping upgrade: click-plugins in ./env/lib/python3.5/site-packages (from rasterio) (1.0.3)
Requirement already satisfied, skipping upgrade: snuggs>=1.4.1 in ./env/lib/python3.5/site-packages (from rasterio) (1.4.1)
Requirement already satisfied, skipping upgrade: cligj in ./env/lib/python3.5/site-packages (from rasterio) (0.4.0)
Requirement already satisfied, skipping upgrade: affine in ./env/lib/python3.5/site-packages (from rasterio) (2.2.0)
Requirement already satisfied, skipping upgrade: numpy in ./env/lib/python3.5/site-packages (from rasterio) (1.14.2)
Requirement already satisfied, skipping upgrade: click>=3.0 in ./env/lib/python3.5/site-packages (from click-plugins->rasterio) (6.7)
Requirement already satisfied, skipping upgrade: pyparsing in ./env/lib/python3.5/site-packages (from snuggs>=1.4.1->rasterio) (2.2.0)
Installing collected packages: rasterio
Found existing installation: rasterio 1.0.2
Uninstalling rasterio-1.0.2:
Successfully uninstalled rasterio-1.0.2
Successfully installed rasterio-1.0.3.post1
$ python -c 'from rasterio import open; open("tests/data/raster/rgb.jp2")'
Traceback (most recent call last):
File "rasterio/_base.pyx", line 199, in rasterio._base.DatasetBase.__init__
File "rasterio/_shim.pyx", line 64, in rasterio._shim.open_dataset
File "rasterio/_err.pyx", line 188, in rasterio._err.exc_wrap_pointer
rasterio._err.CPLE_OpenFailedError: 'tests/data/raster/rgb.jp2' not recognized as a supported file format.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/rykov/sandbox/telluric/env/lib/python3.5/site-packages/rasterio/env.py", line 403, in wrapper
return f(*args, **kwds)
File "/home/rykov/sandbox/telluric/env/lib/python3.5/site-packages/rasterio/__init__.py", line 217, in open
s = DatasetReader(path, driver=driver, **kwargs)
File "rasterio/_base.pyx", line 201, in rasterio._base.DatasetBase.__init__
rasterio.errors.RasterioIOError: 'tests/data/raster/rgb.jp2' not recognized as a supported file format.
$ gdalinfo tests/data/raster/rgb.jp2
Driver: JP2OpenJPEG/JPEG-2000 driver based on OpenJPEG library
Files: tests/data/raster/rgb.jp2
Size is 100, 100
Coordinate System is:
PROJCS["WGS 84 / Pseudo-Mercator",
GEOGCS["WGS 84",
DATUM["WGS_1984",
SPHEROID["WGS 84",6378137,298.257223563,
AUTHORITY["EPSG","7030"]],
AUTHORITY["EPSG","6326"]],
PRIMEM["Greenwich",0,
AUTHORITY["EPSG","8901"]],
UNIT["degree",0.0174532925199433,
AUTHORITY["EPSG","9122"]],
AUTHORITY["EPSG","4326"]],
PROJECTION["Mercator_1SP"],
PARAMETER["central_meridian",0],
PARAMETER["scale_factor",1],
PARAMETER["false_easting",0],
PARAMETER["false_northing",0],
UNIT["metre",1,
AUTHORITY["EPSG","9001"]],
AXIS["X",EAST],
AXIS["Y",NORTH],
EXTENSION["PROJ4","+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs"],
AUTHORITY["EPSG","3857"]]
Origin = (-6574807.424977720715106,-4070118.882129065692425)
Pixel Size = (76.437028285175984,-76.437028285176893)
Image Structure Metadata:
INTERLEAVE=PIXEL
Corner Coordinates:
Upper Left (-6574807.425,-4070118.882) ( 59d 3'45.00"W, 34d18'25.72"S)
Lower Left (-6574807.425,-4077762.585) ( 59d 3'45.00"W, 34d21'49.84"S)
Upper Right (-6567163.722,-4070118.882) ( 58d59'37.81"W, 34d18'25.72"S)
Lower Right (-6567163.722,-4077762.585) ( 58d59'37.81"W, 34d21'49.84"S)
Center (-6570985.574,-4073940.734) ( 59d 1'41.40"W, 34d20' 7.79"S)
Band 1 Block=100x100 Type=Byte, ColorInterp=Red
Overviews: arbitrary
Image Structure Metadata:
COMPRESSION=JPEG2000
Band 2 Block=100x100 Type=Byte, ColorInterp=Green
Overviews: arbitrary
Image Structure Metadata:
COMPRESSION=JPEG2000
Band 3 Block=100x100 Type=Byte, ColorInterp=Blue
Overviews: arbitrary
Image Structure Metadata:
COMPRESSION=JPEG2000
$ pip install rasterio==1.0.2
Collecting rasterio==1.0.2
Using cached https://files.pythonhosted.org/packages/62/0b/aa07a8a3e5cef361113e6663647d0562c170feee2cf79d70ff79910cdd73/rasterio-1.0.2-cp35-cp35m-manylinux1_x86_64.whl
Requirement already satisfied: snuggs>=1.4.1 in /home/rykov/sandbox/telluric/env/lib/python3.5/site-packages (from rasterio==1.0.2) (1.4.1)
Requirement already satisfied: click-plugins in /home/rykov/sandbox/telluric/env/lib/python3.5/site-packages (from rasterio==1.0.2) (1.0.3)
Requirement already satisfied: attrs in /home/rykov/sandbox/telluric/env/lib/python3.5/site-packages (from rasterio==1.0.2) (17.4.0)
Requirement already satisfied: affine in /home/rykov/sandbox/telluric/env/lib/python3.5/site-packages (from rasterio==1.0.2) (2.2.0)
Requirement already satisfied: cligj in /home/rykov/sandbox/telluric/env/lib/python3.5/site-packages (from rasterio==1.0.2) (0.4.0)
Requirement already satisfied: numpy in /home/rykov/sandbox/telluric/env/lib/python3.5/site-packages (from rasterio==1.0.2) (1.14.2)
Requirement already satisfied: pyparsing in /home/rykov/sandbox/telluric/env/lib/python3.5/site-packages (from snuggs>=1.4.1->rasterio==1.0.2) (2.2.0)
Requirement already satisfied: click in /home/rykov/sandbox/telluric/env/lib/python3.5/site-packages (from snuggs>=1.4.1->rasterio==1.0.2) (6.7)
Installing collected packages: rasterio
Found existing installation: rasterio 1.0.3.post1
Uninstalling rasterio-1.0.3.post1:
Successfully uninstalled rasterio-1.0.3.post1
Successfully installed rasterio-1.0.2
$ python -c 'from rasterio import open; open("tests/data/raster/rgb.jp2")'
$
|
|
Hi Denis,
I discovered that I had to patch GDAL 2.3.1 to build with OpenJPEG for the ancient manylinux1 platform. I've uploaded new wheels with a "-1" build tag to https://pypi.org/manage/project/rasterio/release/1.0.3.post1/. I didn't know about build tags – I won't make post-releases to fix wheel build problems anymore.
toggle quoted message
Show quoted text
On Mon, Sep 10, 2018 at 1:10 AM Denis Rykov < rykovd@...> wrote: Hi Sean!
After updating rasterio I get the following error:
In [1]: from rasterio import open
In [2]: open('tests/data/raster/rgb.jp2')
---------------------------------------------------------------------------
CPLE_OpenFailedError Traceback (most recent call last)
rasterio/_base.pyx in rasterio._base.DatasetBase.__init__()
rasterio/_shim.pyx in rasterio._shim.open_dataset()
rasterio/_err.pyx in rasterio._err.exc_wrap_pointer()
CPLE_OpenFailedError: 'tests/data/raster/rgb.jp2' not recognized as a supported file format.
During handling of the above exception, another exception occurred:
RasterioIOError Traceback (most recent call last)
<ipython-input-2-19e7b16f33e4> in <module>()
----> 1 open('tests/data/raster/rgb.jp2')
~/sandbox/telluric/env/lib/python3.5/site-packages/rasterio/env.py in wrapper(*args, **kwds)
401 else:
402 pass
--> 403 return f(*args, **kwds)
404
405 return wrapper
~/sandbox/telluric/env/lib/python3.5/site-packages/rasterio/__init__.py in open(fp, mode, driver, width, height, count, crs, transform, dtype, nodata, sharing, **kwargs)
215 # None.
216 if mode == 'r':
--> 217 s = DatasetReader(path, driver=driver, **kwargs)
218 elif mode == 'r+':
219 s = get_writer_for_path(path)(path, mode, driver=driver, **kwargs)
rasterio/_base.pyx in rasterio._base.DatasetBase.__init__()
RasterioIOError: 'tests/data/raster/rgb.jp2' not recognized as a supported file format.
All works without any problems with rasterio 1.0.2:
In [1]: from rasterio import open
In [2]: open('tests/data/raster/rgb.jp2')
Out[2]: <open DatasetReader name='tests/data/raster/rgb.jp2' mode='r'>
|
|
Thank you very much, Sean!
|
|