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


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

Do I need to configure my 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

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 ♦
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

accept rate: 10%

Your answer
toggle preview

Follow this question

By Email:

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



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "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:


question asked: 25 Feb '18, 16:49

question was seen: 1,104 times

last updated: 11 May '18, 04:20

powered by OSQA