0

I am trying to open a raster file that I have downloaded using rasterio. It is a satellite image raster file of part of UBC in my data folder which I downloaded from Abacus Data Network. the However, I get a feedback that access was denied. Here is my code and the error message.

import rasterio

dataset = rasterio.open("\\Users\\PERSONAL\\Desktop\\GIS\\Canada_Data\\481E_5456N")
CPLE_OpenFailedError                      Traceback (most recent call last)
File rasterio\_base.pyx:310, in rasterio._base.DatasetBase.__init__()
File rasterio\_base.pyx:221, in rasterio._base.open_dataset()
File rasterio\_err.pyx:221, in rasterio._err.exc_wrap_pointer()
CPLE_OpenFailedError: \Users\PERSONAL\Desktop\GIS\Canada_Data\481E_5456N: Permission denied

This was the final error message:

RasterioIOError: \Users\PERSONAL\Desktop\GIS\Canada_Data\481E_5456N: Permission denied
0

1 Answer 1

3

I can't reproduce. I downloaded the data from 481E_5456N.zip, extracted it and ran your code with the path adjusted accordingly.

dataset = rasterio.open("481E_5456N/481E_5456N.tif")
print(dataset.meta)

Output:

{'driver': 'GTiff', 'dtype': 'uint8', 'nodata': None, 'width': 10000, 'height': 10000, 'count': 4, 'crs': None, 'transform': Affine(0.1, 0.0, 481000.0, 0.0, -0.1, 5457000.0)}

I note you don't have a .tif extension on your path. You may have tried to open the folder not the geotiff.

You may also need to check your path.

  • If you are trying to use a UNC path like \\server\share\folder then you either need to use:

    • a double double backslash at the start "\\\\Users\\PERSONAL\\Desktop\\GIS\\Canada_Data\\481E_5456N\\481E_5456N.tif",
    • or use a raw string r"\\Users\PERSONAL\Desktop\GIS\Canada_Data\481E_5456N\481E_5456N.tif"
  • Or perhaps you are missing a drive letter? In that case you should use:

    • r"C:\Users\PERSONAL\Desktop\GIS\Canada_Data\481E_5456N\481E_5456N.tif"

Not the answer you're looking for? Browse other questions tagged or ask your own question.