Re: [Geocoding] Highway links; e.g. motorway_link, primary_link, secondary_link etc. missing from Nominatim DB ?

2018-02-13 Thread Sarah Hoffmann
Hi Nick,

On Tue, Feb 13, 2018 at 11:07:56AM +0100, Nick Meessen - de Wit wrote:
> Hello,
> 
> We’re trying to use Nominatim to resolve road segments, which is working for 
> most roads. 
> 
> Only we’re not able to resolve any link roads, ramps for motorways etc. 
> Nominatim seems to be skipping these, and snapping to the first road in the 
> vicinity.
> Which seems to be correct, looking at the code, and this issue from years 
> back: https://trac.openstreetmap.org/ticket/5251 
> 
> 
> We’ve looked at the Nominatim DB, and tried querying them directly using the 
> place table and placex table, which did not yield any results. ‘place’ table.
> 
> When using https://overpass-turbo.eu  for 
> example, and querying for 'highway=motorway_link’ we’re getting the results 
> we’d like to see, for e.g. we’re receiving the way_ids. 
> 
> - https://www.openstreetmap.org/way/6960060 
> 
> - https://www.openstreetmap.org/way/6960114 
> 
> - https://www.openstreetmap.org/way/6960093 
> 
> 
> And then when querying these directly in the Nominatim DB, from the place / 
> placex tables by ‘osm_id’ they seem to absent.

That is correct. All unnamed link roads are dropped during
import already. The motivation behind that is that Nominatim
is mainly for forward searching where unnamed links would
just clutter the database with data that is never used.

> Is there another way to query these from the Nominatim DB? Or can we get them 
> imported as well, as they seem to have been skipped while populating the 
> database?

It is possible when you run your own instance but you have to
hack a bit at the code. All this is currently hard-coded in the
osm2pgsql source code.

If you have a look at output-gazetteer.cpp around here:
https://github.com/openstreetmap/osm2pgsql/blob/master/output-gazetteer.cpp#L48

The struct UnnamedPredicate contains the function that decides
what main tags an OSM object must have, so that it is dropped when
there is no name tag. The very last line has objects with
highway=*_link. Remove that line, recompile everything and the
links should be there after the next import.

Also check the other lines in that functions, you might be interested
in other dropped highway types as well.

Kind regards

Sarah

___
Geocoding mailing list
Geocoding@openstreetmap.org
https://lists.openstreetmap.org/listinfo/geocoding


[Geocoding] Highway links; e.g. motorway_link, primary_link, secondary_link etc. missing from Nominatim DB ?

2018-02-13 Thread Nick Meessen - de Wit
Hello,

We’re trying to use Nominatim to resolve road segments, which is working for 
most roads. 

Only we’re not able to resolve any link roads, ramps for motorways etc. 
Nominatim seems to be skipping these, and snapping to the first road in the 
vicinity.
Which seems to be correct, looking at the code, and this issue from years back: 
https://trac.openstreetmap.org/ticket/5251 


We’ve looked at the Nominatim DB, and tried querying them directly using the 
place table and placex table, which did not yield any results. ‘place’ table.

When using https://overpass-turbo.eu  for example, 
and querying for 'highway=motorway_link’ we’re getting the results we’d like to 
see, for e.g. we’re receiving the way_ids. 

- https://www.openstreetmap.org/way/6960060 

- https://www.openstreetmap.org/way/6960114 

- https://www.openstreetmap.org/way/6960093 


And then when querying these directly in the Nominatim DB, from the place / 
placex tables by ‘osm_id’ they seem to absent.

Is there another way to query these from the Nominatim DB? Or can we get them 
imported as well, as they seem to have been skipped while populating the 
database?

Kind regards,
Nick Meessen - de Wit



___
Geocoding mailing list
Geocoding@openstreetmap.org
https://lists.openstreetmap.org/listinfo/geocoding