From OpenStreetMap Wiki
(Redirected from MapServer)
Jump to: navigation, search

Mapserver ( serves maps to clients in cool ways, e.g. through a WMS server. You can drop a shapefile in a dir 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

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