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

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Apr 13 08:03:31 PDT 2013


Author: neteler
Date: 2013-04-13 08:03:30 -0700 (Sat, 13 Apr 2013)
New Revision: 55755

Modified:
   grass/branches/develbranch_6/scripts/v.in.wfs/description.html
   grass/branches/develbranch_6/scripts/v.in.wfs/v.in.wfs
Log:
v.in.wfs: check for WFS server errors; new example

Modified: grass/branches/develbranch_6/scripts/v.in.wfs/description.html
===================================================================
--- grass/branches/develbranch_6/scripts/v.in.wfs/description.html	2013-04-13 15:03:25 UTC (rev 55754)
+++ grass/branches/develbranch_6/scripts/v.in.wfs/description.html	2013-04-13 15:03:30 UTC (rev 55755)
@@ -5,17 +5,22 @@
 
 <h2>EXAMPLES</h2>
 
-Import of GRASS user map:
+Import of world cities with population > 1 million:
 <p>
 <div class="code"><pre>
-# run in LatLong location:
+# run in Latitude-Longitude location (EPGS code 4326):
+<!-- ops, this fetches all layers:
+# GetCapabilities:
 v.in.wfs \
- wfs="http://mapserver.gdf-hannover.de/cgi-bin/grassuserwfs?REQUEST=GetFeature&SERVICE=WFS&VERSION=1.0.0" out=grass_users
-
-v.db.select grass_users where="name ~ 'Markus'"
+ wfs="http://mapserver.flightgear.org/ms?Service=WFS&Version=1.0.0&request=GetCapabilities" \
+ output=dummy 
+-->
+# download geonam_gt1M layer:
+v.in.wfs \
+ wfs="http://mapserver.flightgear.org/ms?Service=WFS&request=GetFeature&version=1.0.0&typename=geonam_gt1M" \
+ output=geonam_gt1M
 </pre></div>
 
-
 <h2>REQUIREMENTS</h2>
 
 The "curl" http download program must be installed.
@@ -24,7 +29,11 @@
 
 <h2>SEE ALSO</h2>
 
-<em><a href="v.in.ogr.html">v.in.ogr</a></em>
+<em>
+<a href="g.region.html">g.region</a>,
+<a href="r.in.wms.html">r.in.wms</a>,
+<a href="v.in.ogr.html">v.in.ogr</a>
+</em>
 
 <h2>AUTHORS</h2>
 

Modified: grass/branches/develbranch_6/scripts/v.in.wfs/v.in.wfs
===================================================================
--- grass/branches/develbranch_6/scripts/v.in.wfs/v.in.wfs	2013-04-13 15:03:25 UTC (rev 55754)
+++ grass/branches/develbranch_6/scripts/v.in.wfs/v.in.wfs	2013-04-13 15:03:30 UTC (rev 55755)
@@ -74,7 +74,18 @@
 g.message "Retrieving data ..."
 curl "$WFS_URL" > "$TEMPFILE.xml"
 
-v.in.ogr dsn="$TEMPFILE.xml" out=$OUT -o
+# check for errors:
+grep "ExceptionText" "$TEMPFILE.xml" > /dev/null
+if [ $? -eq 0 ] ; then
+  g.message -e "WFS server error:"
+  grep "ExceptionText" "$TEMPFILE.xml" | cut -d'>' -f2- | cut -d'<' -f1
+exit 1
+fi
+
+# cp "$TEMPFILE.xml" /tmp/
+
+# TODO: sure to override projection check?
+v.in.ogr dsn="$TEMPFILE.xml" output=$OUT -o
 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 "$TEMPFILE.xml" "$TEMPFILE" "$TEMPFILE.gfs"



More information about the grass-commit mailing list