First of all, I am new to python and rasterio. I am trying to open a simple raster with 5 bands using the rasterio module in python. This is what I am trying to achieve:
import rasterio
with rasterio.open('/Users/martinsiklar/Downloads/LC81330242015176LGN00/baikal_subset.tif') as src:
print(src.width, src.height)
print(src.count)
print(src.indexes)
print(src.dtypes)
print(src.crs)
print(src.transform)
Unfortunately I am getting the following Error and I can't really figure out what's wrong. Google didn't help either:
Traceback (most recent call last): File "/Users/martinsiklar/Martin/Python/arcpy/arcpy101", line 3, in with rasterio.open('/Users/martinsiklar/Downloads/LC81330242015176LGN00/baikal_subset.tif') as src: File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/rasterio/init.py", line 105, in open from rasterio._io import RasterReader File "init.pxd", line 155, in init rasterio._io (rasterio/_io.c:49668)
ValueError: numpy.dtype has the wrong size, try recompiling
Process finished with exit code 1
When I take a look into my modules, rasterio seems to be installed properly (as far as I can tell.) The path of the .tif is also correct. I have numpy 1.8 installed.
python -c "import numpy; print numpy.__version__"
print out?numpy >= 1.8.0
. What version of rasterio and GDAL are you using?