How and where to store OSM data?!

Dear All,

I want to develop a web application that uses OSM data as base map and overlays other data on it (point features with thematic attributes). I do not want to connect it to OSM online to retrieve the base map, but I am looking for a solution to use OSM data and store them somehow in a DBMS on my own server and retrieve that from there. Is that possible? How can I do that? which DBMS do you suggest I should use? what map engines are the best for doing this? where should I start from? Are there any posts/ebooks that explain this (or few steps of it at least) ?
Your help would be highly appreciated.


Did you take a look at

Hi Amin,

First one question: what planed coverage (whole world, only one continent or country etc) has your web application? How often do you plan to update it’s data?

As you what to render the basemap yourself the DBMS decision depends on the style and rendering engine you are planning to use. For example: the main mapnik style of requires an osm2pgsql schema in an postgres database and is renderd with Mapnik. Other map styles (written in cascadenik, carto or mapcss) are probably more flexible. Otherwise you can also try to modify an existing style to fit to an different database schema and therefore DBMS.

An overview of available tools, schemas, databases can be found at following wikipages:

An general “howto setup an mapnik renderer stack” is available at


No. Thank you for sharing the link! it gives quite well answer to all my questions… :slight_smile: :slight_smile:

Hi Andi,

Thank you for your message! The links you provided are exactly what I need. To answer your question: My web-service would cover a whole country and it is not planned to update it, since I only need to load the base map as a reference map. On top of it, I am planning to define some layers that users can define point features and edit its attributes. Now, one quick question, for the layer (to be edited and overlayed on the base map) what technology do you think would best fit? I am thinking of using a KML files for storage, and AJAX for instantaneous storage and retrieval of data on KML files. What’s your opinion regarding this matter? Thanks in advance… :slight_smile:

One possibility is to use Web Feature Service. There are ready made clients which support editing with WFS, both desktop GIS like QGIS and uDIg, and browser applications. Basic OpenLayers example is here
A more rich demo is at
Add some layer with the top-left corner green plus button. After adding some overlay layer you can use the Edit tools for editing existing features or adding new ones.

Regarding WFS: I don’t like this OGC standards, they make everythink more complicated then needed. In this case you need an backend which also supports wfs, in the example a software called geoserver from opengeo is used.

What kind of data do you plan to collect there? Only points or also lines or areas? If it’s data that’s interesting also for other groups we would prefer if you store it inside the osm database.

In general I would answer: It depends on the planned usage of the data. What do you want to do with the data, after you have collected everything?

The data are only points with additional attributes. The data are collected/created for management of an event (that lasts for couple of weeks) and would be out-of-date after that. In addition, the people would not be interested in these data. That’s why there would be no need for updating OSM.

So, what’s your opinion? do you agree with me (using KML)?

WFS is really more complicated than needed but because there are ready made libraries and utilities users and service administrators do not need to know about all the bizarre things. Installing Geoserver is easy and well documented. TinyOWS is another possibility and installing it is this hard (capture from

" Installing the Current Trunk from GIT

To build from SVN, you must first install the autoconf utility, and git application .

$ git clone git://
$ cd tinyows
$ autoconf
$ ./configure
$ make
$ sudo make install
$ sudo make install-demo

Then copy the tinyows binary to your cgi-bin directory."

You will also need a web server, for example Apache. PostGIS you obviously have already.
Once installation is ready you will only need to edit the TinyOWS configuration file and add your own PostGIS tables as new layers to the service. For each new layer you will need to add six lines of text