[GRASS-user] SQL statement as input for v.surf.rst

Markus Neteler neteler at itc.it
Fri Jun 1 05:23:17 EDT 2007


On Thu, May 31, 2007 at 11:26:34AM +0200, Ulrich Leopold wrote:
> Dear all,
> 
> how would I use an SQL statement correctly as shown in the following command:
> 
> v.surf.rst input="|SELECT precipitation FROM meteo_stations \
>                  WHERE date='2005-10-01'" zcolumn=elevation \
>                  output=prcp_2007-10-01
> 
> Best regards,

Ulrich,

since I am also interested in this, I have now implemented SQL support
in v.surf.rst (GRASS 6.3-CVS):

Spearfish example (we simulate randomly distributed elevation measures):

g.region rast=elevation.10m -p
# random elevation extraction
r.random elevation.10m vector_output=elevrand n=200
v.info -c elevrand
v.db.select elevrand

# interpolation based on all points
v.surf.rst elevrand zcol=value elev=elev_full
r.colors elev_full rast=elevation.10m
d.rast elev_full
d.vect elevrand

# interpolation based on subset of points (only those over 1300m/asl)
v.surf.rst elevrand zcol=value elev=elev_partial where="value > 1300"
r.colors elev_partial rast=elevation.10m
d.rast elev_partial
d.vect elevrand where="value > 1300"

Enjoy,
Markus

-- 
Markus Neteler  <neteler itc it>  http://mpa.itc.it/markus/
FBK-irst -  Centro per la Ricerca Scientifica e Tecnologica
MPBA - Predictive Models for Biol. & Environ. Data Analysis
Via Sommarive, 18        -       38050 Povo (Trento), Italy




More information about the grass-user mailing list