You are not logged in.

Announcement

*** NOTICE: forum.openstreetmap.org is being retired. Please request a category for your community in the new ones as soon as possible using this process, which will allow you to propose your community moderators.
Please create new topics on the new site at community.openstreetmap.org. We expect the migration of data will take a few weeks, you can follow its progress here.***

#1 2011-03-10 09:20:13

Nils_Lux
Member
Registered: 2008-06-11
Posts: 18

Osm2pgsql creates additional unwanted tags

Hi,

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
Nils

Offline

#2 2011-03-10 18:13:40

sly
Member
Registered: 2008-07-15
Posts: 75

Re: Osm2pgsql creates additional unwanted tags

ALTER TABLE planet_osm_roads DROP COLUMN z_order;
http://www.postgresql.org/docs/8.1/stat … table.html

Offline

#3 2011-03-10 20:31:20

Nils_Lux
Member
Registered: 2008-06-11
Posts: 18

Re: Osm2pgsql creates additional unwanted tags

Hi sly,

thx for that hint, but my problem is different: I want to get rid of some parts of the column <tags> (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.

Regards
Nils

Offline

#4 2011-03-11 10:46:43

sly
Member
Registered: 2008-07-15
Posts: 75

Re: Osm2pgsql creates additional unwanted tags

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

Offline

Board footer

Powered by FluxBB