mapscriptsupp.tcl


Mapscript Supplemental Procedures

Usage

These procedures allow methods to be invoked on object references (i.e., pointers), without having to convert a reference into an object. A valid object reference is required; procedures check for valid object types.

General syntax:

objectRefProc $objectPtr args

Sample:

set map [mapscript::mapObj -args $mapFile]
set rectPtr [$map cget -extent]
set minx [mapscript::rectObjRef $rectPtr cget -minx]
set miny [mapscript::rectObjRef $rectPtr cget -miny]

Notes: each of the objectRef procedures is just a shortcut to invoke a SWIG generated method name. Method names of:

invoke that object's cget, configure, and delete method respectively.

Example:

mapscript::rectObjRef $rectPtr cget -minx
is equivalent to:
mapscript::rectObj_minx_get $rectPtr

Mapscript Convenience Procedures

Usage

mapscript::getDBFNames DBFInfo_handle
getDBFNames returns a list of field names from a DBF file handle. The DBFInfo_handle must be a valid DBFInfo handle returned from the DBFInfo constructor.

mapscript::getDBFTypes DBFInfo_handle
getDBFTypes returns a list of field types and lengths from a DBF file handle. The DBFInfo_handle must be a valid DBFInfo handle returned from the DBFInfo constructor. Each list element is itself a list of field type and field length. Valid field types are returned as: string, integer, and double.

mapscript::getDBFValues DBFInfo_handle record_number
getDBFValues returns a list of field values from a DBF file handle. The DBFInfo_handle must be a valid DBFInfo handle returned from the DBFInfo constructor. Record_number is the record number of the row to fetch.

mapscript::getQueryInfo mapObj_pointer layerObj_pointer
getQueryInfo returns a list of name-value pairs from a layer that map query has generated. mapObj_pointer and queryObj_pointer must be valid mapObj and layerObj pointers.


See also

See mapscript_wrap.html for the full Mapscript Tcl interface.

Note also that the Mapscript objects described in mapscript_wrap.html are defined in the mapscript namespace.

Tom Poindexter
tpoindex@nyx.net