NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

So im trying todo some analysize with osm2pgsql

From what I read from the documentation I was supposed to call the osm2pgsql command with -G which is what I have done.

Now I'm trying to understand why there are no planet_osm_polygon or planet_osm_line for certain planet_osm_rels.

E.g. lets take following relation

SELECT * FROM planet_osm_rels WHERE id=6720604

"id","way_off","rel_off","parts","members","tags"
6720604,0,74,"{326805364,326805360,94231412,31114639,31114638,31981611,31981635,31114634,558620158,558620159,558620157,558620160,30081284,31114640,558620183,31114633,558620149,31114636,558620152,558620161,558620156,558620151,558620153,326805353,31981645,326805358,326805359,31981639,326805355,558620147,326805350,30081288,326805354,94231410,558620169,558620168,558620167,31096644,558620166,558620170,30081299,558620163,558620162,558620165,100534409,558620150,558620148,31114637,558620164,31977042,54517047,30081290,454328977,326805362,558730585,32009830,558620180,558620181,54255111,186651151,326805357,259267365,558620176,37994264,54517048,326805363,558620177,558620178,558620175,31976982,454328978,23045055,326805361,326805352,3479986,3479881,7981263,7981262,7981261,7981260,7981259,7981257,7981256,7981255,7981254,7981253,7981252,7982581}","{r3479986,"""",r3479881,"""",w326805364,"""",w326805360,"""",w94231412,"""",w31114639,"""",w31114638,"""",w31981611,"""",w31981635,"""",w31114634,"""",w558620158,"""",w558620159,"""",w558620157,"""",w558620160,"""",w30081284,"""",w31114640,"""",w558620183,"""",w31114633,"""",w558620149,"""",w31114636,"""",w558620152,"""",w558620161,"""",w558620156,"""",w558620151,"""",w558620153,"""",w326805353,"""",w31981645,"""",w326805358,"""",w326805359,"""",w31981639,"""",w326805355,"""",w558620147,"""",w326805350,"""",w30081288,"""",w326805354,"""",w94231410,"""",w558620169,"""",w558620168,"""",w558620167,"""",w31096644,"""",w558620166,"""",w558620170,"""",w30081299,"""",w558620163,"""",w558620162,"""",w558620165,"""",w100534409,"""",w558620150,"""",w558620148,"""",w31114637,"""",w558620164,"""",w31977042,"""",w54517047,"""",w30081290,"""",w454328977,"""",w326805362,"""",w558730585,"""",w32009830,"""",w558620180,"""",w558620181,"""",w54255111,"""",w186651151,"""",w326805357,"""",w259267365,"""",w558620176,"""",w37994264,"""",w54517048,"""",w326805363,"""",w558620177,"""",w558620178,"""",w558620175,"""",w31976982,"""",w454328978,"""",w23045055,"""",w326805361,"""",w326805352,"""",r7981263,"""",r7981262,"""",r7981261,"""",r7981260,"""",r7981259,"""",r7981257,"""",r7981256,"""",r7981255,"""",r7981254,"""",r7981253,"""",r7981252,"""",r7982581,""""}","{leisure,ski_resort,name,Savognin,site,piste,type,site}"

For that relation I can't find any corresponding line or polygon.

Do I need to configure my default.style differently?

Or bascially what is the cause why there is no line or polygon and how can I make sure one get's generated. I hope that is possible :)

asked 25 Feb '18, 16:49

gabac's gravatar image

gabac
16224
accept rate: 0%

edited 25 Feb '18, 16:57


That relation is a type=site relation. My recollection is that osm2pgsql doesn't process those at all. There's a discussion about the rendering of type=site relations in the standard style here - that links to other issues discussing "what would need to change to render them".

If there's some useful geometry in a type=site relation you could get osm2pgsql to process it by using a lua tag transform. The relevant bits of the one used by OSM's standard style are here and here.

What you'd probably need to do is:

  • Identify a subset of type=site relations with valid geometry
  • Write a lua tag transform to turn them into something that osm2pgsql will continue to process
  • Write some style code in your map style to do something useful with the data.
permanent link

answered 25 Feb '18, 17:07

SomeoneElse's gravatar image

SomeoneElse ♦
36.9k71370866
accept rate: 16%

edited 25 Feb '18, 17:08

exact, osm2pgsqk processes only a part of the "multipolygon" , "boundary" and "route" types. Each tool has its algorithm and others analyze more relation types. Osm_id is negative for a relation.

(11 May '18, 04:20) AntaC

Osm2pgsql is able to handle routes and multipolygon relations, not sites. From the routes and MPs relations, there is a way to calculate a geometry and put them in the planet_osm_line or_polygon tables, but not for sites.

Of you want to use sites, then you can create yourself a polygon around their member, for example, and insert them into the planet_osm_polygon table. But that's a process I don't think Osm2pgsql can do. Yves

permanent link

answered 25 Feb '18, 17:22

yvecai's gravatar image

yvecai
1.5k1226
accept rate: 9%

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×263
×165
×134
×92

question asked: 25 Feb '18, 16:49

question was seen: 2,660 times

last updated: 11 May '18, 04:20

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum