g.copy(1grass)
π g.copy β the glow-up your maps deserve π
okay bestie, sit down, hydrate, because we're about to talk about copying things in GRASS and honestly? it's giving "duplicate your faves so you never lose them." no cap. π«Ά
This is g.copy from the GRASS User's Manual, and yes, she's indexed under KEYWORDS: general, map management, copy. β¨
β¨ SYNOPSIS β¨
g.copy
g.copy --help
g.copy [raster=from,to] [raster_3d=from,to] [vector=from,to]
[label=from,to] [region=from,to] [group=from,to] [--overwrite]
[--help] [--verbose] [--quiet] [--ui]
π Flags (the little switchy besties)
--overwriteβ let your output files just bulldoze whatever's already there. yes, that means overwriting existing files. use with intention, queen.--helpβ prints the usage summary so you're not out here guessing.--verboseβ verbose module output. she talks more. π£οΈ--quietβ quiet module output. she says nothing. shhh. π€«--uiβ force-launch the GUI dialog, for when you want the pretty buttons.
πΈ Parameters (the actual tea)
raster=from,toβ raster map(s) to be copiedraster_3d=from,toβ 3D raster map(s) to be copiedvector=from,toβ vector map(s) to be copiedlabel=from,toβ paint label file(s) to be copiedregion=from,toβ region definition(s) to be copiedgroup=from,toβ imagery group(s) to be copied
π« DESCRIPTION π«
The g.copy module creates a copy of existing raster maps, vector maps, or other elements. The copy is always created in the current mapset β periodt, that's not negotiable. The source data can live in the current mapset, in an explicitly specified mapset, or in a mapset which is in the current mapset search path (typically the PERMANENT mapset).
The maps and other elements you wanna copy get specified in pairs from,to according to their types. And listen β although typically only one map is copied in one module call, you can absolutely pass multiple pairs for each type and multiple types at the same time. she's flexible like that. π
πΊοΈ Relation to mapsets
A user may access data stored under the other mapsets listed in their mapset search path. However, the user may only modify data stored under their own current mapset. g.copy allows the user to copy existing data files from other mapsets to the user's current mapset (g.mapset -p). The files to be copied must exist in the user's current mapset search path (g.mapsets -p) and project; output is sent to the relevant data element directory(ies) under the user's current mapset.
π Behavior on error (the sad part, but we cope)
Errors typically occur when:
- a map or other element does not exist,
fromandtoare the same,- the
toelement already exists and overwriting (e.g., by--overwrite) is not enabled, - or the
toelement has an illegal name.
When only one map or other element is requested to be copied and the copying is not possible or fails, an error is reported.
If multiple maps or other elements are copied in one command, g.copy attempts to copy as much as possible even when problems occur with one of the elements. In that case, copying of the element causing problems is skipped, and g.copy proceeds with copying the remaining elements. If nothing can be copied or an error occurred during one of the copy operations, an error message is reported after other possible copy operations were performed.
π tl;dr: she tries her best. one bad element doesn't cancel the whole vibe, but if everything fails you will hear about it.
π EXAMPLES π
So say the user wished to copy the existing raster file soils to a file called soils.ph and to copy an existing vector map roads to a file called rds.old β the user could type:
g.copy raster=soils,soils.ph
g.copy vector=roads,rds.old
# or even combined:
g.copy raster=soils,soils.ph vector=roads,rds.old
Data files can also be specified by their mapsets. For example, the below command copies the raster map named soils from the mapset wilson to a new file called soils to be placed under the user's current mapset:
g.copy raster=soils@wilson,soils
If no mapset name is specified, g.copy searches for the named from map in each of the mapset directories listed in the user's current mapset search path in the order in which mapsets are listed there (see g.mapsets). π¦
π SEE ALSO π
g.access, g.list, g.mapsets, g.remove, g.rename
π AUTHOR π
Michael Shapiro, U.S. Army Construction Engineering Research Laboratory
π SOURCE CODE π
Available at: g.copy source code (history)
Latest change: Friday Feb 07 19:16:09 2025 in commit: a82a39f673b97fafcfce1604dc3e6015cb96487a
Main index | General index | Topics index | Keywords index | Graphical index | Full index
okay that's the whole page bestie, you ate that. π final lil sign-off: this was g.copy from the GRASS 8.5.0 Reference Manual, Β© 2003-2026 GRASS Development Team, and the footer energy is just GRASS 8.5.0 β g.copy(1grass). now go copy something iconic. β¨ππ¦
π¦ where this page comes from
- alpine 3.24: grass-gis-doc 8.5.0-r1 Β· GPL-2.0-or-later
- ubuntu stonking: grass-doc 8.5.0-1ubuntu1 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms