[GRASSLIST:9884] v.surf.idw batch processing

Luigi Ponti lponti at infinito.it
Tue Jan 17 17:53:28 EST 2006


Hello,

Would anybody have a hint on why v.surf.rst takes a 3D vector as input 
and v.surf.idw does not, so that in the latter case you have to detail 
the column of the dbf table to interpolate?

Would there be a way to just access the "z" column of the 3D vector 
(imported via v.in.ascii)? In fact, the DBF file of the 3D vector 
contains all of the column of the original ascii file and also without 
the original column names.

Thanks in advance for any help,

Luigi
[GRASS 6.0.0/cygwin]

P.S. Tried the new GIS Manager 2 in grass6.0.0/cygwin and it seems to 
work fine.


-------- Original Message --------
Subject: [GRASSLIST:9818] Re: v.surf.idw batch processing
Date: Fri, 13 Jan 2006 10:31:19 -0800
From: Luigi Ponti <lponti at infinito.it>
To: Michaela Kinberger <kinb at atlas.gis.univie.ac.at>
CC: GRASSLIST at baylor.edu
References: <43C702C1.8070806 at infinito.it> 
<43C75A11.5030604 at atlas.gis.univie.ac.at>

Dear Michaela,

Thanks! Nothing really goes wrong.

My code looks similar to yours:

---------------------------------------------------------------------
v.in.ascii -z input=AsciiFile output=3Dvector fs='\t' x=LON y=LAT z=PAR

v.surf.idw input=3Dvector output=interpolatedRaster npoints=3 layer=1
col=dbl_5
---------------------------------------------------------------------

Since I have already selected the column in v.in.ascii by putting z=PAR
(which is an integer coming from the GRASS parser and indicating the
column of the ascii file I want to interpolate), how can I get get the
right column while batch processing with v.surf.idw based on PAR (i.e.,
an integer stored in a bash-shell variable)?

Currently I can't do it, so I have to open the attribute table of my
v.in.ascii-imported vector map and guess what is the right column name
to put in v.surf.idw (col=dbl_5 in my sample code), since the original
column names are not there anymore (as to GRASS 6.0.0, v.in.ascii does
not accept column names and I have to get rid of them via a perl script).

In contrast, when using v.surf.rst there is no column specification, you
just have the imported vector map as input parameter and that's it. That
is, v.surf.rst figures out what to interpolate: obviously the z column,
since the input it's a 3D vector map. However, v.surf.idw needs the
attribute table column as an additional input.

Have you figured out a way to automate this step?

What is col=dbl_310.8606 47.3936 4000 100.6? It looks like a row not a
column of you data sample.

Ciao and thanks again for any hint,

Luigi



Michaela Kinberger wrote:
> dear luigi,
> 
> i´am also using v.surf.idw (grass6.0.1 suse rpms, and OSX) in batch 
> mode. everything works fine.
> 
> some lines of my code:
> 
> v.in.ascii -z input=file2.txt output=werte_red z=3 fs=' '
> v.surf.idw input=werte_red output=surf_red col=dbl_310.8606 47.3936 4000 
> 100.6
> 
> this is what the input looks like:
> 
>    x y z value
>    10.7809 47.5606 4000 128.2
>    11.0068 47.4074 4000 99
>    11.0618 47.4352 4000 135
>    11.3792 47.3069 4000 147.48
>    11.7633 47.4425 4000 139.04
>    11.8919 47.6629 4000 173
>    12.3516 47.7543 4000 174
> 
> what goes wrong in your script? is there any error message?
> 
> lg
> michaela
> 
> 
> 
> 
> Luigi Ponti wrote:
> 
>> Hello,
>>
>> I am trying to use v.surf.idw instead of v.surf.rst because it seems 
>> to suite better my 105 unequally spaced weather stations in California 
>> in terms of interpolated raster: the range of the data is respected 
>> and there is no issue of tension and smoothing.
>>
>> I wrote a script to batch-process a series of tables containing 
>> geo-referenced data that I import via v.in.ascii for subsequent 
>> interpolation.
>>
>> Whith v.surf.rst the imported vector with data points is the only 
>> input and the appropriate attribute column has already been selected 
>> while importing via v.in.ascii by putting the correct column number=z.
>>
>> However, whith v.surf.idw, in addition to the input vector, there is 
>> also a "col" string parameter which selects an attribute table column. 
>> So far, I have to open the DBF attribute table (where there are not 
>> just 3 columns) and figure out a weird column name such as "dbl_4" 
>> that matches the column I want to interpolate (that I have already 
>> chosen when importing with v.in.ascii).
>>
>> Why v.surf.rst can access the right column without any other 
>> specification and v.surf.idw cannot? Is there a fix for batch processing?
>>
>> Thanks,
>>
>> Luigi
>>
>>
>>
> 





More information about the grass-user mailing list