parms_flags.txt 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. GRASS: Module parameters concept
  2. All GRASS modules should use a standardized scheme.
  3. Collected idead below.
  4. 1)
  5. Date: Sun, 26 Nov 2000 20:34:55 -0800
  6. From: "Eric G . Miller" <egm2 jps.net>
  7. Subject: [GRASSLIST:1195] Re: [GRASS5] Re: notation standardisation
  8. To: grass5@grass.itc.it, GRASSLIST@baylor.edu
  9. As follow-up, I also think we should use the same parameter names used
  10. by g.list, g.copy, g.remove, etc. when input/output aren't appropriate.
  11. So we have "rast", "vect", "sites", "icon", "labels", "region", "group",
  12. and "3dview" to use (and maybe "dspf" ?).
  13. Rule of thumb [proposed]:
  14. 1. If the module takes a single input and produces a single output, then
  15. use input=[name] and output=[name].
  16. 2. If the module just performs some action, but doesn't produce an
  17. output different from the input, then use the input "types" parameter
  18. "name" (i.e. "rast", "vect", etc...).
  19. 3. If the module has multiple inputs or outputs, then attempt to use the
  20. parameter names above if possible, else parameter names are left up
  21. to the author. So, If I had a module that took a raster and a vector
  22. and produced a raster, it's parameters could be:
  23. r.something rast=[name] vect=[name] output=[name]
  24. However, with some modules, there's more than one input or output of
  25. a single "type", so then each name should be descriptive of what its
  26. function is.
  27. I don't know that we ever resolved the issue of addressing sites
  28. attributes. Basically we have something like:
  29. "east", "north", "dim", "cat", "decimal", and "string";
  30. for attribute names. For the "index", I don't know; maybe just "index"
  31. when there's only one to be specified, otherwise "zindex" for "dim",
  32. "dindex" for decimal and "sindex" for string??? I know I'm guilty of
  33. not being consistent here.
  34. NOTE: I'd like to get some kind of simple attribute database implemented
  35. in GRASS, but so far I haven't found anything that we could just plug in
  36. with a few tweaks. The closest might be the Xbase library, but it's C++
  37. and I don't know how well Xbase files might support efforts at
  38. localization in the future. Anyway, I bring this up, because
  39. identifying attributes by "type" and "index" is really cumbersome.
  40. --
  41. Eric G. Miller <egm2@jps.net>
  42. ------------------------------------------------
  43. 2) Here another rough concept (to be updated):
  44. Import:
  45. * file=name output=name for all raster, sites and vector modules
  46. Export:
  47. * input=name file=name for all raster, sites and vector modules
  48. * export modules should *all* have an output= parameter, however they
  49. should allow specifying "-" to write to stdout (for unix piping)
  50. -> file is external file. Should be read from current directory, not
  51. within mapset!
  52. Display modules:
  53. map= for all raster and vector modules,
  54. file=name for modules that can read from stdin in the
  55. "easting northing label" format.
  56. Vector modules:
  57. map= for map (no analysis modules)
  58. input= output= for maps (analysis modules)
  59. Raster modules:
  60. input= output= for maps (analysis modules)
  61. sometimes: elev=
  62. Imagery modules:
  63. input= output= for maps (analysis modules)
  64. Sites modules:
  65. map= for map (no analysis modules)
  66. input= output= for maps (analysis modules)
  67. sometimes: elev=
  68. field Attribute field type to use for operation
  69. options: dim,decimal,cat
  70. default: decimal
  71. findex Attribute field number to use for operation
  72. default: 1
  73. string String attribute number to use for description
  74. default: 1
  75. -> important: attribute field selection
  76. Misc modules:
  77. map= for map (no analysis modules)
  78. input= output= for maps (analysis modules)
  79. General modules:
  80. [rast=old,new] [vect=old,new] [icon=old,new] [labels=old,new]
  81. [sites=old,new] [region=old,new] [group=old,new] [3dview=old,new]
  82. 3D raster modules:
  83. parameters following raster2d modules
  84. Database modules
  85. ?
  86. ------------------------------------------------------------------
  87. General proposal for import modules:
  88. - flag -q quiet (default is verbose)
  89. - flag -o overwrite (default is exit if out exists)
  90. - support of new envvar: GRASS_AUTO_EXTEND_LOCATION (function is already
  91. present in r.in.gdal -e, this should be moved to libgis and added to
  92. all import modules)
  93. - read from stdin with 'in=-' (for all import modules)
  94. - add 'timestamp' parameter to import modules