[GRASS-user] importing missing values via v.in.ascii for subsequent interpolation

Dylan Beaudette dylan.beaudette at gmail.com
Tue Nov 14 22:32:35 EST 2006


On Tuesday 14 November 2006 18:40, Luigi Ponti wrote:
> Hello,
>
> I am trying to import ASCII files with v.in.ascii for subsequent
> interpolation via v.surf.idw. The problem is that if I put NULL for
> missing values, v.in.ascii complains about the column being of type
> DOUBLE and fails. On the other hand if I put missing values as just '',
> as suggested at
> http://www.intevation.de/rt/webrt?serial_num=2763&display=History
> then v.surf.rst seems to use those missing values as ZERO values in
> computing the weighted average.
>
> I tried with something like
>
> 	v.db.update map=myMap column=myColumn value="NULL" \
> 		where=myColumn=''
>
> But it did not work.
>
> Does anybody have a way around this?
>
> Regards,
>
> Luigi
>

hi.

how about this:

1. change any nodata values in your input file to an empty string 
2. v.in.ascii in=infile sep=sep ... out=outvect
3. double check that the nodata values were imported correctly, i.e missing 
from the attribute table
4. v.extract in=outvect where="column = ..." out=vect_no_null
5. v.surf.idw vect_no_null

note that depending on the DB backend you are using, you may need to tweak the 
above. another approach might be to code your nodata values as -9999999 or 
something like that, and then use that to select only features with 'real' 
data.

cheers,



-- 
Dylan Beaudette
Soils and Biogeochemistry Graduate Group
University of California at Davis
530.754.7341




More information about the grass-user mailing list