Skip to content

Commit 993830c

Browse files
authored
2026 Workshop Updates (#11)
* Remove init= and redundant whitespace * Fix syntax * Update to latest MapServer * Set MS_ONLINERESOURCE to root * Update to latest GDAL CLI commands * Update Docker images and fix port no. * Disable unused services * Add Mapfile validation checks
1 parent 2418bbe commit 993830c

26 files changed

Lines changed: 243 additions & 231 deletions

.github/workflows/tests.yml

Lines changed: 34 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,34 @@
1-
name: Test documentation ⚙️
2-
3-
on:
4-
pull_request:
5-
paths:
6-
- 'workshop/content/**'
7-
8-
defaults:
9-
run:
10-
working-directory: workshop/content
11-
12-
jobs:
13-
build:
14-
name: Test documentation build
15-
runs-on: ubuntu-latest
16-
steps:
17-
- uses: actions/checkout@v6
18-
- uses: actions/setup-python@v6
19-
with:
20-
python-version: '3.x'
21-
- name: Install requirements 📦
22-
run: |
23-
python -m pip install --upgrade pip
24-
pip install -r requirements.txt
25-
- name: Deploy 📦
26-
run: zensical build --clean --strict
1+
name: Test documentation and Mapfiles ⚙️
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- 'workshop/content/**'
7+
- 'workshop/exercises/mapfiles/**'
8+
9+
defaults:
10+
run:
11+
working-directory: workshop
12+
13+
jobs:
14+
build:
15+
name: Test documentation build
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v6
19+
- uses: actions/setup-python@v6
20+
with:
21+
python-version: '3.x'
22+
- name: Test Mapfiles
23+
run: |
24+
pip install mappyfile
25+
mappyfile validate exercises/mapfiles/*.map
26+
- name: Install doc requirements 📦
27+
run: |
28+
cd content
29+
python -m pip install --upgrade pip
30+
pip install -r requirements.txt
31+
- name: Deploy 📦
32+
run: |
33+
cd content
34+
zensical build --clean --strict

docker/Dockerfile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ghcr.io/osgeo/gdal:ubuntu-full-3.12.2 AS gdal
1+
FROM ghcr.io/osgeo/gdal:ubuntu-full-3.13.1 AS gdal
22
# see https://github.com/OSGeo/gdal/tree/master/docker#ubuntu-based
33

44
FROM gdal AS builder
@@ -73,15 +73,19 @@ RUN cmake .. \
7373
-DWITH_CAIRO=1 \
7474
-DWITH_RSVG=1 \
7575
-DUSE_PROJ=1 \
76+
-DPROJ_INCLUDE_DIR=/usr/local/gdal-internal/include \
77+
-DPROJ_LIBRARY=/usr/local/gdal-internal/lib/libinternalproj.so \
7678
-DUSE_WFS_SVR=1 \
7779
-DUSE_OGCAPI_SVR=1 \
7880
-DWITH_ORACLESPATIAL=0 \
7981
-DWITH_PYTHON=1 \
8082
-DWITH_MSSQL2008=0
8183

84+
# Run the make command for pythonmapscript-wheel
8285
RUN cmake --build . --target pythonmapscript-wheel
8386
RUN ninja install
8487

88+
8589
FROM gdal AS runner
8690
LABEL maintainer="sethg@geographika.co.uk"
8791
SHELL ["/bin/bash", "-o", "pipefail", "-cux"]

docker/ReadMe.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,24 +13,18 @@ start "C:\Program Files\Docker\Docker\Docker Desktop.exe"
1313
1414
cd D:\GitHub\getting-started-with-mapserver\docker
1515
16-
docker build `
17-
--tag "mapserver-workshop" `
18-
--target=runner `
19-
--build-arg=MAPSERVER_BRANCH=main `
20-
--build-arg=MAPSERVER_REPO=https://github.com/mapserver/mapserver `
21-
.
16+
# MAPSERVER_BRANCH=main
17+
# MAPSERVER_BRANCH=branch-8-6
2218
2319
# add --no-cache to the command below to force getting the latest code
20+
2421
docker build `
2522
--tag "mapserver-workshop" `
2623
--target=runner `
2724
--build-arg=MAPSERVER_BRANCH=main `
2825
--build-arg=MAPSERVER_REPO=https://github.com/mapserver/mapserver `
29-
--no-cache `
3026
.
3127
32-
# docker run -it --name mapserver-workshop -p 8080:8080 mapserver-workshop
33-
3428
docker tag mapserver-workshop geographika/mapserver-workshop
3529
# docker login
3630
# geographika
@@ -49,8 +43,13 @@ Also check https://status.canonical.com/
4943
## Testing
5044

5145
```
46+
docker pull geographika/mapserver-workshop:latest
47+
# docker stop mapserver-workshop
48+
# docker rm mapserver-workshop
49+
docker run -it --name mapserver-workshop geographika/mapserver-workshop:latest bash
5250
docker start mapserver-workshop
5351
docker exec -it mapserver-workshop bash
52+
# mapserv -v
5453
```
5554

5655
## Build the Demo Image

workshop/content/docs/inputs/databases.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ docker exec -it mapserver2 bash
6060
# navigate to the folder containing the OSM FlatGeobuf files
6161
cd /etc/mapserver/data/osm
6262
# import the water polygons dataset to the Postgres database in the Postgres Docker image
63-
ogr2ogr -f "PostgreSQL" PG:"dbname=gis user=docker password=docker host=db port=5432" -nln water_a water_a.fgb
63+
gdal vector convert water_a.fgb PG:"dbname=gis user=docker password=docker host=db port=5432" --output-layer water_a --overwrite
6464
# now check the data details in the database
65-
ogrinfo PG:"host=db user=docker password=docker dbname=gis port=5432" water_a -summary
65+
gdal vector info PG:"host=db user=docker password=docker dbname=gis port=5432" --layer water_a --summary
6666
```
6767

6868
## Code

workshop/exercises/docker-db-compose.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@
2929

3030
services:
3131
mapserver:
32-
image: camptocamp/mapserver:8.4-gdal3.10
32+
image: geographika/mapserver-workshop:latest
3333
container_name: mapserver2
3434
ports:
35-
- 7000:80
35+
- 7000:8080
3636
environment:
3737
MAPSERVER_CONFIG_FILE: "/etc/mapserver/mapserver.conf"
3838
volumes:
@@ -56,7 +56,7 @@ services:
5656
5757
# from https://github.com/kartoza/docker-postgis/blob/develop/docker-compose.yml
5858
db:
59-
image: kartoza/postgis:17-3.5
59+
image: kartoza/postgis:18-3.6
6060
container_name: db
6161
volumes:
6262
- ./postgis-data:/var/lib/postgresql
Lines changed: 61 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,61 @@
1-
MAP
2-
NAME "arcgis"
3-
EXTENT -117.462057 33.895445 -117.436808 33.911090
4-
SIZE 400 400
5-
PROJECTION
6-
"init=epsg:4326"
7-
END
8-
WEB
9-
METADATA
10-
"ows_enable_request" "*"
11-
"ows_srs" "EPSG:4326 EPSG:3857"
12-
END
13-
END
14-
LAYER
15-
NAME "PoolPermits"
16-
TYPE POLYGON
17-
PROJECTION
18-
"init=epsg:3857"
19-
END
20-
CONNECTIONTYPE OGR
21-
CONNECTION "https://sampleserver6.arcgisonline.com/arcgis/rest/services/PoolPermits/FeatureServer/0/query?f=pjson"
22-
PROCESSING "RENDERMODE=ALL_MATCHING_CLASSES"
23-
CLASS
24-
STYLE
25-
COLOR 0 173 181
26-
OUTLINECOLOR 230 230 230
27-
OUTLINEWIDTH 0.1
28-
END
29-
END
30-
CLASS
31-
VALIDATION
32-
labels '.'
33-
default_labels 'hidden'
34-
END
35-
EXPRESSION ('%labels%' = 'visible')
36-
LABEL
37-
TEXT "[apn]"
38-
COLOR 220 240 255
39-
SIZE 8
40-
END
41-
END
42-
END
43-
44-
# this layer is used for the excercise only - not in the arcgis.html page
45-
LAYER
46-
NAME "PoolPermitLabels"
47-
TYPE POLYGON
48-
PROJECTION
49-
"init=epsg:3857"
50-
END
51-
CONNECTIONTYPE OGR
52-
CONNECTION "https://sampleserver6.arcgisonline.com/arcgis/rest/services/PoolPermits/FeatureServer/0/query?f=pjson"
53-
CLASS
54-
LABEL
55-
TEXT "[apn]"
56-
COLOR 220 240 255
57-
SIZE 8
58-
END
59-
END
60-
END
61-
END
1+
MAP
2+
NAME "arcgis"
3+
EXTENT -117.462057 33.895445 -117.436808 33.911090
4+
SIZE 400 400
5+
PROJECTION
6+
"init=epsg:4326"
7+
END
8+
WEB
9+
METADATA
10+
"ows_enable_request" "*"
11+
"ows_srs" "EPSG:4326 EPSG:3857"
12+
END
13+
END
14+
LAYER
15+
NAME "PoolPermits"
16+
TYPE POLYGON
17+
PROJECTION
18+
"init=epsg:3857"
19+
END
20+
CONNECTIONTYPE OGR
21+
CONNECTION "https://sampleserver6.arcgisonline.com/arcgis/rest/services/PoolPermits/FeatureServer/0/query?f=pjson"
22+
PROCESSING "RENDERMODE=ALL_MATCHING_CLASSES"
23+
CLASS
24+
STYLE
25+
COLOR 0 173 181
26+
OUTLINECOLOR 230 230 230
27+
OUTLINEWIDTH 0.1
28+
END
29+
END
30+
CLASS
31+
VALIDATION
32+
labels '.'
33+
default_labels 'hidden'
34+
END
35+
EXPRESSION ('%labels%' = 'visible')
36+
LABEL
37+
TEXT "[apn]"
38+
COLOR 220 240 255
39+
SIZE 8
40+
END
41+
END
42+
END
43+
44+
# this layer is used for the excercise only - not in the arcgis.html page
45+
LAYER
46+
NAME "PoolPermitLabels"
47+
TYPE POLYGON
48+
PROJECTION
49+
"init=epsg:3857"
50+
END
51+
CONNECTIONTYPE OGR
52+
CONNECTION "https://sampleserver6.arcgisonline.com/arcgis/rest/services/PoolPermits/FeatureServer/0/query?f=pjson"
53+
CLASS
54+
LABEL
55+
TEXT "[apn]"
56+
COLOR 220 240 255
57+
SIZE 8
58+
END
59+
END
60+
END
61+
END

workshop/exercises/mapfiles/clusters.map

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ MAP
44
UNITS DD
55
SIZE 800 600
66
PROJECTION
7-
"init=epsg:4326"
7+
"epsg:4326"
88
END
99
FONTSET "data/fonts/fontset.txt"
1010
WEB

workshop/exercises/mapfiles/contours.map

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ MAP
77
IMAGETYPE PNG24
88

99
PROJECTION
10-
"init=epsg:4326"
10+
"epsg:4326"
1111
END
1212

1313
WEB

workshop/exercises/mapfiles/countries.map

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ MAP
88

99
# the projection used for the map
1010
PROJECTION
11-
"init=epsg:4326"
11+
"epsg:4326"
1212
END
1313

1414

Lines changed: 22 additions & 22 deletions
Loading

0 commit comments

Comments
 (0)