I'm making an evaluation to replace the TomTom commercial Database (ex TeleAtlas) with Open Street Map data.

What I need to do is use the street map as a base layer for my WebGIS applications. I use MapServer as application server and I made styles for features of the TomTom DB based on attributes values. I want to do the same with OSM data.

Looking on the web I found many references to MapBox, TileMill, preconfigured style schemas and so on... but I have some questions/doubts about all that.

1) If I need to render this data through MapServer, can I avail of all these instruments?

2) Is there a way to convert those styles to MapServer .MAP files?

3) I imported OSM data from SHP files downloaded from a web site that regularly creates them from updated OSM data. I read something about OSM2PGSQL, OSM2PO, OSMOSIS and so on... but I don't really understand what they are and how they work and if I can use them with my actual database. Do I really need to import OSM data with such tools?

  • Are you using postGIS-enabled PostgreSQL database to store your data?
    – ustroetz
    Commented May 27, 2013 at 18:05
  • Oh yes! I didn't mention but of course I have PostGIS! Commented May 28, 2013 at 8:40

2 Answers 2


I am not aware that you have a converter from Mapnik to Mapserver mapfile styles.

You will really need a lot of tools for what you expect. OSM world has his own set of tools because of their DB complexity and storage (XML)

I don't recommend to use Shapefile for rendering OSM data. If you need lot of custom styles, the shp don't give you all the attributes required to do like this. You can always look at this minimum mapfile from OSM website

IMHO it's better to follow all the instructions available on the official Mapserver wiki. You will need OSM2PGSQL but with it, you can update your DB regularly (worth when you see the full OSM DB size)

Instructions depend on your OS:

At the end, your choice ;)

  • I suspected it... So I need to follow the istructions and use the appropriate instruments. Anyway I don't need the entire DB, since I work for a Public Administration of a town and I need the cartography of that town only and a few more. Does the shapefiles generated by some people have all the attributes or not? Commented May 28, 2013 at 8:36
  • I also need to convert the Spatial Reference System to EPSG 3003. Can I import the data and convert them automatically during import process or do I have to convert them later? One of the reasons because I was trying to use the SHP files was that I have a tool on GeoMedia based on some grids of my territory that helps the Spatial Reference conversion to be more accurate. Commented May 28, 2013 at 13:37
  • Tried RenderingOsmDataWindows but since I use Postgres v8.3 now I'm stuck on the script psql -U postgres -d osm -f "osm2pgsql-to-imposm-schema.sql" that uses Window Functions that are available only on Postgres v8.4 and above. Then, what about Osmosis procedure? How does it differ from OSM2PGSQL in the results? Commented May 30, 2013 at 8:28
  • 1
    The problem is you are using an outdated version of PostgreSQL with no support. So, you can't expect it works. For OSMOSIS, the resulting schema will not work with the mapfile syntax, so it will not work
    – ThomasG77
    Commented May 30, 2013 at 13:18
  • Yes, you're right and I know it's very outdated... but I can't do so much since it is a third party software platform we acquired. Now we're expecting a new version of the software that should has a new version of Postgres. I only wanted to make some tests with the actual existing configuration... but there're too many hitches. :-( Commented May 30, 2013 at 13:47

Regarding to steps to get the OSM data into your database:

I would not use shapefiles to process your data. It is easier to import the OSM data (*.xml) directly into your database.

  1. Download the raw OSM files from Geofabrik for your desired region.

  2. Setup Osmosis on your system.

  3. Filter with Osmosis the features you are interested in.

  4. Write the extracted data with Osmosis to your PostGIS database.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.