2

I am unable to get Alaska state polygon when filtering with osmium. Any idea how to debug/solve this?

Info:

  • downloaded: http://download.geofabrik.de/north-america-latest.osm.pbf
  • trying to filter US states, all work except Alaska
  • osmium tags-filter north-america-latest.osm.pbf r/name=Alaska or osmium tags-filter north-america-latest.osm.pbf r/ref=AK do not produce state polygon in result, but for ie. Nevada and all other states works osmium tags-filter north-america-latest.osm.pbf r/ref=NV
  • relation exists on web and wasn't changed in last month: https://www.openstreetmap.org/relation/1116270#map=3/56.61/-130.25
  • tried osmium getid north-america-latest.osm.pbf r1116270 and got empty file
  • similar queries work in overpass as expected:
[out:json][timeout:2500];
(
 relation["ref"="AK"]({{bbox}});
);
out body;
>;
out skel qt;

enter image description here

EDIT1

  • Tried with planet-210628.osm.pbf same results, so I guess it is something with osmium
  • After studying .osm and not just .pbf size, I now know that I get relation 1116270, but it has only one node and 100+ ways, so I get that polygon, but it is somehow degenerated
  • working with osmium 1.13.1 on debian 9

EDIT2

  • After using pbflint it seams that relation has missing ways, not sure how to report this or investigate further
$ ./pbflint.linux.bin tmp9.pbf

error: relation 1116270 missing member way 46113982

error: relation 1116270 missing member way 42394837

error: relation 1116270 missing member way 42394795

error: relation 1116270 missing member way 46113981

error: relation 1116270 missing member way 42394788

error: relation 1116270 missing member way 42394794

error: relation 1116270 missing member way 42394790

Edit3

All 7 missing ways are on Eastern Hemishpere, looks like osmium bug https://www.openstreetmap.org/way/42394790#map=4/54.54/177.89

3
  • 1
    I don't know why, but some states / Canadian provinces are sometimes missing from the north-America / Canada PBF exports. You can try with a previous export ... or with the planet export. (Since it seems only the border is missing, I personally keep a copy of the provinces borders and replace the sometimes-but-not-always missing ones)
    – JGH
    Jul 5 at 14:33
  • Good idea, tried with planet-210628.osm.pbf but got the same. But I have found some new details which I will place in Edit1. Jul 6 at 7:38
  • @JGH I have mistakenly thought the problem from extract is also in planet because osmium getid requires -r to collect all child members of relations. I did not use it at first so resulting exports were equal. Jul 23 at 8:20
0

Ways are missing in north-america-latest.osm.pbf from Geofabrik but are there in planet-210628.osm.pbf. But, when I was debugging this the first time few weeks ago I tried to extract relation with osmium getid without -r argument and incomplete output made me assume that osmium works bad on both america and planet data.

So when I run this osmium getid planet-210628.osm.pbf r1116270 -r -o Alaska.pbf result is valid.

[EDIT 1] More info on osmium bug which I suspect caused missing ways in north-america-latest.osm.pbf and in my data while I was processing it later.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.