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] sql=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 exclusive SQL retrieve statments
designed to return groups of records from the database. Each group of
records should be internally consistent in terms of attribute
characteristics 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
original 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:
- sql=filename
- Name of file containing SQL query statements
- key=databasecolumnname
- Key column in db
- tab=name
- Table containing [col]
- col=name
- Column to base reclass on
- where=name
- Where clause for query (ie. where col='paved')
- type=area/line/site
- 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 sql=vect.sql key=tlid input=t.roads.pg output=t.roads.12
vect.sql:
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 modifications: Janne Soimasuo, Faculty of Forestry, University of
Joensuu, Finland.