This is a static archive of our old OpenStreetMap Help Site. Please post any new questions and answers at community.osm.org.

osm2pgsql does not add a relation into db

0

I am using nominatim. I am working on a metro extract from https://mapzen.com/data/metro-extracts

During the nominatim setup process I add the {extract}.osm file. There is a osm_id= https://www.openstreetmap.org/relation/1942609 which I cannot find in the place and placex database using sql queries. How do I debug why this never got added to the database?

Even openstreetmap.org has problem with this relation. When you search for the exact name of the relation on the site "North West Delhi District", it goes to some other artifact.

When I hit nominatim with "osmid=1942609&osmtype=R", it fails. A very similar relation and right next to it in the file "1942605" succeeds...

Fails : https://nominatim.openstreetmap.org/details.php?osmtype=R&osmid=1942609

Succeeds : https://nominatim.openstreetmap.org/details.php?osmtype=R&osmid=1942605

asked 01 Aug '15, 03:21

arahut_kyenetic's gravatar image

arahut_kyenetic
11113
accept rate: 0%

edited 01 Aug '15, 03:24


One Answer:

2

Likely the relation itself is simply broken. See:

http://ra.osmsurround.org/analyzeRelation?relationId=1942609&_noCache=on

I would suggest editing it in JOSM and running the validator on it.

PS: as you can see there is a gap here : https://www.openstreetmap.org/relation/1942609#map=18/28.70812/77.16314

answered 03 Aug '15, 07:38

SimonPoole's gravatar image

SimonPoole ♦
44.7k13326701
accept rate: 18%

edited 04 Aug '15, 08:13

Simon, Thanks! for the answer. That makes sense. As a follow up is there a way to run the import in a less strict fashion?

(04 Aug '15, 00:02) arahut_kyenetic

@arahut_kyenetic IMHO you have two options:

  • fix the relation, wait till it it the planet / or in the extract you are importing and re-import
  • fix the relation and comsume diffs up to at least the point in time the relation is OK again.

THe problem with "less strict" is that osm2pgsql would still have to build a valid geometry from what exsits (aka close the polygon) which is naturally technically possible but I don't believe anybody has implemented that.

(04 Aug '15, 08:12) SimonPoole ♦

Source code available on GitHub .