v.reclass(1)

πŸ’– v.reclass β€” GRASS GIS User's Manual ✨

okay bestie, pull up a chair, we're doing vector reclassification today and honestly? it's giving glow-up. this is the v.reclass(1) page from the GRASS GIS User's Manual, and by the end of this you're gonna be changing category values like it's nothing. no cap. πŸ¦‹


🌸 NAME 🌸

v.reclass β€” changes vector category values for an existing vector map according to results of SQL queries or a value in attribute table column.

like. it takes your map's categories and gives them a whole new identity. main character energy fr. πŸ’…


πŸŽ€ 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 β€” Allow output files to overwrite existing files
  • --help β€” Print usage summary
  • --verbose β€” Verbose module output
  • --quiet β€” Quiet module output
  • --ui β€” Force launching GUI dialog

🌈 Parameters:

  • input=name [required] β€” Name of input vector map. Or data source for direct OGR access
  • layer=string β€” Layer number or name. Vector features can have category values in different layers. This number determines which layer to use. When used with direct OGR access this is the layer name. Default: 1
  • type=string[,string,...] β€” Input feature type. Options: point, line, boundary, centroid. Default: point,line,boundary,centroid
  • output=name [required] β€” Name for 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
  • rules=name β€” Full path to the reclass rule file

πŸ’œ DESCRIPTION πŸ’œ

so v.reclass lets you create a brand new vector map based on the reclassification of an existing one. that's the whole vibe. ✨

it ALSO lets you move the key column away from the default of "cat" β€” just say the word with the column option. iconic.

now, your rules file? each row is one of two things: either a pair β€”

keyword value

(separated by a space) β€” or a comment beginning with ’#’ (hash). okay so a new category definition starts with the keyword cat, followed by the new category value. and the keyword where specifies the SQL where condition. that's it, that's the whole grammar. πŸŽ€


πŸ‘‘ NOTES πŸ‘‘

listen, this part matters:

No table is created for the reclassed map if the column option is used and the column type is integer (as the result could contain ambiguities). πŸ‘€

But if the column option is used and the column type is string, a new table IS created β€” containing the newly generated cat numbers and a single column containing the unique string column values, sorted in alphabetical order. slay.

For dissolving common boundaries, see v.dissolve. πŸ¦‹

Either the rules or column option must be specified. one of them. you can't skip both, bestie. 😭

πŸ’… 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’

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

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

changed to category 1;

values selected from database by SQL select statement:

select id from tland where use = ’E14’

changed to category 2.

🌟 Example 2: Reclass by attribute column

(North Carolina sample dataset)

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

πŸ’€ KNOWN ISSUES πŸ’€

No table is created for reclassed layer if the rules option is used.

yeah. that's just how it is. noted. πŸ™ˆ

🧚 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)

Accessed: Saturday Jan 17 05:41:29 2026

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

Β© 2003-2025 GRASS Development Team, GRASS GIS 8.4.2 Reference Manual


and that's the whole page, bestie!! πŸ’– this was GRASS GIS 8.4.2, accessed Saturday Jan 17 05:41:29 2026, and yeah the footer said GRASS 8.4.2 and v.reclass(1) too β€” we love a consistent queen. go reclass something. periodt. βœ¨πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from