All Projects → PDOK → mapserver-docker

PDOK / mapserver-docker

Licence: MIT license
Mapserver OGR GDAL PostGIS WMS WCS WFS with Lighttpd in Docker

Programming Languages

Dockerfile
14818 projects
HTML
75241 projects
NewLisp
63 projects
lua
6591 projects

Projects that are alternatives of or similar to mapserver-docker

krawler
A minimalist (geospatial) ETL
Stars: ✭ 51 (+183.33%)
Mutual labels:  wms, postgis, gdal, wcs, ogc
mapmint
Fast and easy webmapping.
Stars: ✭ 51 (+183.33%)
Mutual labels:  wms, wcs, ogc, wfs
deegree3
Official deegree repository providing geospatial core libraries, data access and advanced OGC web service implementations
Stars: ✭ 118 (+555.56%)
Mutual labels:  wms, wcs, ogc, wfs
gsky
Distributed Scalable Geospatial Data Server
Stars: ✭ 23 (+27.78%)
Mutual labels:  wms, postgis, wcs
geotrellis-server
Tools for building raster processing and display services
Stars: ✭ 65 (+261.11%)
Mutual labels:  wms, wcs, ogc
py-qgis-server
QGIS embbeded WMS/WFS/WCS asynchronous scalable http server
Stars: ✭ 28 (+55.56%)
Mutual labels:  wms, wcs, wfs
tailormap
B3partners Tailormap repository
Stars: ✭ 26 (+44.44%)
Mutual labels:  wms, ogc, wfs
Geoserver
Official GeoServer repository
Stars: ✭ 2,573 (+14194.44%)
Mutual labels:  wms, wcs, wfs
gismanager
Publish Your GIS Data(Vector Data) to PostGIS and Geoserver
Stars: ✭ 45 (+150%)
Mutual labels:  postgis, gdal
geoflow
R engine to orchestrate and run (meta)data workflows
Stars: ✭ 28 (+55.56%)
Mutual labels:  postgis, ogc
Geography for hackers
Geography for Hackers - Teaching all how to hack geography, use GIS, and think spatially
Stars: ✭ 25 (+38.89%)
Mutual labels:  postgis, gdal
tile-map-service-net5
Tile server for .NET 5 platform with MBTiles, Filesystem, GeoTIFF, HTTP sources and XYZ, TMS, WMTS, WMS endpoints (protocols support)
Stars: ✭ 45 (+150%)
Mutual labels:  wms, ogc
kvwmap
Internet GIS Framework for MapServer with PHP
Stars: ✭ 19 (+5.56%)
Mutual labels:  postgis, mapserver
openfluid
OpenFLUID framework and applications
Stars: ✭ 19 (+5.56%)
Mutual labels:  gdal, ogr
Hajk
A modern, full-featured OpenLayers based map viewer and editor
Stars: ✭ 65 (+261.11%)
Mutual labels:  wms, wfs
rok4
ROK4 est une suite d'outils open source développée par l'IGN France permettant la diffusion de données raster et vecteur en WMS, WMTS ou TMS. DEPRECATED ! Projet maintenu ici : https://github.com/rok4/documentation
Stars: ✭ 18 (+0%)
Mutual labels:  wms, ogc
batyr
Microservice for on-demand synchronization of geographical vector datasources to a PostgreSQL/PostGIS database. The service provides an HTTP API for easy integration into other applications.
Stars: ✭ 25 (+38.89%)
Mutual labels:  gdal, ogr
registrant
Python package used for generating HTML reports about the contents of Esri geodatabases.
Stars: ✭ 44 (+144.44%)
Mutual labels:  gdal, ogr
Mapserver
Source code of the MapServer project. Please submit pull requests to the 'main' branch.
Stars: ✭ 693 (+3750%)
Mutual labels:  wms, gdal
Mapwarper
free open source public map georeferencer, georectifier and warper
Stars: ✭ 152 (+744.44%)
Mutual labels:  wms, postgis

Mapserver docker

GitHub license GitHub release Docker Pulls

Mapserver Docker image using lighttpd build with GDAL/OGR, PostGIS to serve out WMS, WFS and WCS services.

TL;DR

