LAYER¶

Inside a layer, only a single class will be used for the rendering of a feature. Each feature is tested against each class in the order in which they are defined in the mapfile. The first class that matches the its min/max scale constraints and its EXPRESSION check for the current feature will be used for rendering.

CLASSGROUP [string] Specify the class’s group that would be considered at rendering time. The CLASS object’s GROUP parameter must be used in combination with CLASSGROUP. CLASSITEM [attribute] Item name in attribute table to use for class lookups. CLUSTER

Signals the start of a CLUSTER object.

The CLUSTER configuration option provides to combine multiple features from the layer into single (aggregated) features based on their relative positions. Supported only for POINT layers.

Signals the start of a COMPOSITE object.

One or more COMPOSITE blocks can be used to signal that rendering should be done in a temporary image and merged onto the final map image in a final step. The options defined inside the COMPOSITE block will determine how this merging should be done (e.g. by appying opacity, composition operator, or pixel filters)

CONNECTION [string]

Database connection string to retrieve remote data.

An SDE connection string consists of a hostname, instance name, database name, username and password separated by commas.

A PostGIS connection string is basically a regular PostgreSQL connection string, it takes the form of “user=nobody password=****** dbname=dbname host=localhost port=5432”

An Oracle connection string: user/pass[@db]

Vector Data for specific connection information for various data sources.

See Kernel Density Estimation (Dynamic Heatmap) for specific connection information for kernel density estimation.

Type of connection. Default is local. See additional documentation for any other type.

Vector Data for specific connection information for various data sources. See Union Layer for combining layers, added in MapServer 6.0

See Kernel Density Estimation (Dynamic Heatmap) for specific connection information for kernel density estimation.

mygis is another connectiontype, but it is deprecated; please see the MySQL section of the Vector Data document for connection details.

DATA [filename]|[sde parameters][postgis table/column][oracle table/column]

Full filename of the spatial data to process. No file extension is necessary for shapefiles. Can be specified relative to the SHAPEPATH option from the Map Object.

If this is an SDE layer, the parameter should include the name of the layer as well as the geometry column, i.e. “mylayer,shape,myversion”.

If this is a PostGIS layer, the parameter should be in the form of “ from ”, where “columnname” is the name of the column containing the geometry objects and “tablename” is the name of the table from which the geometry data will be read.

For Oracle, use “shape FROM table” or “shape FROM (SELECT statement)” or even more complex Oracle compliant queries! Note that there are important performance impacts when using spatial subqueries however. Try using MapServer’s FILTER whenever possible instead. You can also see the SQL submitted by forcing an error, for instance by submitting a DATA parameter you know won’t work, using for example a bad column name.

Vector Data for specific connection information for various data sources.

DEBUG [off|on|0|1|2|3|4|5]

Enables debugging of a layer in the current map.

Debugging with MapServer versions >= 5.0:

Verbose output is generated and sent to the standard error output (STDERR) or the MapServer errorfile if one is set using the “MS_ERRORFILE” environment variable. You can set the environment variable by using the CONFIG parameter at the MAP level of the mapfile, such as:

CONFIG "MS_ERRORFILE" "/ms4w/tmp/ms_error.txt" 

You can also set the environment variable in Apache by adding the following to your httpd.conf:

SetEnv MS_ERRORFILE "/ms4w/tmp/ms_error.txt"

Once the environment variable is set, the DEBUG mapfile parameter can be used to control the level of debugging output. Here is a description of the possible DEBUG values:

You can also set the debug level by using the “MS_DEBUGLEVEL” environment variable.

The DEBUG setting can also be specified for the entire map, by setting the DEBUG parameter in the MAP object.

For more details on this debugging mechanism, please see MS RFC 28: Redesign of LOG/DEBUG output mechanisms .

Debugging with MapServer versions < 5:

Verbose output is generated and sent to the standard error output (STDERR) or the MapServer logfile if one is set using the LOG parameter in the WEB object. Apache users will see timing details for drawing in Apache’s error_log file. Requires MapServer to be built with the DEBUG=MSDEBUG option (–with-debug configure option).

Since 6.0, DUMP is not used anymore. LAYER METADATA is used instead.

Switch to allow MapServer to return data in GML format. Useful when used with WMS GetFeatureInfo operations. “false” by default.

Застаріло починаючи з версії 6.0: LAYER METADATA is used instead.

EXTENT [minx] [miny] [maxx] [maxy] The spatial extent of the data. In most cases you will not need to specify this, but it can be used to avoid the speed cost of having MapServer compute the extents of the data. An application can also possibly use this value to override the extents of the map. FEATURE Signals the start of a FEATURE object.

This parameter allows for data specific attribute filtering that is done at the same time spatial filtering is done, but before any CLASS expressions are evaluated. The string is simply a mapserver regular expression:

FILTER ([type]='road' and [size]2) 

Native filters are supported through the NATIVE_FILTER PROCESSING key:

PROCESSING 'NATIVE_FILTER=id=234'

Примітка

Until Mapserver 6, native filters could be specified as:

FILTER 'where >But this is no longer supported.

FILTERITEM [attribute] Item to use with simple FILTER expressions. OGR and shapefiles only. FOOTER [filename] Template to use after a layer’s set of results have been sent. Multiresult query modes only. GEOMTRANSFORM [|]

Used to indicate that the current feature will be transformed. Introduced in version 6.4.