[GRASS-dev] r.surf.nnbathy + v.out.ascii?
Hamish
hamish_nospam at yahoo.com
Fri Dec 15 02:50:27 EST 2006
Hi,
I've added a new -r flag and fs= option to v.out.ascii in CVS which may
make it more appropriate than having to run v.to.rast first to make a
raster grid.
beware the -r flag (only export within current region) is 3D aware, so
top and bottom region settings matter.
I thought I remembered something about the input to nnbathy input
needing to be sorted by Y value. Is this true? Does it have to be
gridded or can in be randomly spaced?
r.surf.nnbaty additions:
#%option
#% key: vect
#% type: string
#% gisprompt: old,vector,vector
#% description: The 3D points vector to interpolate
#% required : no
#%END
...
INPUT_R="$GIS_OPT_INPUT"
INPUT_V="$GIS_OPT_VECT"
OUTPUT="$GIS_OPT_OUTPUT"
if [ -n "$INPUT_R" ] && [ -n "$INPUT_V" ] ; then
echo "Please pick a single input map." 1>&2
exit 1
fi
if [ -z "$INPUT_R" ] && [ -z "$INPUT_V" ] ; then
echo "Please pick a single input map." 1>&2
exit 1
fi
...
if [ -n $INPUT_R ] ; then
# spit out non-null (-n) raster coords + values to be interpolated
echo "Exporting data ..." 1>&2
r.out.xyz fs=space input="${INPUT_R}" > $TMP.${PROG}.input_xyz
else
# check region top & bottom aren't culling any!
eval `g.region -g3`
eval `v.info -g "${INPUT_V}"`
# check somehow
v.out.ascii -r in="${INPUT_V}" fs=space > $TMP.${PROG}.input_xyz
# sort by Y values? | sort -k2 -t'|'
fi
Hamish
More information about the grass-dev
mailing list