[GRASS-SVN] r44816 - in grass/branches/releasebranch_6_4:
gui/wxpython/gui_modules lib/python
svn_grass at osgeo.org
svn_grass at osgeo.org
Thu Dec 30 14:04:52 EST 2010
Author: martinl
Date: 2010-12-30 11:04:52 -0800 (Thu, 30 Dec 2010)
New Revision: 44816
Modified:
grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/dbm_base.py
grass/branches/releasebranch_6_4/lib/python/vector.py
Log:
pythonlib: follow param naming convention
(merge r44815 from trunk)
Modified: grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/dbm_base.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/dbm_base.py 2010-12-30 18:54:05 UTC (rev 44815)
+++ grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/dbm_base.py 2010-12-30 19:04:52 UTC (rev 44816)
@@ -90,7 +90,7 @@
line = None
nselected = 0
- data = grass.vector_what(name = self.map,
+ data = grass.vector_what(map = self.map,
coord = (float(queryCoords[0]), float(queryCoords[1])),
distance = float(qdist))
Modified: grass/branches/releasebranch_6_4/lib/python/vector.py
===================================================================
--- grass/branches/releasebranch_6_4/lib/python/vector.py 2010-12-30 18:54:05 UTC (rev 44815)
+++ grass/branches/releasebranch_6_4/lib/python/vector.py 2010-12-30 19:04:52 UTC (rev 44816)
@@ -25,6 +25,7 @@
import os
import types
+import __builtin__
from core import *
@@ -220,12 +221,12 @@
'values' : values }
# interface to v.what
-def vector_what(name, coord, distance = 0.0):
+def vector_what(map, coord, distance = 0.0):
"""!Query vector map at given locations
To query one vector map at one location
@code
- print grass.vector_what(name = 'archsites', coord = (595743, 4925281), distance = 250)
+ print grass.vector_what(map = 'archsites', coord = (595743, 4925281), distance = 250)
[{'Category': 8, 'Map': 'archsites', 'Layer': 1, 'Key_column': 'cat',
'Database': '/home/martin/grassdata/spearfish60/PERMANENT/dbf/',
@@ -236,7 +237,7 @@
To query one vector map at more locations
@code
- for q in grass.vector_what(name = ('archsites', 'roads'), coord = (595743, 4925281),
+ for q in grass.vector_what(map = ('archsites', 'roads'), coord = (595743, 4925281),
distance = 250):
print q['Map'], q['Attributes']
@@ -246,7 +247,7 @@
To query more vector maps at one location
@code
- for q in grass.vector_what(name = 'archsites', coord = [(595743, 4925281), (597950, 4918898)],
+ for q in grass.vector_what(map = 'archsites', coord = [(595743, 4925281), (597950, 4918898)],
distance = 250):
print q['Map'], q['Attributes']
@@ -254,7 +255,7 @@
archsites {'str1': 'Bob_Miller', 'cat': '22'}
@endcode
- @param name vector map(s) to query given as string or list/tuple
+ @param map vector map(s) to query given as string or list/tuple
@param coord coordinates of query given as tuple (easting, northing) or list of tuples
@param distance query threshold distance (in map units)
@@ -264,11 +265,11 @@
locale = os.environ["LC_ALL"]
os.environ["LC_ALL"] = "C"
- if type(name) in (types.StringType, types.UnicodeType):
- name_list = [name]
+ if type(map) in (types.StringType, types.UnicodeType):
+ map_list = [map]
else:
- name_list = name
-
+ map_list = map
+
coord_list = list()
if type(coord) is types.TupleType:
coord_list.append('%f,%f' % (coord[0], coord[1]))
@@ -279,7 +280,7 @@
ret = read_command('v.what',
quiet = True,
flags = 'ag',
- map = ','.join(name_list),
+ map = ','.join(map_list),
east_north = ','.join(coord_list),
distance = float(distance))
@@ -293,7 +294,7 @@
dict_attrb = None
for item in ret.splitlines():
try:
- key, value = map(lambda x: x.strip(), item.split('=', 1))
+ key, value = __builtin__.map(lambda x: x.strip(), item.split('=', 1))
except ValueError:
continue
if key in ('East', 'North'):
More information about the grass-commit
mailing list