[Tile-serving] [osm2pgsql] --apend does not work when data is imported with --flat-nodes (#126)
Marcos Dione
notifications at github.com
Tue Mar 25 22:03:17 UTC 2014
If I create a brand new database with the --create, --slim and --flat-nodes options, some tables that seems to be needed for the --append are not created, so the --append fails. For example:
# import time...
osm2pgsql --create --drop --database gis --slim --flat-nodes /home/mdione/src/projects/osm/nodes.cache --cache 2048 --number-processes 4 --unlogged --bbox -11.9531,34.6694,29.8828,58.8819 europe-latest.osm.pbf
[all goes fine]
These the resulting tables and indexes:
Schema | Name | Type | Owner | Size | Description
--------+--------------------+-------+--------+----------+-------------
public | geography_columns | view | mdione | 0 bytes |
public | geometry_columns | view | mdione | 0 bytes |
public | planet_osm_line | table | mdione | 11264 MB |
public | planet_osm_nodes | table | mdione | 43008 MB |
public | planet_osm_point | table | mdione | 2181 MB |
public | planet_osm_polygon | table | mdione | 23552 MB |
public | planet_osm_rels | table | mdione | 871 MB |
public | planet_osm_roads | table | mdione | 2129 MB |
public | planet_osm_ways | table | mdione | 43008 MB |
public | raster_columns | view | mdione | 0 bytes |
public | raster_overviews | view | mdione | 0 bytes |
public | spatial_ref_sys | table | mdione | 3 MB |
--------+--------------------+-------+--------+----------+--------------
Schema | Name | Type | Owner | Table | Size | Description
--------+-----------------------------+-------+--------+--------------------+----------+-------------
public | planet_osm_line_index | index | mdione | planet_osm_line | 4105 MB |
public | planet_osm_line_pkey | index | mdione | planet_osm_line | 748 MB |
public | planet_osm_nodes_pkey | index | mdione | planet_osm_nodes | 21504 MB |
public | planet_osm_point_index | index | mdione | planet_osm_point | 1506 MB |
public | planet_osm_point_pkey | index | mdione | planet_osm_point | 566 MB |
public | planet_osm_polygon_index | index | mdione | planet_osm_polygon | 8074 MB |
public | planet_osm_polygon_pkey | index | mdione | planet_osm_polygon | 1953 MB |
public | planet_osm_rels_idx | index | mdione | planet_osm_rels | 16 kB |
public | planet_osm_rels_parts | index | mdione | planet_osm_rels | 671 MB |
public | planet_osm_rels_pkey | index | mdione | planet_osm_rels | 37 MB |
public | planet_osm_roads_index | index | mdione | planet_osm_roads | 359 MB |
public | planet_osm_roads_pkey | index | mdione | planet_osm_roads | 77 MB |
public | planet_osm_ways_idx | index | mdione | planet_osm_ways | 2161 MB |
public | planet_osm_ways_nodes | index | mdione | planet_osm_ways | 53248 MB |
public | planet_osm_ways_pkey | index | mdione | planet_osm_ways | 6926 MB |
public | spatial_ref_sys_pkey | index | mdione | spatial_ref_sys | 144 kB |
--------+-----------------------------+-------+--------+--------------------+-----------+
As you can see, nothing related to nodes, rel(ation)s and ways, which are correctly in the flat nodes file. Now let's try to update:
# update time...
$ osm2pgsql --append --database gis --slim --flat-nodes /home/mdione/src/projects/osm/nodes.cache --cache 2048 --number-processes 4 362.osc.gz
osm2pgsql SVN version 0.82.0 (64bit id space)
[...]
Setting up table: planet_osm_nodes
PREPARE insert_node (int8, int4, int4, text[]) AS INSERT INTO planet_osm_nodes VALUES ($1,$2,$3,$4);
PREPARE get_node (int8) AS SELECT lat,lon,tags FROM planet_osm_nodes WHERE id = $1 LIMIT 1;
PREPARE delete_node (int8) AS DELETE FROM planet_osm_nodes WHERE id = $1;
failed: ERROR: relation "planet_osm_nodes" does not exist
LINE 1: ...rt_node (int8, int4, int4, text[]) AS INSERT INTO planet_osm...
^
Error occurred, cleaning up
What I would spect from this command is that, given that all nodes, rels and ways info is in the flat nodes file, it shouldn't try to read those tables in postgres.
---
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/osm2pgsql/issues/126
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/tile-serving/attachments/20140325/128665a1/attachment.html>
More information about the Tile-serving
mailing list