Переглянути джерело

grass.py: support datum_trans when creating new location based on EPSG code
(merge https://trac.osgeo.org/grass/changeset/62424 from trunk)


git-svn-id: https://svn.osgeo.org/grass/grass/branches/releasebranch_7_0@62580 15284696-431f-4ddb-bdfa-cd5b030d7da7

Martin Landa 10 роки тому
батько
коміт
dbebb33389
2 змінених файлів з 15 додано та 3 видалено
  1. 6 2
      lib/init/grass.py
  2. 9 1
      lib/init/grass7.html

+ 6 - 2
lib/init/grass.py

@@ -167,7 +167,7 @@ help_text = r"""GRASS GIS %s
 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 @@ def non_interactive(arg, geofile=None):
                         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,

+ 9 - 1
lib/init/grass7.html

@@ -3,7 +3,7 @@
 <h2>SYNOPSIS</h2>
 
 <b>grass70</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>&lt;GISDBASE&gt;/</b>]<b>&lt;LOCATION_NAME&gt;/</b>]
     	<b>&lt;MAPSET&gt;</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 @@ examples bellow) otherwise taken from the last GRASS session.</dd>
 <dd> Creates new GRASS location with EPSG code 4326 (latitude-longitude, WGS84)
     in the specified GISDBASE
 
+<dt><b>grass70 -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>grass70 -c myvector.shp $HOME/grassdata/mylocation</b>
 <dd> Creates new GRASS location based on georeferenced Shapefile