[GRASS-user] windows format for temporary file path

Richard Edmonds richard.edmonds at lasra.co.nz
Thu Mar 15 16:20:14 EDT 2012


On 16/03/2012 3:13 a.m., Glynn Clements wrote:

> It's possible that it's being used where it isn't appropriate
> (i.e. where an absolute path is appropriate), but it's also possible
> that you're passing an absolute path where a simple filename (or even
> a map name) is actually required.
>

Ah that makes sense,
I was trying to use it to generate, then remove a temporary layer for 
use in the v.to.rast command. Apologies for not posting the command 
which generated the error.

I have changed my bash script with the following which now generates 
only a name rather than a path and at least now the v.to.rast command runs.

temp1="$$1"
v.to.rast --overwrite input=$GIS_OPT_INPUT output=$temp1 use=attr 
column=elevation

However I still get that error when I try to remove the layer/file. I 
had inferred from the g.remove man page that:

g.remove rast=$temp1

would remove the raster layer $temp1 but instead i get the error:
Removing raster <39281>
raster: couldn't be removed

trying it with:

g.remove rast=`g.tempfile pid=$$1`

generates the error I described originally but does look closer to 
actually removing the layer:

Removing raster <E:\GRASSdata/newLocation/PERMANENT/.tmp/35001.0>
Illegal filename. Character </> not allowed.
Raster map <E:\GRASSdata/newLocation/PERMANENT/.tmp/35001.0> not found
Illegal filename. Character </> not allowed.
raster: couldn't be removed
Illegal filename. Character </> not allowed.
header: couldn't be removed
Illegal filename. Character </> not allowed.
category: couldn't be removed
Illegal filename. Character </> not allowed.
color: couldn't be removed
Illegal filename. Character </> not allowed.
history: couldn't be removed
Illegal filename. Character </> not allowed.
misc: couldn't be removed
Illegal filename. Character </> not allowed.
fcell: couldn't be removed
Illegal filename. Character </> not allowed.
g3dcell: couldn't be removed
Illegal filename. Character </> not allowed.
colr2/PERMANENT: couldn't be removed
<E:\GRASSdata/newLocation/PERMANENT/.tmp/35001.0> nothing removed

Sorry the error dump is so long, but I'm having real trouble dealing 
with these pesky temporary layers.

Hopefully if I get this sorted then a search for "create and remove 
temporary layers in bash for GRASS GIS" will turn up a working solution 
which I couldn't find previously. Perhaps I should start a new thread?

Richard


More information about the grass-user mailing list