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 typeintegerorstring, 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
columnoption and the column type isintegerβ because the result could contain ambiguities. the drama of it all π - If you use the
columnoption and the column type isstring, 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
rulesor thecolumnoption 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.reclasstov.db.reclassand later tov.reclassin5.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
- 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