Osm2pgsql creates additional unwanted tags


I’m using osm2pgsql to fill a POSTGIS DB on a daily basis with the GeoFrabrik .osm-Export of Luxembourg. It’s working fine and I plan to show all OSM tags of an item in a popup on the map.
I’ve seen that osm2pgsql unfortunately creates additional tags in the tags column of the osm_line table. These tags are:
z_order, route_name, route_pref_color
I know that this additional tag generation is controlled via style file and so I commented out the appropriate lines in default.style of osm2pgsql.

But they don’t disappear and so my osm tags table is a little bit confusing because of these additional tags not present in OSM database.

Has anyone an idea, how I can suppress this?

Thx and regards

ALTER TABLE planet_osm_roads DROP COLUMN z_order;

Hi sly,

thx for that hint, but my problem is different: I want to get rid of some parts of the column (type hstore), which contains the OSM tags in the format “key”=>“value”, e.g.

{“lcn”=>“yes”, “ref”=>“VdL 5”, “route”=>“bicycle”, “lcn_ref”=>“VDL-Nr5”, “network”=>“lcn”, “z_order”=>“0”, “distance”=>“3,2”, “roundtrip”=>“no”, “route_name”=>“Piste cyclable VDL Nr 05”, “route_pref_color”=>“0”}

This can nicely be converted into an array and loaded into the “properties” field of a GeoJSON string by simply evaluating it in PHP:

while ($row = pg_fetch_assoc ($qry_result)) {
eval ( “$tags = array (” . $row[‘tags’] . “);” );

Unfortunately, the column tags contains some non-OSM tags…

I assume I have to dive into the osm2pgsql sources.


ooops, sorry, I missed your “(…) creates additional tags in the tags column”

I do not use hstore additionnal storage in the tags column mysel so haven’t a clue of why are those non-tags added to this column.
Either you feel brave and can dive into some C code, or I asume there might be a request to drop a part of the hash after the import in order to avoid touching osm2pgsql