joto / osmium

C++/Javascript framework for working with OSM files.
http://wiki.openstreetmap.org/wiki/Osmium
GNU General Public License v3.0
123 stars 31 forks source link

update the database using changesets removes tags in "hstore" columns of changed items #83

Closed thbeutin closed 11 years ago

thbeutin commented 11 years ago

When creating an OSM database using hstore and columns using the command

osm2pgsql -c -d db_name -s -C 8000 -k -j -v -S style_file COUNTRY-latest.osm.pbf

a database is created with all tags in the "tags" hstore column and some selected tags are stored in dedicated columns. So far, so good and as expected. However, when updating the database using the command

osm2pgsql -a -d db_name -s -C 2500 -j -k -v -S style_file changes.osc.gz

all items that were updated may not have all their tags in the "tags" column of the hstore anymore. Tags that have a separate column in the table disappear from the "tags" hstore. Given that during the initial import tags are stored simultaneously in the dedicated columns and the "tags" hstore column, I expect that updates show the same behavior and update tags both in the separate columns as well as in the "tags" hstore.

Let me give an example: Item abc has a tag building->yes in the "tags" hstore column as well as a "yes" in the "building" column. If I now update this item and add a building:use->residential tag, the tag building->yes in database "tags" hstore column is deleted.

On request I can provide sample data to reproduce this issue.

joto commented 11 years ago

This is the Osmium issue tracker. Osmium doesn't have anything to do with osm2pgsql.

thbeutin commented 11 years ago

Sorry! Too many open tabs in browser...