Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 34 additions & 26 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,34 @@
name: Test documentation ⚙️

on:
pull_request:
paths:
- 'workshop/content/**'

defaults:
run:
working-directory: workshop/content

jobs:
build:
name: Test documentation build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: '3.x'
- name: Install requirements 📦
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Deploy 📦
run: zensical build --clean --strict
name: Test documentation and Mapfiles ⚙️

on:
pull_request:
paths:
- 'workshop/content/**'
- 'workshop/exercises/mapfiles/**'

defaults:
run:
working-directory: workshop

jobs:
build:
name: Test documentation build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: '3.x'
- name: Test Mapfiles
run: |
pip install mappyfile
mappyfile validate exercises/mapfiles/*.map
- name: Install doc requirements 📦
run: |
cd content
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Deploy 📦
run: |
cd content
zensical build --clean --strict
6 changes: 5 additions & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ghcr.io/osgeo/gdal:ubuntu-full-3.12.2 AS gdal
FROM ghcr.io/osgeo/gdal:ubuntu-full-3.13.1 AS gdal
# see https://github.com/OSGeo/gdal/tree/master/docker#ubuntu-based

FROM gdal AS builder
Expand Down Expand Up @@ -73,15 +73,19 @@ RUN cmake .. \
-DWITH_CAIRO=1 \
-DWITH_RSVG=1 \
-DUSE_PROJ=1 \
-DPROJ_INCLUDE_DIR=/usr/local/gdal-internal/include \
-DPROJ_LIBRARY=/usr/local/gdal-internal/lib/libinternalproj.so \
-DUSE_WFS_SVR=1 \
-DUSE_OGCAPI_SVR=1 \
-DWITH_ORACLESPATIAL=0 \
-DWITH_PYTHON=1 \
-DWITH_MSSQL2008=0

# Run the make command for pythonmapscript-wheel
RUN cmake --build . --target pythonmapscript-wheel
RUN ninja install


FROM gdal AS runner
LABEL maintainer="sethg@geographika.co.uk"
SHELL ["/bin/bash", "-o", "pipefail", "-cux"]
Expand Down
17 changes: 8 additions & 9 deletions docker/ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,18 @@ start "C:\Program Files\Docker\Docker\Docker Desktop.exe"

cd D:\GitHub\getting-started-with-mapserver\docker

docker build `
--tag "mapserver-workshop" `
--target=runner `
--build-arg=MAPSERVER_BRANCH=main `
--build-arg=MAPSERVER_REPO=https://github.com/mapserver/mapserver `
.
# MAPSERVER_BRANCH=main
# MAPSERVER_BRANCH=branch-8-6

# add --no-cache to the command below to force getting the latest code

docker build `
--tag "mapserver-workshop" `
--target=runner `
--build-arg=MAPSERVER_BRANCH=main `
--build-arg=MAPSERVER_REPO=https://github.com/mapserver/mapserver `
--no-cache `
.

# docker run -it --name mapserver-workshop -p 8080:8080 mapserver-workshop

docker tag mapserver-workshop geographika/mapserver-workshop
# docker login
# geographika
Expand All @@ -49,8 +43,13 @@ Also check https://status.canonical.com/
## Testing

```
docker pull geographika/mapserver-workshop:latest
# docker stop mapserver-workshop
# docker rm mapserver-workshop
docker run -it --name mapserver-workshop geographika/mapserver-workshop:latest bash
docker start mapserver-workshop
docker exec -it mapserver-workshop bash
# mapserv -v
```

## Build the Demo Image
Expand Down
4 changes: 2 additions & 2 deletions workshop/content/docs/inputs/databases.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ docker exec -it mapserver2 bash
# navigate to the folder containing the OSM FlatGeobuf files
cd /etc/mapserver/data/osm
# import the water polygons dataset to the Postgres database in the Postgres Docker image
ogr2ogr -f "PostgreSQL" PG:"dbname=gis user=docker password=docker host=db port=5432" -nln water_a water_a.fgb
gdal vector convert water_a.fgb PG:"dbname=gis user=docker password=docker host=db port=5432" --output-layer water_a --overwrite
# now check the data details in the database
ogrinfo PG:"host=db user=docker password=docker dbname=gis port=5432" water_a -summary
gdal vector info PG:"host=db user=docker password=docker dbname=gis port=5432" --layer water_a --summary
```

## Code
Expand Down
6 changes: 3 additions & 3 deletions workshop/exercises/docker-db-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@

services:
mapserver:
image: camptocamp/mapserver:8.4-gdal3.10
image: geographika/mapserver-workshop:latest
container_name: mapserver2
ports:
- 7000:80
- 7000:8080
environment:
MAPSERVER_CONFIG_FILE: "/etc/mapserver/mapserver.conf"
volumes:
Expand All @@ -56,7 +56,7 @@ services:

# from https://github.com/kartoza/docker-postgis/blob/develop/docker-compose.yml
db:
image: kartoza/postgis:17-3.5
image: kartoza/postgis:18-3.6
container_name: db
volumes:
- ./postgis-data:/var/lib/postgresql
Expand Down
122 changes: 61 additions & 61 deletions workshop/exercises/mapfiles/arcgis.map
Original file line number Diff line number Diff line change
@@ -1,61 +1,61 @@
MAP
NAME "arcgis"
EXTENT -117.462057 33.895445 -117.436808 33.911090
SIZE 400 400
PROJECTION
"init=epsg:4326"
END
WEB
METADATA
"ows_enable_request" "*"
"ows_srs" "EPSG:4326 EPSG:3857"
END
END
LAYER
NAME "PoolPermits"
TYPE POLYGON
PROJECTION
"init=epsg:3857"
END
CONNECTIONTYPE OGR
CONNECTION "https://sampleserver6.arcgisonline.com/arcgis/rest/services/PoolPermits/FeatureServer/0/query?f=pjson"
PROCESSING "RENDERMODE=ALL_MATCHING_CLASSES"
CLASS
STYLE
COLOR 0 173 181
OUTLINECOLOR 230 230 230
OUTLINEWIDTH 0.1
END
END
CLASS
VALIDATION
labels '.'
default_labels 'hidden'
END
EXPRESSION ('%labels%' = 'visible')
LABEL
TEXT "[apn]"
COLOR 220 240 255
SIZE 8
END
END
END
# this layer is used for the excercise only - not in the arcgis.html page
LAYER
NAME "PoolPermitLabels"
TYPE POLYGON
PROJECTION
"init=epsg:3857"
END
CONNECTIONTYPE OGR
CONNECTION "https://sampleserver6.arcgisonline.com/arcgis/rest/services/PoolPermits/FeatureServer/0/query?f=pjson"
CLASS
LABEL
TEXT "[apn]"
COLOR 220 240 255
SIZE 8
END
END
END
END
MAP
NAME "arcgis"
EXTENT -117.462057 33.895445 -117.436808 33.911090
SIZE 400 400
PROJECTION
"init=epsg:4326"
END
WEB
METADATA
"ows_enable_request" "*"
"ows_srs" "EPSG:4326 EPSG:3857"
END
END
LAYER
NAME "PoolPermits"
TYPE POLYGON
PROJECTION
"init=epsg:3857"
END
CONNECTIONTYPE OGR
CONNECTION "https://sampleserver6.arcgisonline.com/arcgis/rest/services/PoolPermits/FeatureServer/0/query?f=pjson"
PROCESSING "RENDERMODE=ALL_MATCHING_CLASSES"
CLASS
STYLE
COLOR 0 173 181
OUTLINECOLOR 230 230 230
OUTLINEWIDTH 0.1
END
END
CLASS
VALIDATION
labels '.'
default_labels 'hidden'
END
EXPRESSION ('%labels%' = 'visible')
LABEL
TEXT "[apn]"
COLOR 220 240 255
SIZE 8
END
END
END

# this layer is used for the excercise only - not in the arcgis.html page
LAYER
NAME "PoolPermitLabels"
TYPE POLYGON
PROJECTION
"init=epsg:3857"
END
CONNECTIONTYPE OGR
CONNECTION "https://sampleserver6.arcgisonline.com/arcgis/rest/services/PoolPermits/FeatureServer/0/query?f=pjson"
CLASS
LABEL
TEXT "[apn]"
COLOR 220 240 255
SIZE 8
END
END
END
END
2 changes: 1 addition & 1 deletion workshop/exercises/mapfiles/clusters.map
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ MAP
UNITS DD
SIZE 800 600
PROJECTION
"init=epsg:4326"
"epsg:4326"
END
FONTSET "data/fonts/fontset.txt"
WEB
Expand Down
2 changes: 1 addition & 1 deletion workshop/exercises/mapfiles/contours.map
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ MAP
IMAGETYPE PNG24

PROJECTION
"init=epsg:4326"
"epsg:4326"
END

WEB
Expand Down
2 changes: 1 addition & 1 deletion workshop/exercises/mapfiles/countries.map
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ MAP

# the projection used for the map
PROJECTION
"init=epsg:4326"
"epsg:4326"
END


Expand Down
44 changes: 22 additions & 22 deletions workshop/exercises/mapfiles/data/icons/tree.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions workshop/exercises/mapfiles/lakes.map
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ MAP
EXTENT 393234.3937012631 5208170.531190613 495403.1713263091 5303964.876754144
SIZE 800 600
PROJECTION
"init=epsg:26915"
"epsg:26915"
END
FONTSET "data/fonts/fontset.txt"
FONTSET "data/fonts/fontset.txt"
WEB
METADATA
"ows_enable_request" "*"
Expand Down
Loading