USER'S GUIDE-Notes on the algorithms
|This application is
a sophisticated interface that ultimately creates an SQL query that
is submitted to the database. A query created in this way is composed
of standard SQL commands, but it also includes the names of procedures
hosted on the server. These procedures are activated when referenced
by a query. This type of procedure is called a "stored procedure."
The pages for spatial and temporal references and for depth references
use stored procedures. We will briefly describe the algorithm implanted
within the procedures so that you can understand how data are retrieved
in the catalogue.
|The coordinate pairs
that you enter are those of the upper left and lower right corners
of a rectangle, called respectively (x1, y1)
and (x2, y2) on Figure 1. The algorithm looks
for data that fall within the rectangle. The data are catalogued by
assigning them two pairs of coordinates. Depending on the data type,
these pairs of coordinates can have a variable interpretation. For
CTD data, these coordinates represent the positions at the start and
end of the profile. For a towed instrument such as an ADCP, a V-fin,
or a Batfish, the interpretation will be similar but the trajectory
relating the two points will be much more complex. Nevertheless, the
trajectory in both cases is considered as a straight line joining
the two points. When a single set of coordinates is available, those
of the end position are set equal to those of the start position.
Figure 1 illustrates four possible situations. Data having a spatial
reference like situation 3 would not be included while those similar
to situations 1, 2, and 4 would be intercepted by the search criteria.
The algorithm used is an adaptation of the one used in computer graphics
to determine the intersection between a straight line and a rectangle.
This algorithm is sometimes called the Cohen-Sutherland Algorithm.
Figure 1: Spatial search algorithm (Latitude-Longitude)
and depth references
|The pairs of coordinates
entered are those of the ends of a line representing a time or depth
interval. The two extremities are identified as T1 and T2 in Figure
2. When the data are catalogued, the start and end times as well as
the shallowest and deepest depths are noted. In Figure 2, the data
represented by situations 1, 2, and 3 would be retrieved by the search
criteria while situation 4 would not.
Figure 2: Temporal and depth search algorithm