Browse Source

r.plane: added function float_or_dms, working on https://trac.osgeo.org/grass/ticket/3225

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@74438 15284696-431f-4ddb-bdfa-cd5b030d7da7
Luca Delucchi 6 years ago
parent
commit
d45fbbd4b6
1 changed files with 9 additions and 2 deletions
  1. 9 2
      scripts/r.plane/r.plane.py

+ 9 - 2
scripts/r.plane/r.plane.py

@@ -73,8 +73,15 @@ def main():
     type = options['type']
     dip = float(options['dip'])
     az = float(options['azimuth'])
-    ea = float(options['easting'])
-    no = float(options['northing'])
+    try:
+        ea = float(options['easting'])
+        no = float(options['northing'])
+    except ValueError:
+        try:
+            ea = float(gscript.utils.float_or_dms(options['easting']))
+            no = float(gscript.utils.float_or_dms(options['northing']))
+        except:
+            gscript.fatal(_("Input coordinates seems to be invalid"))
     el = float(options['elevation'])
 
     # reg = gscript.region()