[GRASS-SVN] r62424 - grass/trunk/lib/init

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Oct 27 12:43:24 PDT 2014


Author: martinl
Date: 2014-10-27 12:43:24 -0700 (Mon, 27 Oct 2014)
New Revision: 62424

Modified:
   grass/trunk/lib/init/grass.py
   grass/trunk/lib/init/grass7.html
Log:
grass.py: support datum_trans when creating new location based on EPSG code


Modified: grass/trunk/lib/init/grass.py
===================================================================
--- grass/trunk/lib/init/grass.py	2014-10-27 19:15:57 UTC (rev 62423)
+++ grass/trunk/lib/init/grass.py	2014-10-27 19:43:24 UTC (rev 62424)
@@ -167,7 +167,7 @@
 Geographic Resources Analysis Support System (GRASS GIS).
 
 %s:
-  $CMD_NAME [-h | -help | --help] [-v | --version] [-c | -c geofile | -c EPSG:code]
+  $CMD_NAME [-h | -help | --help] [-v | --version] [-c | -c geofile | -c EPSG:code[:datum_trans]]
           [-e] [-text | -gui] [--config param]
           [[[<GISDBASE>/]<LOCATION_NAME>/]<MAPSET>]
 
@@ -646,8 +646,12 @@
                         if geofile and geofile.upper().find('EPSG:') > -1:
                             # create location using EPSG code
                             epsg = geofile.split(':', 1)[1]
+                            if ':' in epsg:
+                                epsg, datum_trans = epsg.split(':', 1)
+                            else:
+                                datum_trans = None
                             grass.create_location(gisdbase, location_name,
-                                                      epsg=epsg)
+                                                  epsg=epsg, datum_trans=datum_trans)
                         else:
                             # create location using georeferenced file
                             grass.create_location(gisdbase, location_name,

Modified: grass/trunk/lib/init/grass7.html
===================================================================
--- grass/trunk/lib/init/grass7.html	2014-10-27 19:15:57 UTC (rev 62423)
+++ grass/trunk/lib/init/grass7.html	2014-10-27 19:43:24 UTC (rev 62424)
@@ -3,7 +3,7 @@
 <h2>SYNOPSIS</h2>
 
 <b>grass71</b> [<b>-h</b> | <b>-help</b> | <b>--help</b>] [<b>-v</b> | <b>--version</b>]
-    [<b>-c</b> | <b>-c geofile</b> | <b>-c EPSG:code</b>]
+    [<b>-c</b> | <b>-c geofile</b> | <b>-c EPSG:code[:datum_trans]</b>]
     [<b>-text</b> | <b>-gtext</b> | <b>-gui</b>]
     [[[<b><GISDBASE>/</b>]<b><LOCATION_NAME>/</b>]
     	<b><MAPSET></b>]
@@ -27,6 +27,9 @@
 <dt><b>-c EPSG:code</b>
 <dd> Creates new GRASS projected location in specified GISDBASE with given EPSG code
 
+<dt><b>-c EPSG:code:datum_trans</b>
+  <dd> Creates new GRASS projected location in specified GISDBASE with given EPSG code and datum transform parameters
+
 <dt><b>-text</b>
 <dd> Indicates that Text-based User Interface should be used (skip welcome screen)
 
@@ -238,6 +241,11 @@
 <dd> Creates new GRASS location with EPSG code 4326 (latitude-longitude, WGS84)
     in the specified GISDBASE
 
+<dt><b>grass71 -c EPSG:5514:3 $HOME/grassdata/mylocation</b>
+<dd> Creates new GRASS location with EPSG code 5514 (S-JTSK / Krovak
+    East North - SJTSK) with datum transformation paramaters used in
+    Czech Republic in the specified GISDBASE
+
 <dt><b>grass71 -c myvector.shp $HOME/grassdata/mylocation</b>
 <dd> Creates new GRASS location based on georeferenced Shapefile
 



More information about the grass-commit mailing list