[GRASS-SVN] r34493 - grass/branches/develbranch_6/scripts/v.in.wfs

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Nov 26 03:17:35 EST 2008


Author: neteler
Date: 2008-11-26 03:17:34 -0500 (Wed, 26 Nov 2008)
New Revision: 34493

Modified:
   grass/branches/develbranch_6/scripts/v.in.wfs/v.in.wfs
Log:
fix broken xerces-c test; use curl instead of lynx; fix cleanup; add cmd history

Modified: grass/branches/develbranch_6/scripts/v.in.wfs/v.in.wfs
===================================================================
--- grass/branches/develbranch_6/scripts/v.in.wfs/v.in.wfs	2008-11-26 06:57:07 UTC (rev 34492)
+++ grass/branches/develbranch_6/scripts/v.in.wfs/v.in.wfs	2008-11-26 08:17:34 UTC (rev 34493)
@@ -6,7 +6,7 @@
 # AUTHOR(S):	Markus Neteler. neteler itc it
 #               Hamish Bowman (fixes)
 # PURPOSE:	WFS support
-# COPYRIGHT:	(C) 2006, 2007 Markus Neteler and GRASS Development Team
+# COPYRIGHT:	(C) 2006-2008 Markus Neteler and GRASS Development Team
 #
 #		This program is free software under the GNU General Public
 #		License (>=v2). Read the file COPYING that comes with GRASS
@@ -37,20 +37,27 @@
     exit 1
 fi
 
+# save command line
 if [ "$1" != "@ARGS_PARSED@" ] ; then
+    CMDLINE="`basename $0`"
+    for arg in "$@" ; do
+        CMDLINE="$CMDLINE \"$arg\""
+    done
+    export CMDLINE
     exec g.parser "$0" "$@"
 fi
 
 # xerces support compiled in?
 OGRINFO=`which ogrinfo`
-if [ -z "`ldd $OGRINFO | grep xerces`" ] ; then
-  g.message -e "OGR needs to be compiled with xerces-c support"
-  exit 1
-fi
+#TODO: this is Linux only, needs a fix:
+#if [ -z "`ldd $OGRINFO | grep xerces`" ] ; then
+#  g.message -e "OGR needs to be compiled with xerces-c support"
+#  exit 1
+#fi
 
-#### check if we have lynx
-if [ ! -x "`which lynx`" ] ; then
-    g.message -e "'lynx' is required, please install first"
+#### check if we have curl
+if [ ! -x "`which curl`" ] ; then
+    g.message -e "'curl' is required, please install first"
     exit 1
 fi
 
@@ -64,10 +71,19 @@
 WFS_URL="$GIS_OPT_WFS"
 
 g.message "Retrieving data ..."
-lynx -source "$WFS_URL" > "$TMP.xml"
+curl "$WFS_URL" > "$TMP.xml"
 
 v.in.ogr dsn="$TMP.xml" out=$OUT -o
-#rm -f "$TMP.xml"
+if [ $? -ne 0 ] ; then
+  g.message -e "WFS-XML file not readable. Check if xerces-c support is compiled into GDAL/OGR library."
+  rm -f "$TMP.xml" "$TMP" "$TMP.gfs"
+  exit 1
+fi
 
+rm -f "$TMP.xml" "$TMP" "$TMP.gfs"
+
+v.support $OUT cmdhist="${CMDLINE}"
 g.message "Vector points map <$OUT> imported from WFS."
+
 exit 0
+



More information about the grass-commit mailing list