From 9bb048d0d8d6a7e8b1d05efa4a7ab99cd61db20a Mon Sep 17 00:00:00 2001 From: sethg Date: Fri, 19 Jun 2026 22:51:59 +0200 Subject: [PATCH 1/8] Reformat --- workshop/exercises/mapfiles/wfs.map | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/workshop/exercises/mapfiles/wfs.map b/workshop/exercises/mapfiles/wfs.map index 0945f14..28e0099 100644 --- a/workshop/exercises/mapfiles/wfs.map +++ b/workshop/exercises/mapfiles/wfs.map @@ -1,11 +1,15 @@ MAP NAME "WFS" EXTENT -180 -90 180 90 - SIZE 400 400 # + SIZE 400 400 PROJECTION - "epsg:4326" + "EPSG:4326" END + SYMBOLSET "symbols.sym" + + IMAGETYPE "png" + OUTPUTFORMAT NAME "geojson" DRIVER "OGR/GEOJSON" @@ -21,7 +25,6 @@ MAP "ows_enable_request" "*" # this enables all OGC requests "wfs_getfeature_formatlist" "geojson" "wfs_srs" "EPSG:4326 EPSG:3857" - "ows_onlineresource" "http://localhost:7000/" END END LAYER @@ -43,9 +46,9 @@ MAP DATA "ne_50m_populated_places_simple" CLASS STYLE - COLOR 60 179 113 - OUTLINECOLOR 255 255 255 - OUTLINEWIDTH 0.1 + SYMBOL "circle" + SIZE 22 + COLOR "#60616c" END END END From 69c0d99e7ad71f2e247ec727f9df491207cd9489 Mon Sep 17 00:00:00 2001 From: sethg Date: Fri, 19 Jun 2026 22:53:03 +0200 Subject: [PATCH 2/8] Reformat and add all Mapfiles --- workshop/exercises/mapfiles/mapserver.conf | 129 ++++++++++++--------- 1 file changed, 77 insertions(+), 52 deletions(-) diff --git a/workshop/exercises/mapfiles/mapserver.conf b/workshop/exercises/mapfiles/mapserver.conf index 77e1d53..04a0e42 100644 --- a/workshop/exercises/mapfiles/mapserver.conf +++ b/workshop/exercises/mapfiles/mapserver.conf @@ -3,67 +3,92 @@ # CONFIG - # - # Environment variables (see https://mapserver.org/environment_variables.html) - # - ENV - - MS_ONLINERESOURCE "/" - # - # Limit Mapfile Access + # Environment variables (see https://mapserver.org/environment_variables.html) # - # MS_MAP_NO_PATH "1" - # MS_MAP_PATTERN "^/opt/mapserver" ## required + ENV - # - # Global Log/Debug Setup - # - # MS_DEBUGLEVEL "5" - # MS_ERRORFILE "/opt/mapserver/logs/mapserver.log" + MS_ONLINERESOURCE "" - # - # Default Map - # - # MS_MAPFILE "/opt/mapserver/test/test.map" + # + # Limit Mapfile Access + # + # MS_MAP_NO_PATH "1" + # MS_MAP_PATTERN "^/opt/mapserver" ## required - # - # Proj Library - # - # PROJ_LIB "" + # + # Global Log/Debug Setup + # + # MS_DEBUGLEVEL "5" + # MS_ERRORFILE "/opt/mapserver/logs/mapserver.log" - # - # Request Control - # - # disable POST requests (allowed by default, any value will do) - # MS_NO_POST "1" + # + # Default Map + # + # MS_MAPFILE "/opt/mapserver/test/test.map" - # - # Other Options - # - # MS_ENCRYPTION_KEY - # MS_USE_GLOBAL_FT_CACHE - # MS_PDF_CREATION_DATE - # MS_MAPFILE_PATTERN "\.map$" - # MS_XMLMAPFILE_XSLT - # MS_MODE - # MS_OPENLAYERS_JS_URL - # MS_TEMPPATH - # MS_MAX_OPEN_FILES + # + # Proj Library + # + # PROJ_LIB "" + + # + # Request Control + # + # disable POST requests (allowed by default, any value will do) + # MS_NO_POST "1" + + # + # Other Options + # + # MS_ENCRYPTION_KEY + # MS_USE_GLOBAL_FT_CACHE + # MS_PDF_CREATION_DATE + # MS_MAPFILE_PATTERN "\.map$" + # MS_XMLMAPFILE_XSLT + # MS_MODE + # MS_OPENLAYERS_JS_URL + # MS_TEMPPATH + # MS_MAX_OPEN_FILES + + # + # OGC API + # + OGCAPI_HTML_TEMPLATE_DIRECTORY "/usr/local/share/mapserver/ogcapi/templates/html-bootstrap/" + MS_INDEX_TEMPLATE_DIRECTORY "/usr/local/share/mapserver/ogcapi/templates/html-index-bootstrap/" + MS_MAP_PATTERN "." + + # MS_TEMPPATH "/etc/mapserver/tmp" + END # - # OGC API + # Map Aliases # - OGCAPI_HTML_TEMPLATE_DIRECTORY "/usr/local/share/mapserver/ogcapi/templates/html-bootstrap/" - MS_INDEX_TEMPLATE_DIRECTORY "/usr/local/share/mapserver/ogcapi/templates/html-index-bootstrap/" - MS_MAP_PATTERN "." - END - - # - # Map Aliases - # - MAPS - OGCAPI-FEATURES "/etc/mapserver/ogcapi-features.map" - END + MAPS + ARCGIS "/etc/mapserver/arcgis.map" + CLUSTERS "/etc/mapserver/clusters.map" + CONTOURS "/etc/mapserver/contours.map" + COUNTRIES "/etc/mapserver/countries.map" + DIRECTION "/etc/mapserver/direction.map" + GDALG "/etc/mapserver/gdalg.map" + LAKES "/etc/mapserver/lakes.map" + LANDUSE "/etc/mapserver/landuse.map" + LINES "/etc/mapserver/lines.map" + OGCAPI-FEATURES "/etc/mapserver/ogcapi-features.map" + OTHER-PROJECTIONS "/etc/mapserver/other-projections.map" + POINTS "/etc/mapserver/points.map" + POLYGONS "/etc/mapserver/polygons.map" + POSTGIS "/etc/mapserver/postgis.map" + RAILWAYS "/etc/mapserver/railways.map" + RASTER "/etc/mapserver/raster.map" + SLD "/etc/mapserver/sld.map" + STAC "/etc/mapserver/stac.map" + STARS "/etc/mapserver/stars.map" + TILES "/etc/mapserver/tiles.map" + TIMISOARA "/etc/mapserver/timisoara.map" + VECTOR-TILES "/etc/mapserver/vector-tiles.map" + WCS "/etc/mapserver/wcs.map" + WFS "/etc/mapserver/wfs.map" + END END From 4326281175f496b901c4ae69ea01b4c6887a08ba Mon Sep 17 00:00:00 2001 From: sethg Date: Fri, 19 Jun 2026 22:53:59 +0200 Subject: [PATCH 3/8] Reformat --- workshop/exercises/mapfiles/landuse.map | 44 ++++++++++++------------- 1 file changed, 21 insertions(+), 23 deletions(-) diff --git a/workshop/exercises/mapfiles/landuse.map b/workshop/exercises/mapfiles/landuse.map index ced2d59..185bd70 100644 --- a/workshop/exercises/mapfiles/landuse.map +++ b/workshop/exercises/mapfiles/landuse.map @@ -7,21 +7,21 @@ MAP "epsg:4326" END SYMBOL - NAME 'octahedron' - TYPE VECTOR - POINTS - 20 18 - 22 18 - 24 20 - 24 22 - 22 24 - 20 24 - 18 22 - 18 20 - 20 18 - END - FILLED FALSE - END + NAME "octahedron" + TYPE VECTOR + POINTS + 20 18 + 22 18 + 24 20 + 24 22 + 22 24 + 20 24 + 18 22 + 18 20 + 20 18 + END + FILLED FALSE + END SYMBOL NAME "marsh_isom" TYPE VECTOR @@ -166,7 +166,6 @@ MAP SYMBOL "wetland" END END - CLASS EXPRESSION {park,grass} STYLE @@ -181,19 +180,18 @@ MAP END CLASS EXPRESSION "forest" - STYLE - #COLOR 231 255 170 + STYLE COLOR 34 139 34 - END - STYLE + END + STYLE SYMBOL "tree" # "octahedron" SIZE 10 COLOR 100 100 100 END - #STYLE - # SYMBOL "paper" - #END END + #STYLE + # SYMBOL "paper" + #END #CLASS # STYLE # SYMBOL "marsh_isom" # uncrossablemarsh_isom indistinctmarsh_isom marsh_isom From e720dec6d8e6ffffcd6e48703487e5c1b52eace6 Mon Sep 17 00:00:00 2001 From: sethg Date: Fri, 19 Jun 2026 22:55:34 +0200 Subject: [PATCH 4/8] Remove ows_onlineresource and add IMAGEPATH --- workshop/exercises/mapfiles/arcgis.map | 1 + workshop/exercises/mapfiles/clusters.map | 1 + workshop/exercises/mapfiles/contours.map | 1 + workshop/exercises/mapfiles/countries.map | 3 +++ workshop/exercises/mapfiles/gdalg.map | 1 + workshop/exercises/mapfiles/lakes.map | 1 + workshop/exercises/mapfiles/lines.map | 1 + workshop/exercises/mapfiles/other-projections.map | 3 +-- workshop/exercises/mapfiles/points.map | 1 + workshop/exercises/mapfiles/polygons.map | 1 + 10 files changed, 12 insertions(+), 2 deletions(-) diff --git a/workshop/exercises/mapfiles/arcgis.map b/workshop/exercises/mapfiles/arcgis.map index 408bc5d..f2102a6 100644 --- a/workshop/exercises/mapfiles/arcgis.map +++ b/workshop/exercises/mapfiles/arcgis.map @@ -6,6 +6,7 @@ MAP "init=epsg:4326" END WEB + IMAGEPATH "/etc/mapserver/tmp/" METADATA "ows_enable_request" "*" "ows_srs" "EPSG:4326 EPSG:3857" diff --git a/workshop/exercises/mapfiles/clusters.map b/workshop/exercises/mapfiles/clusters.map index 5efad04..7cd655f 100644 --- a/workshop/exercises/mapfiles/clusters.map +++ b/workshop/exercises/mapfiles/clusters.map @@ -8,6 +8,7 @@ MAP END FONTSET "data/fonts/fontset.txt" WEB + IMAGEPATH "/etc/mapserver/tmp/" METADATA "ows_enable_request" "*" "ows_srs" "EPSG:4326 EPSG:3857" diff --git a/workshop/exercises/mapfiles/contours.map b/workshop/exercises/mapfiles/contours.map index 370f666..08c8976 100644 --- a/workshop/exercises/mapfiles/contours.map +++ b/workshop/exercises/mapfiles/contours.map @@ -11,6 +11,7 @@ MAP END WEB + IMAGEPATH "/etc/mapserver/tmp/" METADATA "ows_enable_request" "*" "ows_srs" "EPSG:4326 EPSG:3857" diff --git a/workshop/exercises/mapfiles/countries.map b/workshop/exercises/mapfiles/countries.map index 4cb92f4..693b9f9 100644 --- a/workshop/exercises/mapfiles/countries.map +++ b/workshop/exercises/mapfiles/countries.map @@ -11,6 +11,9 @@ MAP "epsg:4326" END + WEB + IMAGEPATH "/etc/mapserver/tmp/" + END # the extent of the map in the projection EXTENT -180 -90 180 90 diff --git a/workshop/exercises/mapfiles/gdalg.map b/workshop/exercises/mapfiles/gdalg.map index e07be4c..d24011d 100644 --- a/workshop/exercises/mapfiles/gdalg.map +++ b/workshop/exercises/mapfiles/gdalg.map @@ -7,6 +7,7 @@ MAP "init=epsg:4326" END WEB + IMAGEPATH "/etc/mapserver/tmp/" METADATA "ows_enable_request" "*" "ows_srs" "EPSG:4326 EPSG:3857" diff --git a/workshop/exercises/mapfiles/lakes.map b/workshop/exercises/mapfiles/lakes.map index 570ed3a..c38aa85 100644 --- a/workshop/exercises/mapfiles/lakes.map +++ b/workshop/exercises/mapfiles/lakes.map @@ -7,6 +7,7 @@ MAP END FONTSET "data/fonts/fontset.txt" WEB + IMAGEPATH "/etc/mapserver/tmp/" METADATA "ows_enable_request" "*" "ows_srs" "EPSG:4326 EPSG:3857" diff --git a/workshop/exercises/mapfiles/lines.map b/workshop/exercises/mapfiles/lines.map index d2b0c48..0eb9868 100644 --- a/workshop/exercises/mapfiles/lines.map +++ b/workshop/exercises/mapfiles/lines.map @@ -8,6 +8,7 @@ MAP END WEB + IMAGEPATH "/etc/mapserver/tmp/" METADATA "ows_enable_request" "*" "ows_srs" "EPSG:4326 EPSG:3857" diff --git a/workshop/exercises/mapfiles/other-projections.map b/workshop/exercises/mapfiles/other-projections.map index 7a6b96e..f06cd1d 100644 --- a/workshop/exercises/mapfiles/other-projections.map +++ b/workshop/exercises/mapfiles/other-projections.map @@ -1,5 +1,5 @@ MAP - NAME "OTHER_PROJECTIONS" + NAME "Other_Projections" SIZE 1200 1200 EXTENT -18019909.21 -9009954.61 18019909.21 9009954.61 @@ -23,7 +23,6 @@ MAP WEB METADATA "ows_enable_request" "*" - "ows_onlineresource" "http://localhost/path/to/other-projections?" "ows_srs" "ESRI:53009 EPSG:4326" "wfs_getfeature_formatlist" "geojson" END diff --git a/workshop/exercises/mapfiles/points.map b/workshop/exercises/mapfiles/points.map index 70e1e30..fb7345f 100644 --- a/workshop/exercises/mapfiles/points.map +++ b/workshop/exercises/mapfiles/points.map @@ -7,6 +7,7 @@ MAP END FONTSET "data/fonts/fontset.txt" WEB + IMAGEPATH "/etc/mapserver/tmp/" METADATA "wms_enable_request" "*" "wms_srs" "EPSG:4326 EPSG:3857" diff --git a/workshop/exercises/mapfiles/polygons.map b/workshop/exercises/mapfiles/polygons.map index c60c589..3588da3 100644 --- a/workshop/exercises/mapfiles/polygons.map +++ b/workshop/exercises/mapfiles/polygons.map @@ -7,6 +7,7 @@ MAP "epsg:4326" END WEB + IMAGEPATH "/etc/mapserver/tmp/" METADATA "ows_title" "OSM Buildings" "ows_enable_request" "*" From 52670bf3cf64d92e795914087294191c3f600679 Mon Sep 17 00:00:00 2001 From: sethg Date: Fri, 19 Jun 2026 22:57:12 +0200 Subject: [PATCH 5/8] Add Inbuilt OpenLayers viewer links --- workshop/content/docs/mapfile/labels.md | 3 ++- workshop/content/docs/mapfile/lines.md | 1 + workshop/content/docs/mapfile/points.md | 3 ++- workshop/content/docs/mapfile/polygons.md | 1 + 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/workshop/content/docs/mapfile/labels.md b/workshop/content/docs/mapfile/labels.md index 1554d85..9f44374 100644 --- a/workshop/content/docs/mapfile/labels.md +++ b/workshop/content/docs/mapfile/labels.md @@ -42,6 +42,7 @@ GEOMTRANSFORM (centerline(densify([shape], 0.1))) !!! example - Direct MapServer request: + - Inbuilt OpenLayers viewer: - Local OpenLayers example: ??? JavaScript "lakes.js" @@ -61,7 +62,7 @@ GEOMTRANSFORM (centerline(densify([shape], 0.1))) 1. Use a different font for the label by adding the following to the `LABEL` block: `FONT MonsieurLaDoulaise` and increasing the `SIZE` to `28`. The list of fonts available can be found in `workshop/exercises/mapfiles/data/fonts/fontset.txt`. 2. Comment out the `GEOMTRANSFORM (centerline([shape]))` and `ANGLE FOLLOW` lines (using `#`) to see its effect on the map. -3. If you have time, download a font you like from https://fonts.google.com/ and unzip the .TTF file to `workshop/exercises/mapfiles/data/fonts/` +3. If you have time, download a font you like from and unzip the .TTF file to `workshop/exercises/mapfiles/data/fonts/` add a new entry to `fontset.txt` and use this font to draw your Map labels.