[OSM-talk] osm2shp or osm2pgsql

Andy Allan gravitystorm at gmail.com
Tue Dec 11 15:47:33 GMT 2007


On Dec 11, 2007 3:08 PM, The Bun <rosario.carbone at ipl.com> wrote:

> * How to define the table schema on PostGIS and does osm2pgsql already know
> the db schema?

You need to set up the database (as per
http://wiki.openstreetmap.org/index.php/Mapnik#PostgreSQL). When
osm2pgsql runs it creates all the tables it needs.

> * Does mapnik reads directly PostGIS or reads images generated from the db
> by generate_image.py?

Mapnik reads the PostGIS database and outputs .png files.
generate_tiles.py is the control loop for mapnik and knows which
coordinates to ask mapnik for each image file. The images are never in
the database.

> * Reading the Martijn post seems this model doesn't cache data, right? Is it
> the next step C) that does it, correct?

B) produces lots (1000s) of .png files on your disk. So you run
generate_tiles.py once and you have all the images you need and you
keep them all on the disk. But there's a limit as to how many tiles
you can render, since rendering the whole world takes up huge amounts
of space at high zoom levels.

What the tilecache is used for is rendering-on-the-fly when someone
wants an obscure place that you haven't got any pre-prepared tiles
for, you quickly render the needed tiles in less than a second. The
"caching" idea is only needed since otherwise you'd be rendering
everything on-the-fly all of the time so you keep the tiles around for
a few hours in the cache. But you'll cross that bridge when you come
to it.

> Sorry maybe too many questions but believe me I tried too at the minimum.

No problem.

Thanks,
Andy




More information about the talk mailing list