NAME
v.to.db - Load values from vector to database.
SYNOPSIS
v.to.db
v.to.db help
v.to.db [-ps] map=string [type=string[,string,...]] [field=integer] [qfield=integer] option=string [units=string] [col1=string] [col2=string] [qcol=string]
Flags:
- -p
- print only
- -s
- print only sql statements
Parameters:
- map=string
- Name of input vector
- type=string
- Type of elements (for coor valid point/centroid, for length valid line/boundary)
- Options: point,line,boundary,centroid
- Default: point,line,boundary,centroid
- field=integer
- Field value
- Default: 1
- qfield=integer
- Query field. Used by 'query' option.
- Default: 1
- option=string
- Uploaded value:
cat - insert new row for each category if doesn't exist yet
area - area size
length - line length
count - number of features for each category
coor - point coordinates
query - result of a database query for all records of the geometry
(or geometries) from table specified by 'qfield' option
- Options: cat,area,length,count,coor,query
- units=string
- mi(les),f(eet),me(ters),k(ilometers),a(cres),h(ectares)
- Options: mi,miles,f,feet,me,meters,k,kilometers,a,acres,h,hectares
- col1=string
- column 1
- col2=string
- column 2
- qcol=string
- Query column used for 'query' option. E.g. 'cat', 'count(*)', 'sum(val)'
DESCRIPTION
v.to.db load values from vector to database.
NOTES
The units 'miles', 'feet', 'meters' and 'kilometers' are square
for option=area.
EXAMPLES
Updating attribute tables
Note: Uploading of the attributes of a vector map to the DBMS has to be done
column-wise. The column must be present in the table
(use db.execute to add a new column if needed).
Upload category numbers to attribute table (used for new map):
v.to.db map=soils type=area option=cat
Upload area sizes of each polygon to attribute table:
v.to.db map=soils type=area option=area col1=area_size unit=h
Upload x and y coordinates from vector geometry to attribute table:
v.to.db map=pointsmap option=coor col1=x col2=y
Printing reports
Report all area sizes of a map:
v.to.db -p soils option=area type=boundary units=h
Report all area sizes of a map, sorted by category number:
v.to.db -p soils option=area type=boundary units=h | sort -n
Report all area sizes of a map:
v.to.db -p roads option=length type=line units=k
Report number of featurs for each category in map:
v.to.db -p roads option=count type=line
AUTHOR
Radim Blazek
Last changed: $Date: 2004/05/26 11:38:17 $
Help Index