4

I am trying to read TIF files from HDFS with rasterio but I keep getting this error:

>>> image_uri="hdfs:///user/hadoop/<>.tif"
>>> import rasterio
>>> rasterio.open(image_uri)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/mnt/anaconda2/lib/python2.7/site-packages/rasterio/__init__.py", line 193, in open
    s.start()
  File "rasterio/_base.pyx", line 76, in rasterio._base.DatasetReader.start (rasterio/_base.c:2969)
rasterio.errors.RasterioIOError: No such file or directory

I can't find any reference to what filesystems rasterio supports, does it only support reading from a local filesystem? Does it not support HDFS?

and_apo
  • 141
  • 1
  • 3

1 Answers1

1

There is no HDFS support in Rasterio (or GDAL) now. Your best bet is to use some other library to read GeoTIFF content from HDFS and copy it to a temporary local file or to an in-memory file: https://github.com/mapbox/rasterio/blob/master/docs/topics/memory-files.rst.

sgillies
  • 9,056
  • 1
  • 33
  • 41