SWIG MapScript API Reference¶
- Author:
Sean Gillies
- Author:
Steve Lime
- Contact:
steve.lime at dnr.state.mn.us
- Author:
Frank Warmerdam
- Contact:
warmerdam at pobox.com
- Author:
Umberto Nicoletti
- Contact:
umberto.nicoletti at gmail.com
- Author:
Tamas Szekeres
- Contact:
szekerest at gmail.com
- Author:
Daniel Morissette
- Contact:
dmorisette at mapgears.com
- Author:
Jeff McKenna
- Contact:
jmckenna at gatewaygeomatics.com
- Author:
Seth Girvin
- Contact:
sethg at geographika.co.uk
- Last Updated:
2023-06-13
Introduction¶
This documentation is for the MapScript interface to MapServer generated by SWIG.
To make the document as agnostic as possible, we refer to the following types: int, float, and string. There are yet no MapScript methods that return arrays or sequences or accept array or sequence arguments.
We will use the SWIG term immutable to indicate that an attribute’s value is read-only.
Note that because of the way that MapScript is generated many confusing, meaningless, and even dangerous attributes might be exposed by objects.
Avertissement
As of the MapServer 8.0.0 release PHP support is only available through MapServer’s SWIG API. The unmaintained native PHP MapScript support was removed.
Note
PHP support is included in the SWIG API as of the MapServer 7.4.0 release. PHP 8.2 and PHP 8.1 are currently supported with MapServer 8.0.1.
Appendices¶
Language-specific extensions are described in the following appendices
MapScript Classes¶
|
An object containing information about a DBF file |
Class for programming OWS services |
|
|
The CLASS object. |
The CLUSTER object. |
|
|
An object representing a color. |
|
This class allows inspection of the MapServer error stack. |
The FONTSET object |
|
An object to store key-value pairs |
|
|
An image object is a wrapper for images generated by MapServer. |
An individual feature label. |
|
Set of a map's cached labels. |
|
A cache slot to hold labels grouped by priority |
|
The LEADER object |
|
|
The LABEL object |
|
The LAYER object |
The LEGEND object |
|
|
|
|
The MAP object |
An individual marker. |
|
|
The OUTPUTFORMAT object |
|
A |
|
The PROJECTION object MapServer's Maps and Layers have Projection attributes, and these are C projectionObj structures, but are not directly exposed by the mapscript module |
The QUERYMAP object. |
|
|
A rectObj represents a rectangle or bounding box. |
The REFERENCE object |
|
|
A holder object for projection coordinate transformations, introduced in RFC 126. |
A cached result object |
|
|
The result object is a handle, of sorts, for a feature of the layer |
An individual value within the SCALETOKEN object |
|
The SCALETOKEN object |
|
The SCALEBAR object |
|
|
Each feature of a layer's data is a |
|
An object representing a Shapefile. |
|
The STYLE object. |
|
The SYMBOL object |
|
A |
|
The WEB object. |
MapScript Functions¶
|
Allow Python to access the directory containing the MapServer DLL (for Python on Windows only) |
|
Creates map objects from mapfile strings. |
|
Attempts to recover all dynamically allocated resources allocated by MapServer code and dependent libraries. |
|
Some memory leaks can be avoided by closing any unreferenced connections from time to time. |
|
Generic function to free a imageObj |
|
Get the MapServer error object |
|
Return a string of all errors |
|
Returns a string containing MapServer version information, and details on what optional components are built in - the same report as produced by |
|
Returns the MapServer version number (x.y.z) as an integer (x*10000 + y*100 + z) e.g. V7.4.2 would return 70402. |
|
Strip off all MIME headers and return them in a hashTableObj |
|
Fetch the current stdout buffer contents as a binary buffer. |
|
Fetch the current stdout buffer contents as a string. |
|
Installs a mapserver IO handler directing future stdin reading (i.e. post request capture) to come from a buffer. |
|
Installs a mapserver IO handler directing future stdout output to a memory buffer. |
|
Resets the default stdin and stdout handlers in place of buffer based handlers. |
|
Strip all Content-* headers off the stdout buffer if it has any. |
|
Strip the Content-type header off the stdout buffer if it has one, and if a content type is found it is returned (otherwise NULL/None/etc). |
|
Sets up string-based mapfile loading and calls loadMapInternal to do the work |
|
Clear the list of error objects |
|
Saves a map image to a file |
|
Sets up threads and font cache - called when MapScript is initialised |
MapScript Constants¶
Align¶
|
|
Allocations¶
Comparison¶
Compop¶
|
|
Config¶
|
|
Connection¶
Db Connection¶
|
Dbf Fields¶
|
|
Debug¶
Error¶
|
|
|
File¶
|
|
Font Type¶
|
|
Function¶
|
Geos¶
Image Mode¶
Join¶
|
|
Label Binding¶
Label Offset¶
|
|
Label Size¶
|
Layer¶
Legend¶
|
|
Limiters¶
|
|
Line Join¶
Logical Control¶
Measure Shape¶
Missing¶
Parse¶
|
|
Position¶
Projections¶
|
|
|
Query Mode¶
|
|
|
Query Type¶
Render¶
Render Mode¶
|
|
Request Type¶
|
|
Return Codes¶
|
|
|
Scalebar¶
Shapefile¶
|
Shape Type¶
|
|
Style Binding¶
Style Offset¶
|
|
Symbol¶
Token Binding¶
Token Literal¶
|
Token Logical¶
|
|
|
Transform¶
|
Units¶
Version¶
|
|