[GRASS-SVN] r35525 - grass/trunk/swig/python/examples

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Jan 20 16:21:28 EST 2009


Author: neteler
Date: 2009-01-20 16:21:28 -0500 (Tue, 20 Jan 2009)
New Revision: 35525

Modified:
   grass/trunk/swig/python/examples/rasteraccess.py
   grass/trunk/swig/python/examples/vectoraccess.py
Log:
search maps, don't hardcode

Modified: grass/trunk/swig/python/examples/rasteraccess.py
===================================================================
--- grass/trunk/swig/python/examples/rasteraccess.py	2009-01-20 21:18:01 UTC (rev 35524)
+++ grass/trunk/swig/python/examples/rasteraccess.py	2009-01-20 21:21:28 UTC (rev 35525)
@@ -14,11 +14,13 @@
   input = sys.argv[1]
 else:
   input = raw_input("Raster Map Name? ")
-mapset = 'PERMANENT'
 
 # initialize
 grasslib.G_gisinit('')
 
+# find map in search path
+mapset = grasslib.G_find_cell2(input,'')
+
 # determine the inputmap type (CELL/FCELL/DCELL) */
 data_type = grasslib.G_raster_map_type(input, mapset)
 

Modified: grass/trunk/swig/python/examples/vectoraccess.py
===================================================================
--- grass/trunk/swig/python/examples/vectoraccess.py	2009-01-20 21:18:01 UTC (rev 35524)
+++ grass/trunk/swig/python/examples/vectoraccess.py	2009-01-20 21:21:28 UTC (rev 35525)
@@ -15,11 +15,12 @@
 else:
   input = raw_input("Vector Map Name? ")
 
-mapset = 'PERMANENT'
-
 # initialize
 grasslib.G_gisinit('')
 
+# find map in search path
+mapset = grasslib.G_find_vector2(input,'')
+
 # define map structure
 map = grassvect.Map_info()
 



More information about the grass-commit mailing list