[GRASS-dev] [GRASS GIS] #3585: Don't require -c for --tmp-location

GRASS GIS trac at osgeo.org
Sat Jun 9 19:02:35 PDT 2018

#3585: Don't require -c for --tmp-location
 Reporter:  wenzeslaus                           |      Owner:  grass-dev@…
     Type:  enhancement                          |     Status:  new
 Priority:  normal                               |  Milestone:  8.0.0
Component:  Startup                              |    Version:  svn-trunk
 Keywords:  init, grass.py, location, tmp-       |        CPU:  Unspecified
  location, CRS, CLI, gsoc2018                   |
 Platform:  Unspecified                          |
 With this ticket, I'm seeking feedback for designing interface for
 creating temporary locations from command line.

 With `--tmp-location` (#3537, r72790), CRS needs to be specified using the
 `-c` flag:

 grass7 -c EPSG:3358 --tmp-location --exec g.proj -p

 Without `--tmp-location`, `-c` is used to tell GRASS to create a new
 location or mapset. However, with `--tmp-location` GRASS knows that it
 needs to create a new location, so `-c` is required here to only specify
 the coordinate system. Thus, `--tmp-location` could itself require a value
 to be provided, so that the syntax would become:

 grass7 --tmp-location EPSG:3358 --exec g.proj -p

 Usage would look like (new):

 grass75 --tmp-location [geofile | EPSG] --exec EXECUTABLE [EPARAM]...

 Instead of (old):

 grass75 -c [geofile | EPSG] --tmp-location --exec EXECUTABLE [EPARAM]...

 Or concisely with a reference:

   grass75 [-h | -help | --help | --h] [-v | --version]
           [-c [CRS]] [-e] [-f]
           [-text | -gtext | -gui] [--config param]
   grass75 --tmp-location CPARAM --exec EXECUTABLE [EPARAM]...
   CRS                            nothing or geofile or
   CRS (or written like:)         [geofile | EPSG:code[:datum_trans]]
   EXECUTABLE                     GRASS module, script or any other
   EPARAM                         parameters of the executable
   FLAG                           standard flags
 # Alternatives to CRS are SRS and CPARAM (like EPARAM).

 Note 1: The current parsing does not care about order, so e.g. `grass7
 --tmp-location EPSG:3358 -c --exec...` is possible now. This should be
 probably fixed in the future (e.g. 8.0.0 release). (It is not specified in
 the manual, so the current behavior can fixed/dropped any time.)

 Note 2: This is part of making the command line as short as possible, so
 it might be strange that the `--tmp-location` flag is long, but that's a
 topic for another ticket.

Ticket URL: <https://trac.osgeo.org/grass/ticket/3585>
GRASS GIS <https://grass.osgeo.org>

More information about the grass-dev mailing list