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



NNAAMMEE
       _d_._w_h_a_t_._r_._p_g - Report database attributes associated with a raster cate-
       gory value at a specified location.  (GRASS-RDBMS  Attribute  Interface
       Program)

SSYYNNOOPPSSIISS
       dd..wwhhaatt..rr..ppgg

       dd..wwhhaatt..rr..ppgg hheellpp

       dd..wwhhaatt..rr..ppgg mmaapp_=_n_a_m_e ttaabb_=_n_a_m_e ccooll_=_n_a_m_e [hhvv=name]



AALLTTEERRNNAATTEE
       dd..wwhhaatt..rr..ppgg --ss hheellpp

       dd..wwhhaatt..rr..ppgg --ss ssqqll_=_f_i_l_e_n_a_m_e mmaapp_=_n_a_m_e

DDEESSCCRRIIPPTTIIOONN
       _d_._w_h_a_t_._r_._p_g  reports  database  attributes  from the currently selected
       database associated with a raster category at a specific location on  a
       raster  map. 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. The current raster loca-
       tion  is  selected by the user with the mouse. 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. Using
       the _-_s option the attributes from more than one table can  be  returned
       and displayed.

CCOOMMMMAANNDD LLIINNEE OOPPTTIIOONNSS
   PPaarraammeetteerrss::
       mmaapp==mmaapp
	   Name  of  an existing raster map with category values linked to the
	   currently selected database.

       ttaabb==ddaattaabbaasseettaabblleennaammee
	   Table in the currently selected database containing a column  asso-
	   ciated with raster category values.

       ccooll==ddaattaabbaasseeccoolluummnnnnaammee
	   Column associated with raster category values.

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


AALLTTEERRNNAATTEE CCOOMMMMAANNDD LLIINNEE UUSSAAGGEE
       The alternate command line usage is provided to simplify the process of
       retrieving information from more than one table in the query  criteria.
       The  alternate  command	line  structure is selected using the the _[_-_s_]
       flag on the command line. When using this flag the  user  must  include
       the  name  of  a  text file on the command line as well. This file must
       include a complete, well formed SQL  SELECT  statement  specifying  the
       query  criteria	needed to retrieve values which correspond to category
       values in a GRASS data layer.

       The user must also specify the name of the GRASS data layer  containing
       these  category	values	on  the  command  line. The following examples
       illustrate the syntax which must  be  used  in  constructing  a	SELECT
       statement for use with the _-_s flag.

       EEXXAAMMPPLLEE::

       11.. _d_._w_h_a_t_._r_._p_g _-_s _s_q_l_=_r_a_s_t_e_r_._s_q_l _m_a_p_=_b_l_a_g___f_o_r_e_s_t___k_u_r

       and raster.sql is:

       _s_e_l_e_c_t _r_e_c___i_d_, _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 _t_y_p_e___i_d _= _?

       RReessuulltt::

       Reports	two  fields  from  the	table  info_kuruma associated with the
       raster category value at the current mouse location the raster map.

       22.. _d_._w_h_a_t_._r_._p_g _-_s _s_q_l_=_r_a_s_t_e_r_2_._s_q_l _m_a_p_=_b_l_a_g___f_o_r_e_s_t___k_u_r

       and raster2.sql is:

       _s_e_l_e_c_t _r_e_c___i_d_, _t_y_p_e___i_d_, _c_e_n_s_u_s___i_n_f_o_._t_y_p_e___g_o_o_d  _f_r_o_m  _i_n_f_o___k_u_r_u_m_a  _w_h_e_r_e
       _t_y_p_e___i_d _= _? _a_n_d _r_e_c___i_d _= _c_e_n_s_u_s___i_n_f_o_._r_e_c___i_d

       RReessuulltt::

       Reports	fields	from two tables info_kuruma and census_info associated
       with the raster category value at the current mouse location the raster
       map.

       33.. _d_._w_h_a_t_._r_._p_g _-_s _k_u_r___r_a_s_t___i_d _s_q_l_=_p_r_o_c_e_s_s_._s_q_l

       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 census_info 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.



   FFllaagg::
       --ss  SQL select statements are input from a prepared file.


   PPaarraammeetteerrss::
       ssqqll==ffiilleennaammee
	   SQL statements specifying well formed selection criteria.

       mmaapp==mmaapp
	   Name of an existing raster map with category  values  linked  to  a
	   database.

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


BBUUGGSS
       None known.

NNOOTTEE
       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_._s_._p_g_, _d_._w_h_a_t_._v_._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.r.pg(1)
