QUERY_LAYER_METADATA

The QUERY_LAYER_METDATA command allows a layer metadata value to be stored in a script variable. The user needs to identify the layer based on its file name (or layer description) and the metadata attribute based on the name it has when displayed via the Control Center. The following parameters are supported by this command:

  • RESULT_VAR - specifies the name of the script variable where the metadata will be stored.
  • METADATA_LAYER - identifies the layer from which the metadata will be copied. This is the same value that would be passed to the FILENAME parameter on the IMPORT command used to load the layer.
  • METADATA_ATTR - This is the string used to identify the metadata from which the value will be copied. The complete list of metadata attribute names for a layer can be seen by clicking the Metadata... button on the Control Center, or by running the EXPORT_METADATA command and looking at the result file. Some example metadata attributes are "UPPER LEFT X", "AREA COUNT", "PROJ_DESC", etc.

SAMPLE

Example: Stores the layer's DESCRIPTION metadata in a variable called %DESC%:

DEFINE_VAR NAME="LAYER" VALUE="P:\Data\Areas.shp"
IMPORT FILENAME="%LAYER%" TYPE="SHAPEFILE"
QUERY_LAYER_METADATA METADATA_LAYER="%LAYER%" METADATA_ATTR="DESCRIPTION" RESULT_VAR="DESC"