[GRASS-dev] [GRASS GIS] #2136: Create standard options for map or file base name (prefix)
GRASS GIS
trac at osgeo.org
Mon Jun 23 06:33:02 PDT 2014
#2136: Create standard options for map or file base name (prefix)
-----------------------------------------+----------------------------------
Reporter: wenzeslaus | Owner: grass-dev@…
Type: defect | Status: new
Priority: normal | Milestone: 7.0.0
Component: Parser | Version: svn-releasebranch64
Keywords: base name, prefix, basename | Platform: All
Cpu: All |
-----------------------------------------+----------------------------------
Comment(by zarch):
The list of the modules using the word "prefix" as name of the parameter
or in the parameter description is (module name => parameter name,
parameter description):
- g.extension => prefix: Prefix where to install extension (ignored
when flag -s is given)
- i.cca => output: Output raster map prefix name
- i.landsat.acca => input_prefix: Example: 'B.' for B.1, B.2, ...
- i.landsat.toar => input_prefix: Example: 'B.' for B.1, B.2, ...
- i.landsat.toar => output_prefix: Example: 'B.toar.' generates
B.toar.1, B.toar.2, ...
- i.pansharpen => output_prefix: Prefix for output raster maps
- i.pca => output_prefix: A numerical suffix will be added for each
component map
- i.tasscap => output_prefix: Prefix for output raster maps
- i.topo.corr => output: Name (flag -i) or prefix for output raster
maps
- m.nviz.script => name: Prefix of output images (default = NVIZ)
- r.blend => output_prefix: Prefix for red, green and blue output
raster maps containing
- r.rgb => output_prefix: Prefix for output raster maps (default:
input)
- r.ros => output: Prefix for output raster maps (.base, .max,
.maxdir, .spotdist)
- r.texture => prefix: Prefix for output raster map(s)
- v.out.postgis => dsn: Starts with 'PG' prefix, eg. 'PG:dbname=grass'
- v.rast.stats => column_prefix: Column prefix for new attribute
columns
Just for the record I attached the code to look for a word in all the
GRASS modules:
{{{
#!python
from __future__ import print_function
import sys
from grass.pygrass.modules.shortcuts import (display, database, general,
imagery, miscellaneous,
postscript, raster, raster3D,
temporal, vector)
mods = [display, database, general, imagery, miscellaneous, postscript,
raster, raster3D, temporal, vector]
SKIP = ['v.pack', 'v.parallel']
def look(modules, word, skip, file=sys.stdout):
mlen = len(modules.__dir__())
for i, module in enumerate(modules.__dir__()):
try:
md = "%s.%s" % (modules.prefix, module)
print("%03d/%03d - %s" % (i + 1, mlen, md))
if md in skip:
print("SKIPED: %s" % md)
else:
m = getattr(modules, module)
for p in m.params_list:
if ((p.name is not None and word in p.name.lower()) or
(p.description is not None and
word in p.description.lower())):
print("%s => %s, %s" % (m.name, p.name,
p.description),
file=file)
del(m)
except:
print("Not able to read: %s.%s" % (modules.prefix, module),
file=file)
#import ipdb; ipdb.set_trace()
del(modules)
with open("prefix.txt", "w") as file:
for m in mods:
look(m, "prefix", skip=SKIP, file=file)
}}}
In this way I found out that pygrass modules interface crashed with these
two modules:
- v.pack
- v.parallel
and raise an exception trying to read:
- g.parser
- i.eb_h_sebal01
- t.rast_accdetect
- t.rast_accumulate
- t.rast_aggregate
- t.rast_aggregate_ds
- t.rast_extract
- t.rast_gapfill
- t.rast_import
- t.rast_mapcalc
- t.rast_neighbors
- t.rast3d_mapcalc
- t.vect_extract
- v.generalize
So I will look into it during the next days.
--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2136#comment:5>
GRASS GIS <http://grass.osgeo.org>
More information about the grass-dev
mailing list