NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

After having installed PostgreSQL, and successfully imported the full planet to an local API DB, and having successfully setup the replication process to keep it updated using the hourly diffs, I would like to start drawing my own tiles from this database.

I made a short experiment before and had to export and import the API DB to a PostGIS database, and was able to draw tiles from this PostGIS database (after encountering a LOT of trouble setting up Mapnik on Windows...). However, in this experiment, I used just a very small extract from the main database, and not the full planet.

Knowing that it would take a very long time (and a lot of memory and CPU resources) to export the full planet to a PostGIS database (my API DB has 1.5 TB as of today after a VACUUM ANALYZE... and growing!), I would like to know if it is possible to somehow draw tiles directly from the local API DB without the intermediate PostGIS database.

Surely, the performance would be quite lower than the "standard" way of doing things, but it would save me a lot of time and resources.

Thanks in advance!

P.S.: Working with a subset or extract of the full planet does NOT interest me.

asked 04 Jul '13, 01:43

MCPicoli's gravatar image

MCPicoli
2.2k133047
accept rate: 24%

closed 19 Sep '13, 21:52

The question has been closed for the following reason "The question is answered, right answer was accepted" by MCPicoli 19 Sep '13, 21:52


I don't think anyone has done this before and it would be terribly, terribly slow (to the point of being totally unusable). But if you are hell-bent on trying, you could probably write a set of function-based views that emulate the geometry tables produced by osm2pgsql, and therefore enable rendering from an APIDB schema database.

Another possible option is using Mapnik's OSM backend instead of the PostGIS backend - i.e. to render a map for a specific area, run an Osmosis task that extracts that area from your database and then use Mapnik's OSM backend to read that data. Since the data structure is different from a standard osm2pgsql database in this case, you will have to use a different map style than the standard Mapnik style.

All these options are however quite painful in one way or another, and if you want proper rendering without waiting forever, you will need database tables with pre-made geometries.

permanent link

answered 04 Jul '13, 07:49

Frederik%20Ramm's gravatar image

Frederik Ramm ♦
82.5k927201273
accept rate: 23%

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×341
×287
×165
×134
×11

question asked: 04 Jul '13, 01:43

question was seen: 4,792 times

last updated: 19 Sep '13, 21:52

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum