[GRASS-SVN] r31924 - in grass-addons/vector/v.surf.icw: .
qgis-toolbox
svn_grass at osgeo.org
svn_grass at osgeo.org
Tue Jul 1 09:13:59 EDT 2008
Author: hamish
Date: 2008-07-01 09:13:59 -0400 (Tue, 01 Jul 2008)
New Revision: 31924
Added:
grass-addons/vector/v.surf.icw/qgis-toolbox/
grass-addons/vector/v.surf.icw/qgis-toolbox/default.qgc.diff
grass-addons/vector/v.surf.icw/qgis-toolbox/v.surf.icw.1.png
grass-addons/vector/v.surf.icw/qgis-toolbox/v.surf.icw.2.png
grass-addons/vector/v.surf.icw/qgis-toolbox/v.surf.icw.qgm
Modified:
grass-addons/vector/v.surf.icw/v.surf.icw
Log:
add layer and where options, add qgis grass toolbox files
Added: grass-addons/vector/v.surf.icw/qgis-toolbox/default.qgc.diff
===================================================================
--- grass-addons/vector/v.surf.icw/qgis-toolbox/default.qgc.diff (rev 0)
+++ grass-addons/vector/v.surf.icw/qgis-toolbox/default.qgc.diff 2008-07-01 13:13:59 UTC (rev 31924)
@@ -0,0 +1,10 @@
+--- /tmp/default.qgc 2008-07-02 01:00:49.000000000 +1200
++++ default.qgc 2008-07-01 20:07:45.000000000 +1200
+@@ -173,6 +173,7 @@
+ <grass name="r.surf.idw"/>
+ <grass name="r.surf.idw2"/>
+ <grass name="r.surf.contour"/>
++ <grass name="v.surf.icw"/>
+ <grass name="v.surf.idw"/>
+ <grass name="v.surf.rst"/>
+ <grass name="r.fillnulls"/>
Added: grass-addons/vector/v.surf.icw/qgis-toolbox/v.surf.icw.1.png
===================================================================
(Binary files differ)
Property changes on: grass-addons/vector/v.surf.icw/qgis-toolbox/v.surf.icw.1.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: grass-addons/vector/v.surf.icw/qgis-toolbox/v.surf.icw.2.png
===================================================================
(Binary files differ)
Property changes on: grass-addons/vector/v.surf.icw/qgis-toolbox/v.surf.icw.2.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: grass-addons/vector/v.surf.icw/qgis-toolbox/v.surf.icw.qgm
===================================================================
--- grass-addons/vector/v.surf.icw/qgis-toolbox/v.surf.icw.qgm (rev 0)
+++ grass-addons/vector/v.surf.icw/qgis-toolbox/v.surf.icw.qgm 2008-07-01 13:13:59 UTC (rev 31924)
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE qgisgrassmodule SYSTEM "http://mrcc.com/qgisgrassmodule.dtd">
+
+<qgisgrassmodule label="v.surf.icw - Interpolate attribute values (ICW)" module="v.surf.icw">
+ <option key="input" layeroption="layer" typemask="point" id="input" />
+ <field key="column" layerid="input" type="integer,double" label="Attribute field (interpolated values)" />
+ <option key="output" />
+ <option key="cost_map" />
+ <option key="where" />
+ <option key="post_mask" />
+ <option key="friction" />
+ <flag key="r" />
+</qgisgrassmodule>
Modified: grass-addons/vector/v.surf.icw/v.surf.icw
===================================================================
--- grass-addons/vector/v.surf.icw/v.surf.icw 2008-07-01 12:28:10 UTC (rev 31923)
+++ grass-addons/vector/v.surf.icw/v.surf.icw 2008-07-01 13:13:59 UTC (rev 31924)
@@ -47,33 +47,26 @@
#% required : yes
#%end
#%option
-#% key: output
+#% key: column
#% type: string
-#% gisprompt: new,cell,raster
-#% description: Name of new raster file to be used for output
+#% description: Column name in points map that contains data values
#% required : yes
#%end
#%option
-#% key: column
+#% key: output
#% type: string
-#% description: Column name in vector points map that contains data values
+#% gisprompt: new,cell,raster
+#% description: Name for output raster map
#% required : yes
#%end
#%option
#% key: cost_map
#% type: string
#% gisprompt: old,cell,raster
-#% description: Name of existing raster file containing cost information
+#% description: Name of existing raster map containing cost information
#% required : yes
#%end
#%option
-#% key: post_mask
-#% type: string
-#% gisprompt: old,cell,raster
-#% description: Name of existing raster file to be used as post-processing MASK
-#% required : no
-#%end
-#%option
#% key: friction
#% type: integer
#% description: Friction of distance, (the 'n' in 1/d^n)
@@ -81,6 +74,27 @@
#% options: 1-6
#% required : no
#%end
+#%option
+#% key: layer
+#% type: integer
+#% answer: 1
+#% description: Layer number of data in points map
+#% required: no
+#%end
+#%option
+#% key: where
+#% type: string
+#% label: WHERE conditions of SQL query statement without 'where' keyword
+#% description: Example: income < 1000 and inhab >= 10000
+#% required : no
+#%end
+#%option
+#% key: post_mask
+#% type: string
+#% gisprompt: old,cell,raster
+#% description: Name of existing raster map to be used as post-processing MASK
+#% required : no
+#%end
#%flag
#% key: r
#% description: Use (d^n)*log(d) instead of 1/(d^n) for radial basis function
@@ -135,12 +149,12 @@
fi
### Check that we have the column and it is the correct type
-COL_NAME=`v.info -c "$POINTS_FILE" 2> /dev/null | grep "|${GIS_OPT_COLUMN}$" | cut -f2 -d'|'`
+COL_NAME=`v.info -c "$POINTS_FILE" layer="$GIS_OPT_LAYER" 2> /dev/null | grep "|${GIS_OPT_COLUMN}$" | cut -f2 -d'|'`
if [ -z "$COL_NAME" ] ; then
echo "Data column [$GIS_OPT_COLUMN] not found in [$POINTS_FILE]." 1>&2
exit
fi
-COL_TYPE=`v.info -c "$POINTS_FILE" 2> /dev/null | grep "|${GIS_OPT_COLUMN}$" | cut -f1 -d'|'`
+COL_TYPE=`v.info -c "$POINTS_FILE" layer="$GIS_OPT_LAYER" 2> /dev/null | grep "|${GIS_OPT_COLUMN}$" | cut -f1 -d'|'`
if [ "$COL_TYPE" != "DOUBLE PRECISION" ] && [ "$COL_TYPE" != "INTEGER" ] ; then
echo "Data column [$COL_NAME] must be numeric." 1>&2
exit
@@ -161,9 +175,16 @@
#crop out only points in region
# GRASS 6.3+: use v.out.ascii -r ?
v.in.region output=tmp_icw_region_$$ > /dev/null
-v.select ainput="$POINTS_FILE" binput=tmp_icw_region_$$ \
- atype=point btype=area output=tmp_icw_points_$$
+v.select ainput="$POINTS_FILE" alayer="$GIS_OPT_LAYER" atype=point \
+ binput=tmp_icw_region_$$ btype=area output=tmp_icw_points_sel_$$
+if [ -n "$GIS_OPT_WHERE" ] ; then
+ v.extract in=tmp_icw_points_sel_$$ layer="$GIS_OPT_LAYER" \
+ where="$GIS_OPT_WHERE" out=tmp_icw_points_$$
+else
+ g.rename vect=tmp_icw_points_sel_$$,tmp_icw_points_$$
+fi
+
v.out.ascii tmp_icw_points_$$ > "$TMP_POINTS"
#db.select tmp_icw_points_$$ > "$TMP_TABLE"
@@ -321,6 +342,10 @@
if [ -n "$GIS_OPT_POST_MASK" ] ; then
r.support "$GIS_OPT_OUTPUT" history=" post-processing mask=$GIS_OPT_POST_MASK"
fi
+if [ -n "$GIS_OPT_WHERE" ] ; then
+ r.support "$GIS_OPT_OUTPUT" history=" SQL query= WHERE \"$GIS_OPT_WHERE\""
+fi
+# save layer #? to metadata? command line hist?
# 5) rm cost and cost_sq maps, tmp_icw_points, etc
@@ -335,7 +360,7 @@
g.remove rast=sum_of_1by_cost_sqs | grep REMOVE
#g.remove vect=tmp_idw_cost_site_$$
g.remove rast=tmp_icw_area_$$ | grep REMOVE
- g.remove vect=tmp_icw_region_$$,tmp_icw_points_$$
+ g.remove vect=tmp_icw_region_$$,tmp_icw_points_$$,tmp_icw_points_sel_$$
rm -f "$TMP_POINTS"
}
More information about the grass-commit
mailing list