v.reclass(1grass)

πŸ’… v.reclass β€” the GRASS User's Manual glow-up πŸ¦‹

okay bestie, sit DOWN, because this is the little module that literally rewrites your vector categories and it is so underrated. It's v.reclass, and it lives in the GRASS User's Manual. πŸ”₯


✨ NAME ✨

v.reclass β€” changes vector category values for an existing vector map, based on the results of SQL queries or on a value in an attribute table column. periodt. πŸ’–


πŸŽ€ KEYWORDS πŸŽ€

vector, reclassification, attributes


🌸 SYNOPSIS 🌸

v.reclass
v.reclass --help
v.reclass input=name  [layer=string]   [type=string[,string,...]]
output=name  [column=name]   [rules=name]   [--overwrite]  [--help]
[--verbose]  [--quiet]  [--ui]

⭐ Flags

  • --overwrite β€” let your output files just bulldoze over existing files, no questions asked πŸ’₯
  • --help β€” prints the usage summary, your little cheat sheet 🫢
  • --verbose β€” verbose module output, aka it tells you everything πŸ‘€
  • --quiet β€” quiet module output, aka it says nothing, mysterious queen energy πŸ’œ
  • --ui β€” forces the GUI dialog to launch, for when you want the pretty buttons ✨

πŸ¦‹ Parameters

  • input=name [required] β€” name of the input vector map. Can also be a data source for direct OGR access. you must give it, no skipping 🚨
  • layer=string β€” layer number or name. Vector features can have category values in different layers, and this number determines which layer to use. When you're doing direct OGR access, this is the layer name instead. Default: 1 πŸ’«
  • type=string[,string,...] β€” input feature type. Options: point, line, boundary, centroid. Default: point,line,boundary,centroid (yes, all of them, she's generous like that) πŸ’…
  • output=name [required] β€” name for the output vector map πŸŽ€
  • column=name β€” the name of the column whose values are to be used as new categories. The source for the new key column must be type integer or string, no cap 😀
  • rules=name β€” full path to the reclass rule file, give the whole path bestie, don't be shy πŸ“

πŸ’– DESCRIPTION πŸ’–

v.reclass lets you create a brand-new vector map based on reclassifying an existing vector map. It also lets you move the key column away from the default "cat" using the column option. main character behavior, honestly πŸ‘‘

The rules file can hold, on each row, either a pair:

keyword value

β€” separated by a space β€” or a comment that begins with ’#’ (that's a hash). A new category's definition begins with the keyword cat, followed by the new category value. The keyword where specifies an SQL where condition. it's giving structured 🧚


πŸ”₯ NOTES πŸ”₯

  • No table is created for the reclassed map if you use the column option and the column type is integer β€” because the result could contain ambiguities. the drama of it all 😭
  • If you use the column option and the column type is string, a new table is created. It contains the newly generated cat numbers plus a single column holding the unique string column values, sorted in alphabetical order. alphabetized, organized, iconic πŸ’…
  • For dissolving common boundaries, go see v.dissolve. different task, different bestie 🫢
  • Either the rules or the column option must be specified. one of them. it's not optional. 🚨

🌈 EXAMPLES 🌈

πŸ“ Example 1: Reclass by rules

v.reclass input=land output=land_u type=boundary rules=land.rcl

The rules file contains:

# land reclass file
cat 1
where use = ’E13’ and owner = ’Jara Cimrman’
cat 2
where use = ’E14’

This produces a new vector area map land_u containing boundaries from land, with area category values selected from the database by SQL select statement:

select id from tland where use = ’E13’ and owner = ’Jara Cimrman’

changed to category 1; and values selected from the database by SQL select statement:

select id from tland where use = ’E14’

changed to category 2. slay, it just rewrote reality ✨

🌸 Example 2: Reclass by attribute column

(North Carolina sample dataset, we love her πŸ’œ)

v.reclass in=streams out=streams_by_type column=I_vs_P
v.db.select streams_by_type
cat|I_vs_P
1|intermittent
2|perennial

look at that output. gorgeous. no notes. 😌


πŸ’€ KNOWN ISSUES πŸ’€

No table is created for the reclassed layer if the rules option is used. yes, fr fr, that's just how it is bestie πŸ™ˆ


πŸ‘‘ SEE ALSO πŸ‘‘

  • v.dissolve, v.extract
  • GRASS SQL interface

πŸ’œ AUTHORS πŸ’œ

  • R.L. Glenn, USDA, SCS, NHQ-CGIS
  • from v.reclass to v.db.reclass and later to v.reclass in 5.7, rewritten by Radim Blazek

⭐ SOURCE CODE ⭐

Available at: v.reclass source code (history)

Latest change: Friday Apr 17 01:04:26 2026 in commit: 32a143358df26b2e518b03c7e0d79541e8d1e5b1

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

Β© 2003-2026 GRASS Development Team, GRASS 8.5.0 Reference Manual


okay so that's the whole thing, and just so we're clear β€” this was GRASS 8.5.0, the manual name was v.reclass(1grass) all along, the source lives at the GRASS Development Team's manual (Β© 2003-2026, GRASS Development Team), and the latest change landed Friday Apr 17 01:04:26 2026 in commit 32a143358df26b2e518b03c7e0d79541e8d1e5b1. go forth and reclass, you absolute legend πŸ«ΆπŸ’–βœ¨

πŸ“¦ where this page comes from