v.reclass.pg

NAME

v.reclass.pg - Generate new vector map layer derived from attribute data in the currently selected database. (GRASS-RDBMS Vector Interface Program)

SYNOPSIS

v.reclass.pg
v.reclass.pg help
v.reclass.pg [-d] pql=name key=name type=name input=name[output=name]

DESCRIPTION

v.reclass.pg generates a new vector map layer based on the results of one or more queries to the currently selected database. The user constructs a series of mutually exclu­sive postQUEL retrieve statments designed to return groups of records from the database. Each group of records should be internally consistent in terms of attribute character­istics specified by the user in the retrieve clause. These groups should also be mutually exclusive, thereby insuring that a row returned by one retrieve clause is not also returned by a subsequent retrieve clause. Each group of records therefore forms the basis for a single category in the resulting GRASS vector map. v.reclass.pg processes each retrieve statement in order returning groups of records which will form a single category in the resulting map. As each retrieve statement is processed the group of records returned receives a common category value. The category value is incremented by one for each subsequent retrieve statment which is processed. The resulting reclass map will have one category for each of the origi­nal retrieve statements.

For example, the rows associated with the first retrieve statement will be assigned to category 1, those associated with the second retrieve statement will be assigned to category 2 and so on. The output map will contain only those line segments associated with database rows returned by the retrieve statement(s).

COMMAND LINE OPTIONS

Flag:

-d
Disolve common boundaries between reclassed areas

Parameters:

pql=filename
Name of file containing postQUEL query statements

key=databasecolumnname
Key column in db

type=area/line
Key column in db

input=map
Name of existing vector file to be reclassed using query output.

output=map
Name of new raster (reclass) file

EXAMPLE: produces vector map of primary and secondary roads.

v.reclass.pg pql=vect.pql key=tlid input=t.roads.pg out­put=t.roads.12

vect.pql: retrieve unique (t.tlid,t.cfcc) from t in type1
where cfcc ~ "A1"
sort by tlid

retrieve unique (t.tlid,t.cfcc) from t in type1
where cfcc ~ "A2"
sort by tlid

BUGS

None known.

NOTE

This program requires the Postgres database software.

SEE ALSO

g.column.pg, g.select.pg, g.stats.pg, g.table.pg, d.rast.pg, d.site.pg, d.vect.pg, d.what.r.pg, d.what.s.pg, d.what.v.pg, r.reclass.pg, r.rescale.pg

AUTHOR

Original Informix SQL-tools: James A. Farley, Wang Song, and W. Fredrick Limp University of Arkansas, CAST

Postgres modifications: Janne Soimasuo, Faculty of Forestry, University of Joensuu, Finland.

Updated to GRASS 5 by Alex Shevlakov (sixote@yahoo.com)