The GIS Procedure

LATTICE Statement

Defines the relationships between areas in a spatial database.

Syntax

LATTICE operation outer-composite-name-1 ENCLOSES inner-composite-name-1
<...outer-composite-name-n ENCLOSES inner-composite-name-n>
<_UNIVERSE_ ENCLOSES inner-composite-name>;

Operations

You must specify one of the following values for the operation keyword:

CONTENTS
prints information about the lattice hierarchy in the current spatial entry to the Output window.
Restriction:No additional arguments are used with the CONTENTS operation.
CREATE
creates a new lattice hierarchy in the current spatial entry. An error occurs if the spatial entry already contains a lattice. Use the REPLACE operation to replace an existing lattice.
DELETE
removes the lattice hierarchy from the current spatial entry.
Restriction:No additional arguments are used with the DELETE operation.
REPLACE
overwrites the lattice hierarchy in the current spatial entry or creates a new lattice hierarchy if one does not exist.

Lattice Definition Arguments

outer-composite-name ENCLOSES inner-composite-name
outer-composite-name
is the name of an area composite that geographically contains other enclosed area composites.
inner-composite-name
is the name of an area composite that is geographically within the polygonal areas defined by the outer-composite-name.
Requirement:The composites specified for outer-composite-name and inner-composite-name must have the CLASS attribute AREA (or one of the political subdivision area classes such as COUNTRY, STATE, or COUNTY).
Note:You can substitute the characters -> for the ENCLOSES keyword.
_UNIVERSE_ ENCLOSES inner-composite-name
inner-composite-name
is the name of a single area composite that is not contained by another composite and that does not itself enclose any other areas.
Requirement:The composite specified for inner-composite-name must have the CLASS attribute AREA (or one of the political subdivision area classes such as COUNTRY, STATE, or COUNTY).
Note:You can substitute the characters -> for the ENCLOSES keyword.

Details

The LATTICE statement defines which areas enclose other smaller areas (such as states enclose counties). When a lattice hierarchy is defined, the area composite values for new points are assigned automatically as the points are added to the map. The composite values are also reevaluated automatically when an existing point is moved to a new location. A lattice definition also makes it possible to simultaneously assign attribute values to all points in a point layer by setting area attributes in the GIS Layer window. Area attributes cannot be assigned to new points, moved points, geocoded points, or imported points unless a lattice has been defined.
The lattice definition is written to the current spatial entry. An error occurs if you submit a LATTICE statement when no spatial entry is currently selected.
Note: Because the LATTICE statement uses composites, you must include a RUN statement following a COMPOSITE statement. This ensures that the composite is created before the LATTICE statement executes and attempts to use the composite.
The LATTICE statement checks lattice definitions for circular references. For example, a lattice definition of the following form would cause an error:
LATTICE A ENCLOSES B
        B ENCLOSES C
        C ENCLOSES B;

Examples

Example 1: Single Hierarchy

For a lattice hierarchy that comprises several composites, the general form of the LATTICE statement is
LATTICE CREATE A ENCLOSES B
B ENCLOSES C
C ENCLOSES D;
Assume that the spatial database contains states that are subdivided into counties, that the counties are further subdivided into tracts, that the tracts are further subdivided into blocks, and that corresponding composites are defined for each. The following code fragment defines the lattice for the spatial database:
lattice create state encloses county
    county encloses tract
    tract encloses block;

Example 2: Multiple Hierarchies

You can define more than one lattice hierarchy for a spatial database, for example, when the map has overlapping AREA-type composites that are not related. A single LATTICE statement is used, but the GIS procedure recognizes the break between the two hierarchies, as follows:
lattice create state  encloses county /* first lattice */
               county encloses tract  /* first lattice */
               tract  encloses block  /* first lattice */
               mall   encloses store; /* second unrelated lattice */

Example 3: Single-Element Lattice

If the map has only one AREA-type composite, it is called a universe-enclosed association. Use the _UNIVERSE_ keyword to define a lattice for a universe-enclosed association, as follows:
lattice create _universe_ encloses tract;
It is possible to have more than one set of unrelated AREA composites, for example, a spatial entry containing counties and telephone area codes. The lattice hierarchy would then be defined as:
lattice create _universe_ encloses AreaCode
               _universe_ encloses County;