Data Selection and Retrieval Commands

Similar to SQL concepts, once a data source has been defined, a query may be made to select particular parts of the data source resulting in graphic primitives. The form of selection is very much translator-specific, in fact some translators do not even need to create a query since the only selection option is to select the whole data source. Each translator will have its own syntax for the select command.

A geometric constraint can be specified to restrict the fetched data to a specific area. Only graphic primitives which clash with the area are fetched. This is done via the box command. Note that the box command does not clip graphic primitives. A box command may occur in a startup script, in which case it will be applied at the beginning of each client session.

When a query selects non-graphic attributes (meta-data) as well as graphics, a client class must be constructed. This will be done automatically when the data is fetched, but usually the client wants to control this process and so issues the set_class command before fetching the data. This requests that the translator send column details to the client to create a client class. The client provides a name for the class.

Once data has been selected, it can be fetched and sent to the client as an eim output stream. The objfetch or draw commands perform this function. Database interfaces also support the standard SQL fetch command.

select

select {* | <column>, <column>, …} from <table> where <condition>

Constructs a query to be subsequently run by a fetch command against the current data source resulting in a set of graphic primitives with or without meta-data to be sent to the client in the eim output stream. The syntax of this command is translator-specific. The definition above is typical for coverage-based translators.

box or clip

box <xmin> <ymin> {<zmax>} <xmax> <ymax> {<zmax>}

clip <xmin> <ymin> {<zmax>} <xmax> <ymax> {<zmax>}

Defines a clipping region to impose geometric constraints on the selection. The region may be 2 or 3-D. Only primitives which clash with the region are subsequently fetched. The parameters may be enclosed within parentheses or comma-separated.

Multiple sets of clipping regions may be provided by adding extra pairs of co-ordinate sets to the command line.

ignore_box or ignore_clip

ignore_box <xmin> <ymin> {<zmax>} <xmax> <ymax> {<zmax>}

ignore_clip <xmin> <ymin> {<zmax>} <xmax> <ymax> {<zmax>}

Defines an inverse clipping region to impose geometric constraints on the selection. The region may be 2 or 3-D. The inverse clipping region is added to the standard clipping region (defined by the box command) to remove areas from the total.

Multiple sets of inverse clipping regions may be provided by adding extra pairs of co-ordinate sets to the command line.

set_class

set_class <client_class_name>

Construct a client class from the current query. This class definition is passed to the client in the eim output stream. If an attempt is made to fetch data with attributes without first setting a class, the translator will derive a class name itself and pass it to the client.

objfetch

objfetch {into} <client_name>

Fetch the data and send to the client for storage. The client will display it and store it locally as an array of objects the class of which was previously defined by the set_class command. If <client_name> is provided, it provides a name for the array.

draw

draw

Fetch the data and send to the client for draw only purposes. The client will display it and then forget about it.

Running example

Client session:

# Fetch base polygons (no meta-data)
select from austwater.pat
box (6250000,2050000),(6850000,2650000)
objfetch
 
# Fetch town points (with meta-data)
select mctown-id, state from mctown.pat where population > 10000
# Same box still applies
set_class ~arc.mctowns_t
objfetch into mctowns