## NAME

d.what.s.pg - Report database attributes associated with a specific point location. (GRASS-RDBMS Attribute Interface Program)

## SYNOPSIS

d.what.s.pg
d.what.s.pg help
d.what.s.pg tab=name xcol=name ycol=name [xpos=value] [ypos=value] distance=value [hv=name]

## ALTERNATE

d.what.s.pg -s help
d.what.s.pg [-s] [sql=file] distance=value [hv=name]

## DESCRIPTION

d.what.s.pg reports database attributes in the currently selected database which are associated with a specific point location. The current database is identified by the GRASS environment variable $PG_DBASE which is set using the g.select.pg GRASS-RDBMS interface tool. The location to query is selected by the user with the mouse. The radius around this point to search is specified by the distance argument. Sites are selected by comparing the values in the database columns containing X and Y coordinate data against the coordinate data at the current mouse location.The columns in the table containing the coordinate values are returned in the report. If information from more than one table is required use the -s flag and the alternate command line format (see below). The user can also provide the center of the search point and the distance around it to find sites within the circle around the search center non-interactively.

## COMMAND LINE OPTIONS

### Parameters:

tab=databasetablename
  Table containing X, Y coordinate values
xcol=databasecolumnname
  Column containing the X coordinate (E/W) value.
ycol=databasecolumnname
  Column containing the Y coordinate (N/S) value.
distance=value
  Radius distance from the current mouse location to conduct database search.
xpos=value
  X coord. (E/W) of search.
ypos=value
  Y coord. (N/S) of search.
hv=name
  (h)Horizontal/(v)vertical output (default is v)

## ALTERNATE COMMAND LINE USAGE

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.

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

EXAMPLE 1. (single table)

d.what.s.pg -s sql=izb.sql distance=100

here izb.sql:

SELECT * from izb where point(xcoor,ycoor)

EXAMPLE 2. (two tables)

d.what.s.pg -s sql=izb2.sql distance=100

here izb2.sql:

SELECT *, huts_info.description from izb where huts_info.num=num and point(xcoor,ycoor)

### Flag:

-s
  SQL select statements are input from a prepared file.

### Parameters:

sql=filename
  SQL statements specifying well formed selection criteria. These criteria must include the database table name, the Xcol and Ycol names as well as the search distance. Additional criteria may be placed in the "where" clause to further subset information returned from the database.
distance=value
  Radius distance from the current mouse location to conduct database search.

hv=name

  (h)Horizontal/(v)vertical output (default is v)

## 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.v.pg, r.reclass.pg, r.rescale.pg, v.reclass.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)