d.what.v.pg(1)		      Grass User's Manual		d.what.v.pg(1)



NNAAMMEE
       _d_._w_h_a_t_._v_._p_g  -  Report  database attributes associated with vector fea-
       tures.



SSYYNNOOPPSSIISS::
       dd..wwhhaatt..vv..ppgg [[--ff]] mmaapp==name ttaabb==name ccooll==name [[ccoolloorr==name]]

	  [[ffiillllccoolloorr==name]] [[hhvv==name]]

       dd..wwhhaatt..vv..ppgg [[--ssff]] ssqqll==file mmaapp==name [[ccoolloorr==name]] [[ffiillllccoolloorr==name]]

	  [[hhvv==nnaammee]]



DDEESSCCRRIIPPTTIIOONN
       FFllaaggss::

       -s   Use [-s] for SQL command file input.

       -f   Fill polygons?

       PPaarraammeetteerrss::

       ssqqll Name of the SQL command file

       mmaapp Vector map to run query on

       ttaabb Postgres table with categories

       ccooll Column with categories from this table

       ccoolloorr Selected lines color default: yellow

       ffiillllccoolloorr Selected areas  color	(for  fill)  options:  red,orange,yel-
       low,green,blue,indigo,white,black,brown, 	magenta,aqua,gray,grey
       default: gray

       hhvv Type of database output - [h/v] default: v









       ttaabb is Postgres table containing column linked to vector attribute val-
       ues,  ccooll - column associated with vector attribute values, mmaapp is name
       of an existing vector map with attribute values linked to the currently
       selected database.

       Reports	database attributes from the currently selected database which
       are associated with  specific  vector  features	identified  using  the
       mouse.	The  currently	selected  database  is identified by the GRASS
       environment variable $PG_DBASE  which  is  set  using  the  _g_._s_e_l_e_c_t_._p_g
       GRASS-RDBMS interface tool. If this environment variable is not set the
       program terminates with a message to the user. If the alternate form of
       this  command is selected with the _-_s flag the user has greater control
       over the manner in which the attribute information is displayed.

       _d_._w_h_a_t_._v_._p_g is used to query lines/areas with mouse. Like  _d_._w_h_a_t_._v_e_c_t,
       it  lists  attributes and optionally fills queried areas (like v.area).
       It may be used for the UPDATE command in Postgres through the input SQL
       file  (see  Example  2). The idea is to prepare an arbitrary algorithm,
       code it in SQL, and then update DB with clicking on chosen polys/lines.
       You  may  consider this as piping  through various filters anything you
       select on screen.

       The database information can be optionally  output  as  comma-separated
       list  (horizontal) which is convenient for feeding it to other programs
       like table editors.



       EEXXAAMMPPLLEE::

       11.. _d_._w_h_a_t_._v_._p_g _-_s _s_q_l_=_c_e_n_s_u_s_._s_q_l _m_a_p_=_c_e_n_s_u_s

       and census.sql is:

       _s_e_l_e_c_t _s_l_o_p_e_, _t_y_p_e___i_d _f_r_o_m _i_n_f_o___k_u_r_u_m_a _w_h_e_r_e _r_e_c___i_d _= _?

       RReessuulltt:: only two fields information is displayed  on  screen  when  the
       mouse is clicked upon the vector object.

       22.. _d_._w_h_a_t_._v_._p_g _-_s _s_q_l_=_p_r_o_c_e_s_s_._s_q_l _m_a_p_=_c_e_n_s_u_s

       process.sql is:

       _u_p_d_a_t_e	_c_e_n_s_u_s___i_n_f_o   _s_e_t  _t_y_p_e___g_o_o_d  _=  _'_1_'  _w_h_e_r_e  _r_e_c___i_d  _=	_?  _a_n_d
       _i_n_f_o___k_u_r_u_m_a_._t_y_p_e___i_d _= _3_5 _a_n_d _i_n_f_o___k_u_r_u_m_a_._r_e_c___i_d _= _r_e_c___i_d_;

       RReessuulltt:: this would only change field of the _c_e_n_s_u_s___i_n_f_o table  for  the
       clicked polygon or line,

       if  the	corresponding type taken from _i_n_f_o___k_u_r_u_m_a table is equal to 35
       (the last limitation is a filter for any polygon/line picked  from  the
       map with mouse) .

       FFllaaggss:: SQL select statements are input from a prepared file.

       PPaarraammeetteerrss::  SQL  statements specifying well formed selection criteria.
       Name of an existing vector map.

BBUUGGSS
       1.  Tcl-Tk modules require input "where" clause restricted to one  rule
       typed without "whitespaces",

       (unlike terminal input where number of subclause is not limited).

       This program requires the Postgres database software.

SSEEEE AALLSSOO
       _g_._s_e_l_e_c_t_._p_g_,  _g_._s_t_a_t_s_._p_g_,  _g_._t_a_b_l_e_._p_g_, _d_._r_a_s_t_._p_g_, _d_._s_i_t_e_._p_g_, _d_._v_e_c_t_._p_g_,
       _d_._w_h_a_t_._r_._p_g_, _d_._w_h_a_t_._s_._p_g_, _r_._r_e_c_l_a_s_s_._p_g_, _r_._r_e_s_c_a_l_e_._p_g_, _v_._r_e_c_l_a_s_s_._p_g

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



GRASS 5.0							d.what.v.pg(1)
