[GRASS-SVN] r51769 - grass/branches/releasebranch_6_4/lib/python
svn_grass at osgeo.org
svn_grass at osgeo.org
Sat May 26 07:15:04 EDT 2012
Author: annakrat
Date: 2012-05-26 04:15:04 -0700 (Sat, 26 May 2012)
New Revision: 51769
Modified:
grass/branches/releasebranch_6_4/lib/python/core.py
Log:
lib/python: locn_is_latlong function backported from trunk, r50816
Modified: grass/branches/releasebranch_6_4/lib/python/core.py
===================================================================
--- grass/branches/releasebranch_6_4/lib/python/core.py 2012-05-26 10:45:34 UTC (rev 51768)
+++ grass/branches/releasebranch_6_4/lib/python/core.py 2012-05-26 11:15:04 UTC (rev 51769)
@@ -558,6 +558,19 @@
s = read_command("g.gisenv", flags='n')
return parse_key_val(s)
+def locn_is_latlong():
+ """!Tests if location is lat/long. Value is obtained
+ by checking the "g.region -p" projection code.
+
+ @return True for a lat/long region, False otherwise
+ """
+ s = read_command("g.region", flags='p')
+ kv = parse_key_val(s, ':')
+ if kv['projection'].split(' ')[1] == '3':
+ return True
+ else:
+ return False
+
# interface to g.region
def region(region3d = False):
More information about the grass-commit
mailing list