g.copy.html 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. <h2>DESCRIPTION</h2>
  2. The <em>g.copy</em> module creates a copy of existing raster maps,
  3. vector maps, or other elements. The copy is always created in
  4. the current mapset. The source data can be in the current mapset,
  5. in an explicitly specified mapset, or in a mapset which is in the
  6. current mapset search path (typically the PERMANENT mapset).
  7. <p>
  8. The maps and other elements to copy are specified in pairs
  9. <b>from</b>,<b>to</b> according to their types.
  10. Although typically only one map is copied in one module call,
  11. multiple pairs can be provided for each type and multiple types
  12. can be provided at the same time.
  13. <h3>Relation to mapsets</h3>
  14. A user may access data stored under the other mapsets listed in their
  15. mapset search path. However, the user may only modify data stored
  16. under their own current mapset. <em>g.copy</em> allows the user to copy
  17. existing data files <b>from</b> other mapsets <b>to</b> the user's
  18. current mapset (<code>g.mapset -p</code>). The files to be copied must exist in the
  19. user's current mapset search path (<code>g.mapsets -p</code>) and location;
  20. output is sent to the
  21. relevant data element directory(ies) under the user's current mapset.
  22. <h3>Behavior on error</h3>
  23. Errors typically occur when a map or other element does not exist,
  24. <b>from</b> and <b>to</b> are the same, <b>to</b> element
  25. already exists and overwriting (e.g., by <b>--overwrite</b>) is not
  26. enabled, or the <b>to</b> element has an illegal name.
  27. When only one map or other element is requested to be copied and the copying
  28. is not possible or fails, an error is reported.
  29. <p>
  30. If multiple maps or other elements are copied in one command,
  31. <em>g.copy</em> attempts to copy as much as possible
  32. even when problems occur with one of the elements.
  33. In that case, copying of the element causing problems is skipped, and
  34. <em>g.copy</em> proceeds with copying the remaining elements.
  35. If nothing can be copied or an error occurred during one of the copy
  36. operations, an error message is reported after other possible copy
  37. operations were performed.
  38. <h2>EXAMPLES</h2>
  39. If the user wished to copy the existing raster
  40. file <em>soils</em> to a file called <em>soils.ph</em> and
  41. to copy an existing vector map <em>roads</em> to a file
  42. called <em>rds.old</em>, the user could type:
  43. <div class="code"><pre>
  44. g.copy raster=soils,soils.ph
  45. g.copy vector=roads,rds.old
  46. # or even combined:
  47. g.copy raster=soils,soils.ph vector=roads,rds.old
  48. </pre></div>
  49. <p>
  50. Data files can also be specified by their mapsets. For
  51. example, the below command copies the raster map named
  52. <em>soils</em> from the mapset <em>wilson</em> to a new
  53. file called <em>soils</em> to be placed under the user's
  54. current mapset:
  55. <div class="code"><pre>
  56. g.copy raster=soils@wilson,soils
  57. </pre></div>
  58. If no mapset name is specified, <em>g.copy</em> searches for the
  59. named <b>from</b> map in each of the mapset directories listed in the
  60. user's current mapset search path in the order in which mapsets are
  61. listed there (see <em><a href="g.mapsets.html">g.mapsets</a></em>).
  62. <h2>SEE ALSO</h2>
  63. <em>
  64. <a href="g.access.html">g.access</a>,
  65. <a href="g.list.html">g.list</a>,
  66. <a href="g.mapsets.html">g.mapsets</a>,
  67. <a href="g.remove.html">g.remove</a>,
  68. <a href="g.rename.html">g.rename</a>
  69. </em>
  70. <h2>AUTHOR</h2>
  71. Michael Shapiro,
  72. U.S. Army Construction Engineering
  73. Research Laboratory
  74. <!--
  75. <p>
  76. <i>Last changed: $Date$</i>
  77. -->