From OpenStreetMap Wiki
Jump to navigation Jump to search
FI HKI bus stops Mapserver.jpg
License MIT
Platforms Windows, Linux, and macOS
Status Active
Version 7.6.1 (2020-07-31)
Language multiple languages
Source code Blacktocat.svg MapServer/MapServer
Programming languages C and C++

MapServer is an Open Source platform for publishing spatial data and interactive mapping applications to the web.

MapServer ( serves maps to clients (such as through a WMS server), and is known as one of the fastest map engines, as it is written in C. You can drop a geojson, geopackage, shapefile, or any vector/raster format supported by GDAL in a dir, in any map projection supported by PROJ and it will get displayed on the map served by MapServer.

Tutorials for serving OSM data with MapServer


See Displaying OSM Shapefiles In MapServer

Setting up a MapServer at home

  • Windows users can leverage MS4W (MapServer for Windows), an installer that includes Apache, GDAL, PROJ, MapServer, and many tools (including osm2pgsql).

The following steps are necessary to set up Christopher's OSM implementation using MapServer (from a ML-mail[1]).

All the bits for the renderer:

  • Requires MapServer to be installed
    • PROJ support required
    • WMS Client support required
  • GDAL must be installed
    • With Python bindings for processing data
  • Requires mapscript PHP bindings

Data processing:


python < planet.osm > planet.gml
  • Run:
ogr2ogr planet.segments.shp planet.gml segments
ogr2ogr planet.ways.shp planet.gml ways


find world_mask/ -name '*.shp' | xargs ogrtindex world_tindex.shp

Once those are complete:

should be set up as a map file. (Drop it into a directory.)

Copy into a web accessible directory. Copy into the same directory, and alter:

"osm-july-merc"   => array( "july mercator Planet.osm",
                     array( 822116.8933, 411058.4466, 205529.2233,
                     102764.6117, 51382.3058, 25691.1529, 12845.5765,
                     6422.7882, 3211.3941, 1605.6971  ) ,

to point to the correct file location. (Don't worry about the scale levels -- they don't matter.)

Copy the HTML from and put it somewhere you want it to be.

If you have any questions about completing this process, please email me off list.

I don't have any plans to maintain the current sites, as I'm told they're no longer useful due to the age of the data. If someone is using this data for something, please let me know, and I will make sure I take care of meeting your needs.

Regards, -- Christopher Schmidt Web Developer