v.patch(1)

πŸ¦‹ v.patch(1) β€” straight out of the GRASS GIS User's Manual, bestie πŸ¦‹

okay so picture this: you've got a bunch of vector maps and you want them to be one vector map. that's the whole gig. v.patch is the girl who does that. no cap.


✨ NAME ✨

v.patch β€” makes a brand new vector map by squishing other vector maps together into one. it's giving "combine and conquer" πŸ’…


🏷️ KEYWORDS 🏷️

vector, geometry, level1


πŸ“œ SYNOPSIS πŸ“œ

v.patch
v.patch --help
v.patch [-nzeab] input=name[,name,...] output=name  [bbox=name]
[--overwrite]  [--help]  [--verbose]  [--quiet]  [--ui]

πŸŽ€ Flags:

  • -n β€” bestie, don't expect the input to have topology. use this when your input is points without topology 🫢
  • -z β€” expect a z coordinate even when you're not using topology. this one's for when your input is points that do have a z coordinate but don't have topology ✨
  • -e β€” copy the attribute table too, slay. heads up tho: only the table of layer 1 is supported rn 😭
  • -a β€” append files to an existing file. ngl you must have overwriting of existing files activated for this one πŸ’€
  • -b β€” do NOT build topology. iconic move when you're handling a huge number of points πŸ”₯
  • --overwrite β€” let output files overwrite files that already exist
  • --help β€” print the usage summary
  • --verbose β€” verbose module output
  • --quiet β€” quiet module output (shhh 🀫)
  • --ui β€” force launching the GUI dialog

🌸 Parameters:

  • input=name[,name,...] [required] β€” name of the input vector map(s). or the data source(s) for direct OGR access πŸ‘‘
  • output=name [required] β€” name for the output vector map πŸ’–
  • bbox=name β€” name for an output vector map where the bounding boxes of the input vector maps get written to πŸ“¦

πŸ’– DESCRIPTION πŸ’–

so v.patch lets you combine any number of vector maps together and make one composite vector map. periodt. and if the table structures are identical, the attributes get transferred over to the new table too. it's giving merge but make it vector ✨


πŸ“ NOTES πŸ“

any vectors that are duplicated among the maps you're patching together (think border lines, the usual suspects) will have to be edited or removed after v.patch has run. the good news is you can do that editing automatically with v.clean 🧚

lines may need to be snapped with v.clean tool=snap,break,rmdupl.

boundaries may need to be cleaned with v.clean tool=break,rmdupl,rmsa β€” and you gotta run that repeatedly until the rmsa tool (Remove small angles at nodes) stops modifying any boundaries. if the vector topology is still not clean after all that, boundaries may also need to be snapped with v.clean tool=snap,break,rmdupl. it's a whole journey, i know 😭

when you use the -e flag, v.patch shifts category (cat) values in the output so that the category numbers from the different input maps don't overlap. this shift gets applied to both the category values of the features and the category values in the attribute tables. so like β€” you do NOT need to run v.category and v.db.update beforehand. we love an efficient queen πŸ‘‘

when you use the -a flag, you have to make sure the features in the different maps being added to the output map don't have overlapping category numbers β€” unless identical category numbers reflect identical attributes, in which case carry on. otherwise? the attributes of the added maps are just... gone πŸ’€ to avoid that tragedy, you can use v.category option=sum to change the category values of some of the maps before patching. do it. thank me later 🫢


🌈 EXAMPLES 🌈

patch together two maps with mixed feature types:

v.patch input=geology,streams out=geol_streams

append one map to another:

g.copy vect=roads,transport
v.patch -a input=railroads output=transport --overwrite

πŸ‘€ SEE ALSO πŸ‘€

v.clean, v.build, v.select, v.overlay


πŸ‘‘ AUTHORS πŸ‘‘

Dave Gerdes, U.S.Army Construction Engineering Research Laboratory Radim Blazek, ITC-Irst, Trento, Italy


πŸ’» SOURCE CODE πŸ’»

Available at: v.patch source code (history)

Accessed: Saturday Jan 17 05:41:28 2026

Main index | Vector index | Topics index | Keywords index | Graphical index | Full index


okay that's the whole page, bestie, and here's your cute little sign-off πŸŽ€ this is the GRASS GIS 8.4.2 Reference Manual, Β© 2003-2025 GRASS Development Team, and you're running GRASS 8.4.2 β€” so go forth and patch those vectors, you absolute main character πŸ’œπŸ¦‹βœ¨

πŸ“¦ where this page comes from