Topics

Problem with AAIGrid overwrite


Amine Aboufirass <amine.aboufirass@...>
 

Dear All,

For one project I am reading and writing these test raster datasets as ASCII grids. I have found that overwriting these grids is impossible and I get the following error:

ERROR 1: Deleting test_data/out.asc failed:
Permission denied

This is quite annoying because for my testing I need to overwrite and delete files repeatedly. I have to keep deleting them again before I run my application each time and this is quite time consuming.

I have the impression this is related to the GDAL creation options but I am not sure. Could someone please enlighten me? Thanks.

Regards,

Amine


Sean Gillies
 

Amine,

I'm unable to reproduce this with rasterio 1.1.0. The following script can be executed over and over again and the shade.asc file is overwritten with no error and no messages.

import rasterio

with rasterio.open("/Users/seang/code/rasterio/tests/data/shade.tif") as tif:
    profile = tif.profile
    profile["driver"] = "AAIGrid"
    with rasterio.open("/tmp/shade.asc", "w", **profile) as asc:
        asc.write(tif.read())

It might actually be a permissions issue on your computer.


On Fri, Nov 29, 2019 at 7:38 AM Amine Aboufirass <amine.aboufirass@...> wrote:
Dear All,

For one project I am reading and writing these test raster datasets as ASCII grids. I have found that overwriting these grids is impossible and I get the following error:

ERROR 1: Deleting test_data/out.asc failed:
Permission denied

This is quite annoying because for my testing I need to overwrite and delete files repeatedly. I have to keep deleting them again before I run my application each time and this is quite time consuming.

I have the impression this is related to the GDAL creation options but I am not sure. Could someone please enlighten me? Thanks.

Regards,

Amine



--
Sean Gillies


Amine Aboufirass <amine.aboufirass@...>
 

Dear Sean,

I tried your example under an administrator command prompt and I got no problems. So I then tried running my own example under the same prompt and got the error again. 

I have attached a zip file which contains my example. Would you care to take a look? I really can't pinpoint why this behavior occurs.

Thanks in advance for your help,

Regards,

Amine

On Fri, Nov 29, 2019 at 8:14 PM Sean Gillies <sean.gillies@...> wrote:
Amine,

I'm unable to reproduce this with rasterio 1.1.0. The following script can be executed over and over again and the shade.asc file is overwritten with no error and no messages.

import rasterio

with rasterio.open("/Users/seang/code/rasterio/tests/data/shade.tif") as tif:
    profile = tif.profile
    profile["driver"] = "AAIGrid"
    with rasterio.open("/tmp/shade.asc", "w", **profile) as asc:
        asc.write(tif.read())

It might actually be a permissions issue on your computer.


On Fri, Nov 29, 2019 at 7:38 AM Amine Aboufirass <amine.aboufirass@...> wrote:
Dear All,

For one project I am reading and writing these test raster datasets as ASCII grids. I have found that overwriting these grids is impossible and I get the following error:

ERROR 1: Deleting test_data/out.asc failed:
Permission denied

This is quite annoying because for my testing I need to overwrite and delete files repeatedly. I have to keep deleting them again before I run my application each time and this is quite time consuming.

I have the impression this is related to the GDAL creation options but I am not sure. Could someone please enlighten me? Thanks.

Regards,

Amine



--
Sean Gillies


Amine Aboufirass <amine.aboufirass@...>
 

The strange thing is that it actually updates the file but still throws the error. 

On Mon, Dec 2, 2019 at 11:17 AM Amine Aboufirass via Groups.Io <amine.aboufirass=gmail.com@groups.io> wrote:
Dear Sean,

I tried your example under an administrator command prompt and I got no problems. So I then tried running my own example under the same prompt and got the error again. 

I have attached a zip file which contains my example. Would you care to take a look? I really can't pinpoint why this behavior occurs.

Thanks in advance for your help,

Regards,

Amine

On Fri, Nov 29, 2019 at 8:14 PM Sean Gillies <sean.gillies@...> wrote:
Amine,

I'm unable to reproduce this with rasterio 1.1.0. The following script can be executed over and over again and the shade.asc file is overwritten with no error and no messages.

import rasterio

with rasterio.open("/Users/seang/code/rasterio/tests/data/shade.tif") as tif:
    profile = tif.profile
    profile["driver"] = "AAIGrid"
    with rasterio.open("/tmp/shade.asc", "w", **profile) as asc:
        asc.write(tif.read())

It might actually be a permissions issue on your computer.


On Fri, Nov 29, 2019 at 7:38 AM Amine Aboufirass <amine.aboufirass@...> wrote:
Dear All,

For one project I am reading and writing these test raster datasets as ASCII grids. I have found that overwriting these grids is impossible and I get the following error:

ERROR 1: Deleting test_data/out.asc failed:
Permission denied

This is quite annoying because for my testing I need to overwrite and delete files repeatedly. I have to keep deleting them again before I run my application each time and this is quite time consuming.

I have the impression this is related to the GDAL creation options but I am not sure. Could someone please enlighten me? Thanks.

Regards,

Amine



--
Sean Gillies


Sean Gillies
 

I suspect the error is coming from the gdal module function, not from rasterio. If it was coming from rasterio, you'd see a log message instead.


On Mon, Dec 2, 2019 at 3:32 AM Amine Aboufirass <amine.aboufirass@...> wrote:
The strange thing is that it actually updates the file but still throws the error. 

On Mon, Dec 2, 2019 at 11:17 AM Amine Aboufirass via Groups.Io <amine.aboufirass=gmail.com@groups.io> wrote:
Dear Sean,

I tried your example under an administrator command prompt and I got no problems. So I then tried running my own example under the same prompt and got the error again. 

I have attached a zip file which contains my example. Would you care to take a look? I really can't pinpoint why this behavior occurs.

Thanks in advance for your help,

Regards,

Amine
 
...

--
Sean Gillies