This is a static archive of our old OpenStreetMap Help Site. Please post any new questions and answers at community.osm.org.

Configure iD and openstreetmap-website to use local postgresql DB imported with osm2pgsql

1

I would like to create my own local openstreetmap-website with iD editor and edit local postgres database which was imported with osm2pgsql.

Here is the list of tables osm2pgsql made:

gis=# \dt
              List of relations
 Schema |        Name        | Type  | Owner 
--------+--------------------+-------+-------
 public | planet_osm_line    | table | osm
 public | planet_osm_nodes   | table | osm
 public | planet_osm_point   | table | osm
 public | planet_osm_polygon | table | osm
 public | planet_osm_rels    | table | osm
 public | planet_osm_roads   | table | osm
 public | planet_osm_ways    | table | osm
 public | spatial_ref_sys    | table | osm

openstreetmap-website DB scheme is quite different:

current_relation_members
current_relation_tags
current_relations
current_way_nodes
current_way_tags
current_ways

How should I correspond the osm2pgsql and openstreetmap-website DB schemes?

asked 11 Aug '14, 11:49

kayrus's gravatar image

kayrus
31223
accept rate: 0%

edited 11 Aug '14, 12:58


One Answer:

2

It is not possible to run rendering and an OSM API from the same database. The OSM API needs an "APIDB" database that you create with Osmosis; it has history information and a full set of tags for every object, but no pre-computed geometries. Rendering, or other use cases that depend on osm2pgsql-imported data, depend on pre-computed geometries but do not need all tags and no history.

To update your rendering database, you will have to make a change dump from your APIDB database and import that into your rendering database with osm2pgsql (--append mode).

If this takes too long then you have to either run it on different machines or find other ways to improve your toolchain.

answered 11 Aug '14, 13:41

Frederik%20Ramm's gravatar image

Frederik Ramm ♦
82.5k927201273
accept rate: 23%

Source code available on GitHub .