docker build -t pdok/mapserver .
docker run -e MS_MAPFILE=/srv/data/example.map --rm -d \
            -p 80:80 --name mapserver-example -v `pwd`/example:/srv/data pdok/mapserver

docker stop mapserver-example

Introduction

This project aims to fulfill two needs:

  1. create OGC services that are deployable on a scalable infrastructure.
  2. create a useable Docker base image.

Fulfilling the first need the main purpose is to create an Docker base image that can be run on a platform like Kubernetes.

Regarding the second need, finding a usable Mapserver Docker image is a challenge. Most images expose the &map=... QUERY_STRING in the GetCapabilities, don't run in FastCGI and are based on Apache.

What will it do

It will create an Mapserver application that runs through lighttpd. With lua scripting the map=... QUERY_STRING is filter from incoming request. In other words the used Mapfile can only be set with an ENV.

The included EPSG file containing the projection parameters only contains a small set of available EPSG code, namely the once used by our organization. If one wants to use additional EPSG projections one can overwrite this file.

Docker image

The Docker image contains 2 stages:

  1. builder
  2. service

builder

The builder stage compiles Mapserver. The Dockerfile contains all the available Mapserver build option explicitly, so it is clear which options are enabled and disabled.

service

The service stage copies the Mapserver application, build in the first stage to the service stage, and configures lighttpd

Usage

Build

docker build -t pdok/mapserver .

For a specific Dutch version which includes a specific (and smaller) epsg file and necessary grid corrections files.

docker build -t pdok/mapserver:nl -f Dockerfile.NL .

Run

This image can be run straight from the command-line. A volume needs to be mounted on the container directory /srv/data. The mounted volume needs to contain a mapserver *.map file that matches the MS_MAPFILE env var.

docker run \
   --rm -d \
   -e MS_MAPFILE=/srv/data/example.map \
   -p 80:80 \
   --name mapserver-example \
   -v `pwd`/example:/srv/data \
   pdok/mapserver

Running the example above will create a service on the url http://localhost/?REQUEST=GetCapabilities&SERVICE=WMS that will accept something like a (GetMap request).

The environment variables that can be set are the following:

  • DEBUG
  • MIN_PROCS
  • MAX_PROCS
  • MAX_LOAD_PER_PROC
  • IDLE_TIMEOUT
  • MS_MAPFILE
  • PROJ_LIB

The environment variables, with the exception of MS_MAPFILE have a default value set in the Dockerfile.

The GDAL PROJ_LIB env var is default set with the value /usr/share/proj. For performance reasons one would like to set a custom PROJ_LIB containing a minimum of available EPSG codes. This can be done with the mentioned PROJ_LIB env var.

docker run \
   --rm -d \
   -p 80:80 \
   --name mapserver-run-example \
   -v `pwd`/example:/srv/data \
   -e DEBUG=0 \
   -e MIN_PROCS=1 \
   -e MAX_PROCS=3 \
   -e MAX_LOAD_PER_PROC=4 \
   -e IDLE_TIMEOUT=20 \
   -e MS_MAPFILE=/srv/data/example.map \
   pdok/mapserver

Projections

Altering the proj file is done for different reasons, adding custom projections or removing 'unused' ones for better performance. This can be done in a couple of ways through this setup.

base image

The best example for this is the Dockerfile.NL in this repository. This Dockerfile uses the main Dockerfile as a base image copies specific geodetic grid files and overwrites the default espg with a tuned one for the Netherlands.

A good resource for these geodetic files is the PROJ.org Datumgrid CDN.

volume

Another option is to create a proj file (like in the nl folder) and mount this to the container and set the PROJ_LIB env var to that location by adding the following parameters to the docker command:

-e PROJ_LIB=/my-custom-proj-dir \
-v `pwd`/path/to/proj/dir:/my-custom-proj-dir \

Example

When starting the container it will create a WMS & WFS service on the accespoint: http://localhost.

Example requests

Misc

Why Lighttpd

In our previous configurations we would run NGINX, while this is a good web service and has a lot of configuration options, it runs with multiple processes. There for we needed supervisord for managing this, whereas lighttpd runs as a single process. Also all the routing configuration options aren't needed, because that is handled by the infrastructure/platform, like Kubernetes. If one would like to configure some simple routing is still can be done in the lighttpd.conf.

Used examples

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].