azavea / pfb-network-connectivity

PFB Bicycle Network Connectivity
Other
40 stars 10 forks source link

External OSM imports throw 'no corresponding node entry' warnings on import #216

Closed CloudNiner closed 7 years ago

CloudNiner commented 7 years ago

Example:

Reference nd=4719271035 has no corresponding Node Entry (Maybe Node entry after Reference?)

osmconvert has two options to assist with this:

--complete-ways
        If applying a border box or a border polygon, all nodes
        the borders are excluded; even then if they belong to a way
        which is not entirely excluded because it has some nodes
        inside the borders.
        This option will ensure that every way stays complete, even
        it it intersects the borders. This will result in slower
        processing, and the program will loose its ability to read
        from standard input. It is recommended to use .o5m format as
        input format to compensate most of the speed disadvantage.

--drop-broken-refs
        Use this option if you need to delete references to nodes
        which have been excluded because lying outside the borders
        (mandatory for some applications, e.g. Map Composer, JOSM).

If incomplete ways outside the bounding border become an issue for incomplete analyses, we should consider using one of the above options when we call osmconvert.

spencerrecneps commented 7 years ago

Is this error coming from osm2pgrouting? I recall running into a similar issue early on in my testing. I started some discussion with the developers: https://github.com/pgRouting/osm2pgrouting/issues/127

I'm fine with dropping any broken ways at the edges.

spencerrecneps commented 7 years ago

I should call attention to the fact that osm2pgrouting was crashing with a segfault in such cases, so we should definitely handle this before importing to the DB. I believe they've fixed this in newer versions but it would not be advisable for us to change versions this late in the game.

CloudNiner commented 7 years ago

Yes its coming from osm2pgrouting, but the root issue is that when we use osmconvert to clip our input OSM file to the bbox we care about for the analysis, we don't use one of the flags mentioned above, leading to the broken refs.

As you suggest, --drop-broken-refs is likely preferable to --complete-ways in our case.