-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmap.html
More file actions
620 lines (579 loc) · 34 KB
/
map.html
File metadata and controls
620 lines (579 loc) · 34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
<!DOCTYPE html>
<html lang="en" data-content_root="../">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" />
<title>MAP — MapServer 8.6.2 documentation</title>
<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=03e43079" />
<link rel="stylesheet" type="text/css" href="../_static/sphinx.css?v=48f05237" />
<link rel="stylesheet" type="text/css" href="../_static/copybutton.css?v=76b2166b" />
<link rel="stylesheet" type="text/css" href="../_static/sphinx_collapse.css?v=226d88b4" />
<link rel="stylesheet" type="text/css" href="../_static/custom.css?v=dd298242" />
<link rel="stylesheet" type="text/css" href="../_static/ribbon.css?v=ea091bf4" />
<script src="../_static/jquery.js?v=5d32c60e"></script>
<script src="../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
<script src="../_static/documentation_options.js?v=9a6d5eae"></script>
<script src="../_static/doctools.js?v=fd6eb6e6"></script>
<script src="../_static/sphinx_highlight.js?v=6ffebe34"></script>
<script src="../_static/clipboard.min.js?v=a7894cd8"></script>
<script src="../_static/copybutton.js?v=f281be69"></script>
<link rel="icon" href="../_static/mapserver.ico"/>
<link rel="author" title="About these documents" href="../about.html" />
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="copyright" title="Copyright" href="../copyright.html" />
<link rel="next" title="OUTPUTFORMAT" href="outputformat.html" />
<link rel="prev" title="LEGEND" href="legend.html" />
</head><body>
<!-- for main branch only, do not backport this -->
<table width="100%" style="width: 100%; background-color: white;">
<tr>
<td rowspan="2" style="padding: 10px 0px 10px 10px;">
<a href="../index.html" title="Home"><img src="../_static/banner.png" alt="MapServer banner" border="0" /></a>
</td>
<td style="padding: 10px 10px 0px 0px; text-align: right; vertical-align: top;">
<a href="../index.html" title="Home">Home</a> |
<a href="../products.html" title="Products (MapServer core, MapCache, TinyOWS">Products</a> |
<a href="https://github.com/mapserver/mapserver/issues/" title="Issue Tracker (MapServer core)">Issue Tracker</a> |
<a href="../community/service_providers.html" title="Professional Service Providers">Service Providers</a> |
<a href="../faq.html" title="Frequently Asked Questions">FAQ</a> |
<a href="https://fosstodon.org/@mapserver" title="Mastodon" target="_blank">Mastodon</a> |
<a href="../download.html" title="Download Source or Binaries">Download </a> |
<a class="badge" href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=KRJ2X44N3HA6U&source=url" target="_blank">
<img src="https://img.shields.io/badge/donate-%E2%9D%A4%C2%A0-ff69b4.svg?style=flat" alt="Donate to MapServer">
</a>
</td>
</tr>
<tr>
<td style="padding: 0px 10px 0px 0px; text-align: right; vertical-align: bottom;">
<img src="../_static/flagicons/en.png" alt="en" title="en" border="0" width="18px" height="13px"/>
<a href="../ar/mapfile/map.html"><img src="../_static/flagicons/ar.png" alt="ar" title="ar" border="0" /></a>
<a href="../de/mapfile/map.html"><img src="../_static/flagicons/de.png" alt="de" title="de" border="0" /></a>
<a href="../el/mapfile/map.html"><img src="../_static/flagicons/el.png" alt="el" title="el" border="0" /></a>
<a href="../es/mapfile/map.html"><img src="../_static/flagicons/es.png" alt="es" title="es" border="0" /></a>
<a href="../fr/mapfile/map.html"><img src="../_static/flagicons/fr.png" alt="fr" title="fr" border="0" /></a>
<a href="../id/mapfile/map.html"><img src="../_static/flagicons/id.png" alt="id" title="id" border="0" /></a>
<a href="../it/mapfile/map.html"><img src="../_static/flagicons/it.png" alt="it" title="it" border="0" /></a>
<a href="../ja/mapfile/map.html"><img src="../_static/flagicons/ja.png" alt="ja" title="ja" border="0" /></a>
<a href="../nl_NL/mapfile/map.html"><img src="../_static/flagicons/nl_NL.png" alt="nl_NL" title="nl_NL" border="0" /></a>
<a href="../pl/mapfile/map.html"><img src="../_static/flagicons/pl.png" alt="pl" title="pl" border="0" /></a>
<a href="../ru/mapfile/map.html"><img src="../_static/flagicons/ru.png" alt="ru" title="ru" border="0" /></a>
<a href="../sq/mapfile/map.html"><img src="../_static/flagicons/sq.png" alt="sq" title="sq" border="0" /></a>
<a href="../tr/mapfile/map.html"><img src="../_static/flagicons/tr.png" alt="tr" title="tr" border="0" /></a>
</td>
</tr>
</table>
<div class="related" role="navigation" aria-label="Related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="outputformat.html" title="OUTPUTFORMAT"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="legend.html" title="LEGEND"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="../index.html">Home</a> »</li>
<li class="nav-item nav-item-1"><a href="../documentation.html" >MapServer 8.6.2 Documentation</a> »</li>
<li class="nav-item nav-item-2"><a href="index.html" accesskey="U">Mapfile</a> »</li>
<li class="nav-item nav-item-this"><a href="">MAP</a></li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<section id="map">
<span id="index-0"></span><span id="id1"></span><h1>MAP<a class="headerlink" href="#map" title="Link to this heading">¶</a></h1>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>The map object is started with the word <cite>MAP</cite>, and ended with the
word <cite>END</cite>.</p>
</div>
<img alt="../_images/map_classes.png" class="align-center no-scaled-link" height="234" src="../_images/map_classes.png" width="1024" />
<dl class="simple" id="mapfile-map-angle">
<dt>ANGLE [double]</dt><dd><p>Angle, given in degrees, to rotate the map. Default is 0, and must be in the range
-360 to 360. The rendered map will rotate in a clockwise direction. The following
are important notes:</p>
<ul class="simple">
<li><p>Requires a <a class="reference internal" href="projection.html#projection"><span class="std std-ref">PROJECTION</span></a> object specified at the MAP level
and for each <a class="reference internal" href="layer.html#layer"><span class="std std-ref">LAYER</span></a> object (even if all layers are in the
same projection).</p></li>
<li><p>Requires <a class="reference internal" href="../mapscript/index.html#mapscript"><span class="std std-ref">MapScript</span></a> (<a class="reference internal" href="../mapscript/mapscript-api/index.html#swig"><span class="std std-ref">SWIG</span></a>,
<a class="reference internal" href="../mapscript/php/index.html#php-mapscript"><span class="std std-ref">PHP MapScript</span></a>). Does not work with
<a class="reference internal" href="../cgi/index.html#cgi"><span class="std std-ref">CGI</span></a> mode.</p></li>
<li><p>If using the <a class="reference internal" href="label.html#label"><span class="std std-ref">LABEL</span></a> object’s ANGLE or the <a class="reference internal" href="layer.html#layer"><span class="std std-ref">LAYER</span></a>
object’s <cite>LABELANGLEITEM</cite> parameters as well, these parameters
are relative to the map’s orientation (i.e. they are computed
after the <cite>MAP</cite> object’s <cite>ANGLE</cite>). For example, if you have
specified an <cite>ANGLE</cite> for the map of 45, and then have a layer
<cite>LABELANGLEITEM</cite> value of 45, the resulting label will not appear
rotated (because the resulting map is rotated clockwise 45
degrees and the label is rotated counter-clockwise 45 degrees).
Note that a missing ANGLE or a value set to 0 means that map rotation is
ignored. (so if wanting to have a zero relative angle relative to the
map rotation, use an almost zero value like 0.0001)</p></li>
<li><p>Starting with MapServer 7.2, if using the <a class="reference internal" href="style.html#style"><span class="std std-ref">STYLE</span></a> . ANGLE parameter
of a punctual symbol, that parameter is relative to the map’s orientation
(i.e. it is computed
after the <cite>MAP</cite> object’s <cite>ANGLE</cite>). For example, if you have
specified an <cite>ANGLE</cite> for the map of 45, and then have a symbol
<cite>ANGLE</cite> value of 45, the resulting label will not appear
rotated (because the resulting map is rotated clockwise 45
degrees and the label is rotated counter-clockwise 45 degrees).
Note that a missing ANGLE or a value set to 0 means that map rotation is
ignored. (so if wanting to have a zero relative angle relative to the
map rotation, use an almost zero value like 0.0001)</p></li>
<li><p>More information can be found on the MapRotation <a class="reference external" href="https://github.com/MapServer/MapServer/wiki/MapRotation">Wiki Page</a>.</p></li>
</ul>
</dd>
</dl>
<dl id="mapfile-map-config">
<dt>CONFIG [key] [value]</dt><dd><p>This can be used to specify several values at run-time, for both
MapServer and GDAL/OGR libraries. Developers: values will be
passed on to CPLSetConfigOption(). Details on GDAL/OGR options are
found in their associated driver documentation pages
(<a class="reference external" href="https://gdal.org/drivers/raster/index.html">GDAL</a>/<a class="reference external" href="https://gdal.org/drivers/vector/index.html">OGR</a>). The following options are available specifically
for MapServer:</p>
<dl class="simple" id="index-1">
<dt>CGI_CONTEXT_URL [value]</dt><dd><p>This <cite>CONFIG</cite> parameter can be used to enable loading a map
context from a URL. See the <a class="reference internal" href="../ogc/mapcontext.html#map-context"><span class="std std-ref">Map Context
HowTo</span></a> for more info.</p>
</dd>
</dl>
<dl class="simple" id="index-2">
<dt>MS_ENCRYPTION_KEY [filename]</dt><dd><p>This <cite>CONFIG</cite> parameter can be used to specify an encryption
key that is used with MapServer’s <a class="reference internal" href="../utilities/msencrypt.html#msencrypt"><span class="std std-ref">msencypt
utility</span></a>.</p>
</dd>
</dl>
<dl class="simple" id="index-3">
<dt>MS_ERRORFILE [filename]</dt><dd><p>This <cite>CONFIG</cite> parameter can be used to write MapServer errors
to a file (as of MapServer 5.0). With MapServer 5.x, a full
path (absolute reference) is required, including the
filename. Starting with MapServer 6.0, a filename with relative
path can be passed via this <cite>CONFIG</cite> directive, in which case
the filename is relative to the mapfile location. Note that
setting MS_ERRORFILE via an environment variable always
requires an absolute path since there would be no mapfile to
make the path relative to. For more on this see the <cite>DEBUG</cite>
parameter below.</p>
</dd>
</dl>
<dl id="index-4">
<dt>MS_NONSQUARE [yes|no]</dt><dd><p>This <cite>CONFIG</cite> parameter can be used to allow non-square pixels
(meaning that the pixels represent non-square regions). For
“MS_NONSQUARE” “yes” to work, the <a class="reference internal" href="#map"><span class="std std-ref">MAP</span></a>, and each
<a class="reference internal" href="layer.html#layer"><span class="std std-ref">LAYER</span></a> will have to have a <a class="reference internal" href="projection.html#projection"><span class="std std-ref">PROJECTION</span></a> object.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>Has no effect for WMS.</p>
</div>
</dd>
</dl>
<dl id="index-5">
<dt>ON_MISSING_DATA [FAIL|LOG|IGNORE]</dt><dd><p>This <cite>CONFIG</cite> parameter can be used to tell MapServer how to
handle missing data in tile indexes (as of MapServer 5.3-dev,
r8015). Previous MapServer versions required a compile-time
switch (“IGNORE_MISSING_DATA”), but this is no longer required.</p>
<dl>
<dt>FAIL</dt><dd><p>This will cause MapServer to throw an error and exit (to
crash, in other words) on a missing file in a tile
index. This is the default.</p>
<div class="highlight-mapfile notranslate"><div class="highlight"><pre><span></span><span class="k">CONFIG</span> <span class="s">"ON_MISSING_DATA"</span> <span class="s">"FAIL"</span>
</pre></div>
</div>
</dd>
<dt>LOG</dt><dd><p>This will cause MapServer to log the error message for a
missing file in a tile index, and continue with the map
creation. Note: <cite>DEBUG</cite> parameter and CONFIG “MS_ERRORFILE”
need to be set for logging to occur, so please see the
<cite>DEBUG</cite> parameter below for more information.</p>
<div class="highlight-mapfile notranslate"><div class="highlight"><pre><span></span><span class="k">CONFIG</span> <span class="s">"ON_MISSING_DATA"</span> <span class="s">"LOG"</span>
</pre></div>
</div>
</dd>
<dt>IGNORE</dt><dd><p>This will cause MapServer to not report or log any errors
for missing files, and map creation will occur normally.</p>
<div class="highlight-mapfile notranslate"><div class="highlight"><pre><span></span><span class="k">CONFIG</span> <span class="s">"ON_MISSING_DATA"</span> <span class="s">"IGNORE"</span>
</pre></div>
</div>
</dd>
</dl>
</dd>
</dl>
<dl id="index-6">
<dt>PROJ_DATA [path]</dt><dd><p>This <cite>CONFIG</cite> parameter can be used to define the location of
your EPSG files for the <a class="reference internal" href="../glossary.html#term-PROJ"><span class="xref std std-term">PROJ</span></a> library. Setting the
[key] to PROJ_DATA and the [value] to the location of your EPSG
files will force PROJ to use this value. Using <cite>CONFIG</cite>
allows you to avoid setting environment variables to point to
your PROJ_DATA directory. Here are some examples:</p>
<div class="admonition tip">
<p class="admonition-title">Tip</p>
<p>Since the PROJ 9.1 release, the former <cite>PROJ_LIB</cite> variable has
been replaced with <cite>PROJ_DATA</cite></p>
</div>
<ol class="arabic">
<li><p>Unix</p>
<div class="highlight-mapfile notranslate"><div class="highlight"><pre><span></span><span class="k">CONFIG</span> <span class="s">"PROJ_DATA"</span> <span class="s">"/usr/local/share/proj/"</span>
</pre></div>
</div>
</li>
<li><p>Windows</p>
<div class="highlight-mapfile notranslate"><div class="highlight"><pre><span></span><span class="k">CONFIG</span> <span class="s">"PROJ_DATA"</span> <span class="s">"/ms4w/share/proj"</span>
</pre></div>
</div>
</li>
</ol>
</dd>
</dl>
<dl class="simple" id="index-7">
<dt>PROJ_DEBUG [ON|OFF]</dt><dd><p>Turn on PROJ debugging. See <a class="reference internal" href="../optimization/debugging.html#debugging"><span class="std std-ref">Debugging MapServer</span></a> for more details.</p>
</dd>
</dl>
</dd>
</dl>
<p id="datapattern"><span id="mapfile-map-datapattern"></span>DATAPATTERN [regular expression]</p>
<blockquote>
<div><div class="versionremoved">
<p><span class="versionmodified removed">Removed in version 8.0: </span>See <a class="reference internal" href="validation.html#validation"><span class="std std-ref">VALIDATION</span></a> instead</p>
</div>
<p>This defines a regular expression to be applied to requests to
change <cite>DATA</cite> parameters via URL requests
(i.e. map.layer[layername]=DATA+…). If a pattern doesn’t exist
then web users can’t monkey with support files via URLs. This
allows you to isolate one application from another if you desire,
with the default operation being very conservative. See also
<a class="reference internal" href="#templatepattern">TEMPLATEPATTERN</a>.</p>
</div></blockquote>
<dl id="mapfile-map-debug">
<dt>DEBUG [off|on|0|1|2|3|4|5]</dt><dd><p>Enables debugging of all of the layers in the current map.</p>
<p><em>Debugging with MapServer versions >= 5.0:</em></p>
<p>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 <cite>CONFIG</cite> parameter at the MAP level of the
mapfile, such as:</p>
<div class="highlight-mapfile notranslate"><div class="highlight"><pre><span></span><span class="k">CONFIG</span> <span class="s">"MS_ERRORFILE"</span> <span class="s">"/ms4w/tmp/ms_error.txt"</span>
</pre></div>
</div>
<p>You can also set the environment variable in Apache by adding the
following to your httpd.conf:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">SetEnv</span> <span class="n">MS_ERRORFILE</span> <span class="s2">"/ms4w/tmp/ms_error.txt"</span>
</pre></div>
</div>
<p>Once the environment variable is set, the <cite>DEBUG</cite> mapfile
parameter can be used to control the level of debugging output.
Here is a description of the possible <cite>DEBUG</cite> values:</p>
<ul class="simple">
<li><p><strong>DEBUG O or OFF</strong> - only msSetError() calls are logged to
MS_ERRORFILE. No msDebug() output at all. This is the default
and corresponds to the original behavior of MS_ERRORFILE in
MapServer 4.x.</p></li>
<li><p><strong>DEBUG 1 or ON</strong> - includes all output from <em>DEBUG 0</em> plus
msDebug() warnings about common pitfalls, failed assertions or
non-fatal error situations (e.g. missing or invalid values for
some parameters, missing shapefiles in tileindex, timeout error
from remote WMS/WFS servers, etc.).</p></li>
<li><p><strong>DEBUG 2</strong> - includes all output from <em>DEBUG 1</em> plus notices
and timing information useful for tuning mapfiles and
applications.</p></li>
<li><p><strong>DEBUG 3</strong> - all of <em>DEBUG 2</em> plus some debug output useful
in troubleshooting problems such as WMS connection URLs being
called, database connection calls, etc. This is the recommended
level for debugging mapfiles.</p></li>
<li><p><strong>DEBUG 4</strong> - <em>DEBUG 3</em> plus even more details…</p></li>
<li><p><strong>DEBUG 5</strong> - <em>DEBUG 4</em> plus any msDebug() output that might
be more useful to the developers than to the users.</p></li>
</ul>
<p>You can also set the debug level by using the “MS_DEBUGLEVEL”
environment variable.</p>
<p>The <cite>DEBUG</cite> setting can also be specified for a layer, by setting
the <cite>DEBUG</cite> parameter in the <a class="reference internal" href="layer.html#layer"><span class="std std-ref">LAYER</span></a> object.</p>
<p>For more details on this debugging mechanism, please see the
<a class="reference internal" href="../optimization/debugging.html#debugging"><span class="std std-ref">Debugging MapServer</span></a> document.</p>
<p><em>Debugging with MapServer versions < 5:</em></p>
<p>Verbose output is generated and sent to the standard error output
(STDERR) or the MapServer logfile if one is set using the <cite>LOG</cite>
parameter in the <cite>WEB</cite> 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).</p>
</dd>
</dl>
<dl id="mapfile-map-defresolution">
<dt>DEFRESOLUTION [double]</dt><dd><div class="versionadded">
<p><span class="versionmodified added">Added in version 5.6.</span></p>
</div>
<p>Sets the reference resolution (pixels per inch) used for
symbology. Default is 72. Minimum is 10 and maximum is 1000.</p>
<p>Used to automatically scale the symbology when <a class="reference internal" href="#mapfile-map-resolution"><span class="std std-ref">RESOLUTION</span></a> is changed, so the map maintains the same
look at each resolution. The scale factor is <cite>RESOLUTION</cite> /
<cite>DEFRESOLUTION</cite>.</p>
</dd>
</dl>
<dl class="simple" id="mapfile-map-extent">
<dt>EXTENT [minx] [miny] [maxx] [maxy]</dt><dd><p>The spatial extent of the map to be created. In most cases you
will need to specify this, although MapServer can sometimes
(expensively) calculate one if it is not specified.</p>
</dd>
</dl>
<dl class="simple" id="mapfile-map-fontset">
<dt><a class="reference internal" href="fontset.html#fontset"><span class="std std-ref">FONTSET</span></a> [filename]</dt><dd><p>Filename of fontset file to use. Can be a path relative to the
mapfile, or a full path.</p>
</dd>
</dl>
<dl id="mapfile-map-imagecolor">
<dt>IMAGECOLOR [r] [g] [b] | [hexadecimal string]</dt><dd><p>Color to initialize the map with (i.e. background color). When
transparency is enabled (<em>TRANSPARENT ON</em> in <a class="reference internal" href="outputformat.html#outputformat"><span class="std std-ref">OUTPUTFORMAT</span></a>)
for the typical case of 8-bit pseudocolored map generation, this
color will be marked as transparent in the output file
palette. Any other map components drawn in this color will also be
transparent, so for map generation with transparency it is best to
use an otherwise unused color as the background color.</p>
<ul>
<li><p><cite>r</cite>, <cite>g</cite> and <cite>b</cite> shall be integers [0..255]. To specify green,
the following is used:</p>
<blockquote>
<div><div class="highlight-mapfile notranslate"><div class="highlight"><pre><span></span><span class="k">IMAGECOLOR</span> <span class="mi">0</span> <span class="mi">255</span> <span class="mi">0</span>
</pre></div>
</div>
</div></blockquote>
</li>
<li><p><cite>hexadecimal string</cite> can be</p>
<ul>
<li><p>RGB value: “#rrggbb”. To specify magenta, the following is
used:</p>
<div class="highlight-mapfile notranslate"><div class="highlight"><pre><span></span><span class="k">IMAGECOLOR</span> <span class="s">"#FF00FF"</span>
</pre></div>
</div>
</li>
<li><p>RGBA value (adding translucence): “#rrggbbaa”. To specify a
semi-translucent magenta, the following is used:</p>
<div class="highlight-mapfile notranslate"><div class="highlight"><pre><span></span><span class="k">IMAGECOLOR</span> <span class="s">"#FF00FFCC"</span>
</pre></div>
</div>
</li>
</ul>
</li>
</ul>
</dd>
<dt>IMAGEQUALITY [int]</dt><dd><div class="versionremoved">
<p><span class="versionmodified removed">Removed in version 8.0.</span></p>
</div>
<p>Instead use <strong>FORMATOPTION “QUALITY=n”</strong> in the
<a class="reference internal" href="outputformat.html#outputformat"><span class="std std-ref">OUTPUTFORMAT</span></a> declaration to specify compression quality for
JPEG output.</p>
</dd>
</dl>
<span id="index-11"></span><span id="index-10"></span><span id="index-9"></span><span id="index-8"></span><span id="mapfile-map-imagetype"></span><dl id="imagetype">
<dt>IMAGETYPE [jpeg|pdf|png|svg|…|userdefined]</dt><dd><p>Output format (raster or vector) to generate. The name used here
must match the ‘NAME’ of a user defined or internally available
<a class="reference internal" href="outputformat.html#outputformat"><span class="std std-ref">OUTPUTFORMAT</span></a>. For a complete list of available
<cite>IMAGEFORMAT</cite>s, see the <a class="reference internal" href="outputformat.html#outputformat"><span class="std std-ref">OUTPUTFORMAT</span></a> section.</p>
</dd>
<dt>INTERLACE [on|off]</dt><dd><div class="versionremoved">
<p><span class="versionmodified removed">Removed in version 8.0.</span></p>
</div>
<p>Instead use <strong>FORMATOPTION “INTERLACE=ON”</strong> in the
<a class="reference internal" href="outputformat.html#outputformat"><span class="std std-ref">OUTPUTFORMAT</span></a> declaration to specify if the output images
should be interlaced.</p>
</dd>
</dl>
<dl class="simple" id="mapfile-map-layer">
<dt><a class="reference internal" href="layer.html#layer"><span class="std std-ref">LAYER</span></a></dt><dd><p>Signals the start of a <a class="reference internal" href="layer.html#layer"><span class="std std-ref">LAYER</span></a> object.</p>
</dd>
</dl>
<dl class="simple" id="mapfile-map-legend">
<dt><a class="reference internal" href="legend.html#legend"><span class="std std-ref">LEGEND</span></a></dt><dd><p>Signals the start of a <a class="reference internal" href="legend.html#legend"><span class="std std-ref">LEGEND</span></a> object.</p>
</dd>
</dl>
<dl class="simple" id="mapfile-map-maxsize">
<dt>MAXSIZE [integer]</dt><dd><p>Sets the maximum size of the map image. This will override the
default value. For example, setting this to 4096 means that you
can have up to 4096 pixels in both dimensions (i.e. max of
4096x4096). Default is 4096 for MapServer version >= 7.0.3
(for earlier versions the default was 2048).
Must be a value greater than 0.</p>
</dd>
</dl>
<dl class="simple" id="mapfile-map-name">
<dt>NAME [name]</dt><dd><p>Prefix attached to map, scalebar and legend GIF filenames created
using this mapfile. It should be kept short.</p>
</dd>
</dl>
<dl class="simple" id="mapfile-map-outputformat">
<dt><a class="reference internal" href="outputformat.html#outputformat"><span class="std std-ref">OUTPUTFORMAT</span></a></dt><dd><p>Signals the start of a <a class="reference internal" href="outputformat.html#outputformat"><span class="std std-ref">OUTPUTFORMAT</span></a> object.</p>
</dd>
</dl>
<dl class="simple" id="mapfile-map-projection">
<dt><a class="reference internal" href="projection.html#projection"><span class="std std-ref">PROJECTION</span></a></dt><dd><p>Signals the start of a <a class="reference internal" href="projection.html#projection"><span class="std std-ref">PROJECTION</span></a> object.</p>
</dd>
</dl>
<dl class="simple" id="mapfile-map-querymap">
<dt><a class="reference internal" href="querymap.html#querymap"><span class="std std-ref">QUERYMAP</span></a></dt><dd><p>Signals the start of a <a class="reference internal" href="querymap.html#querymap"><span class="std std-ref">QUERYMAP</span></a> object.</p>
</dd>
</dl>
<dl class="simple" id="mapfile-map-reference">
<dt><a class="reference internal" href="reference.html#reference"><span class="std std-ref">REFERENCE</span></a></dt><dd><p>Signals the start of a <a class="reference internal" href="reference.html#reference"><span class="std std-ref">REFERENCE</span></a> MAP object.</p>
</dd>
</dl>
<dl class="simple" id="mapfile-map-resolution">
<dt>RESOLUTION [double]</dt><dd><p>Sets the pixels per inch for output, only affects
scale computations. Default is 72. Minimum is 10 and maximum is 1000.</p>
</dd>
</dl>
<dl id="mapfile-map-scaledenom">
<dt>SCALEDENOM [double]</dt><dd><p>Computed scale of the map. Set most often by the application.
Scale is given as the denominator of the actual scale fraction,
for example for a map at a scale of 1:24,000 use 24000.
Implemented in MapServer 5.0, to replace the deprecated <cite>SCALE</cite>
parameter. Must be greater or equal to 1.</p>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="../glossary.html#term-Map-Scale"><span class="xref std std-term">Map Scale</span></a></p>
</div>
</dd>
</dl>
<dl class="simple" id="mapfile-map-scalebar">
<dt>SCALEBAR</dt><dd><p>Signals the start of a <a class="reference internal" href="scalebar.html#scalebar"><span class="std std-ref">SCALEBAR</span></a> object.</p>
</dd>
</dl>
<dl id="mapfile-map-shapepath">
<dt>SHAPEPATH [foldername]</dt><dd><p>Relative or absolute path to the directory holding the data files,
for vector and raster formats (such as GeoPackages, GEOJSON,
SpatiaLite, Shapefiles, raster images, tiles, etc.). This path will
be used to find the file specified through the <em>DATA</em> or <em>CONNECTION</em>
parameters. For relative paths, <em>SHAPEPATH</em> is relative to the
mapfile location. There can be further subdirectories under <em>SHAPEPATH</em>.</p>
<p>Here is an example using relative paths (where the <em>DATA</em> folder
lives at the same level as the mapfile and the <em>DATA</em> folder
contains a SpatiaLite db) :</p>
<div class="highlight-mapfile notranslate"><div class="highlight"><pre><span></span><span class="k">MAP</span>
<span class="p">...</span>
<span class="k">SHAPEPATH</span> <span class="s">"./data"</span>
<span class="p">...</span>
<span class="k">LAYER</span>
<span class="p">...</span>
<span class="k">CONNECTIONTYPE</span> <span class="nb">OGR</span>
<span class="k">CONNECTION</span> <span class="s">"world.db"</span>
<span class="k">DATA</span> <span class="s">"lakes"</span>
<span class="p">...</span>
<span class="k">END</span> <span class="c1">#layer</span>
<span class="k">END</span> <span class="c1">#mapfile</span>
</pre></div>
</div>
</dd>
</dl>
<dl class="simple" id="mapfile-map-size">
<dt>SIZE [x][y]</dt><dd><p>Size in pixels of the output image (i.e. the map).
Values must be less than the MAXSIZE property.</p>
</dd>
</dl>
<dl class="simple" id="mapfile-map-status">
<dt>STATUS [on|off]</dt><dd><p>Is the map active? Sometimes you may wish to turn this off to use
only the reference map or scale bar.</p>
</dd>
</dl>
<span id="mapfile-map-symbolset"></span><dl id="symbolset">
<dt>SYMBOLSET [filename]</dt><dd><p>Filename of the symbolset to use. Can be a path relative to the
mapfile, or a full path.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>The <cite>SYMBOLSET</cite> file must start with the word <cite>SYMBOLSET</cite> and
end with the word <cite>END</cite>.</p>
</div>
</dd>
<dt><a class="reference internal" href="symbol.html#symbol"><span class="std std-ref">SYMBOL</span></a></dt><dd><p>Signals the start of a <a class="reference internal" href="symbol.html#symbol"><span class="std std-ref">SYMBOL</span></a> object.</p>
</dd>
</dl>
<p id="templatepattern"><span id="mapfile-map-templatepattern"></span>TEMPLATEPATTERN [regular expression]</p>
<blockquote>
<div><div class="versionremoved">
<p><span class="versionmodified removed">Removed in version 8.0: </span>See <a class="reference internal" href="validation.html#validation"><span class="std std-ref">VALIDATION</span></a> instead</p>
</div>
<p>This defines a regular expression to be applied to requests to
change the <cite>TEMPLATE</cite> parameters via URL requests
(i.e. map.layer[layername].template=…). If a pattern doesn’t
exist then web users can’t monkey with support files via
URLs. This allows you to isolate one application from another if
you desire, with the default operation being very
conservative. See also <a class="reference internal" href="#datapattern">DATAPATTERN</a>.</p>
</div></blockquote>
<p>TRANSPARENT [on|off]</p>
<blockquote>
<div><div class="versionremoved">
<p><span class="versionmodified removed">Removed in version 8.0.</span></p>
</div>
<p>Instead use <em>TRANSPARENT ON</em> in the <a class="reference internal" href="outputformat.html#outputformat"><span class="std std-ref">OUTPUTFORMAT</span></a>
declaration to specify if the output images should be transparent.</p>
</div></blockquote>
<span id="index-17"></span><span id="index-16"></span><span id="index-15"></span><span id="index-14"></span><span id="index-13"></span><span id="index-12"></span><span id="mapfile-map-units"></span><dl class="simple" id="index-18">
<dt>UNITS [dd|feet|inches|kilometers|meters|miles|nauticalmiles]</dt><dd><p>Units of the map coordinates. Used for scalebar and scale
computations. <cite>Nauticalmiles</cite> was added in MapServer 5.6.</p>
</dd>
</dl>
<dl class="simple" id="mapfile-map-web">
<dt><a class="reference internal" href="web.html#web"><span class="std std-ref">WEB</span></a></dt><dd><p>Signals the start of a <a class="reference internal" href="web.html#web"><span class="std std-ref">WEB</span></a> object.</p>
</dd>
</dl>
</section>
<div class="clearer"></div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="Main">
<div class="sphinxsidebarwrapper">
<search id="searchbox" style="display: none" role="search">
<h3 id="searchlabel">Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="../search.html" method="get">
<input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
<input type="submit" value="Go" />
</form>
</div>
</search>
<script>document.getElementById('searchbox').style.display = "block"</script><h3>Navigation</h3>
<p>
<a href="../about.html" title="About">About</a><br>
<a href="../products.html" title="Products">Products</a><br>
<a href="../community/index.html" title="Community">Community</a><br>
<a href="../development/index.html" title="Development">Development</a><br>
<a href="../download.html" title="Downloads">Downloads</a><br>
<a href="../documentation.html" title="Documentation">Documentation</a><br>
<a href="../faq.html" title="FAQ">FAQ</a><br>
<a href="../psc.html" title="PSC">PSC</a><br>
<a href="https://fosstodon.org/@mapserver" title="Mastodon">Mastodon</a>
</p>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related" role="navigation" aria-label="Related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="outputformat.html" title="OUTPUTFORMAT"
>next</a> |</li>
<li class="right" >
<a href="legend.html" title="LEGEND"
>previous</a> |</li>
<li class="nav-item nav-item-0"><a href="../index.html">Home</a> »</li>
<li class="nav-item nav-item-1"><a href="../documentation.html" >MapServer 8.6.2 Documentation</a> »</li>
<li class="nav-item nav-item-2"><a href="index.html" >Mapfile</a> »</li>
<li class="nav-item nav-item-this"><a href="">MAP</a></li>
</ul>
</div>
<div class="footer" role="contentinfo">
© <a href="../copyright.html">Copyright</a> 2026, Open Source Geospatial Foundation.
Last updated on 2026-04-20.
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 9.1.0.
</div>
</body>
</html>