Skip to content
This repository has been archived by the owner on Jul 24, 2021. It is now read-only.

Reverse geocoding ignores osm_type and won't return the closest Way #5377

Closed
openstreetmap-trac opened this issue Jul 23, 2021 · 4 comments
Closed

Comments

@openstreetmap-trac
Copy link

Reporter: capellsk
[Submitted to the original trac issue database at 10.56am, Wednesday, 13th January 2016]

This query, which requests a Way, returns a Node:

http://nominatim.openstreetmap.org/reverse?format=json&lat=31.515380035347903&lon=-9.77214052951257&addressdetails=1&osm_type=W

The Way that I was expecting it to choose, which is much closer to the given location than the above Node, is this one:

http://api.openstreetmap.org/api/0.6/way/283877036

@openstreetmap-trac
Copy link
Author

Author: lonvia
[Added to the original trac issue at 12.03pm, Wednesday, 13th January 2016]

You cannot restrict a reverse query by osm_type.

If you are trying to restrict reverse resilts to street level then try: http://nominatim.openstreetmap.org/reverse?format=json&lat=31.515380035347903&lon=-9.77214052951257&addressdetails=1&zoom=17

@openstreetmap-trac
Copy link
Author

Author: capellsk
[Added to the original trac issue at 2.44am, Thursday, 14th January 2016]

Okay, as soon as wiki account creation gets fixed (it's broken) I will remove the line where it says you can use osm_type with reverse.

Your comment, lonvia, about the zoom level indicates that perhaps the zoom levels have semantic meaning in addition to scale (ie, zoom of 18 will produce a "building" and 17 a "street"). The OSM wiki page mostly talks about scale, with a little semantics mixed in:

http://wiki.openstreetmap.org/wiki/Zoom_levels

Here is what I get using that same query with different zooms:
18+ - restaurant (node)
17 - footway (way)
16 - same
15 - suburb (node)
14 - same
13 - same
12 - same
11 - city (relation)
10 - same
9 - county (relation)
8 - same
7 - state_district (relation)
6 - same
5 - state (relation)
4 - country (relation)
3 - same
2 - same
1 - same
0 - same

Oddly, OSM has 0-19 and Nominatim has 0-18 (according to the wiki).

So does Nominatim (or OSM) use the zoom levels in a semantically consistent way? For example, will zoom 10 or 11 always give the city, or could a city show up at any zoom level depending on its size?

@openstreetmap-trac
Copy link
Author

Author: capellsk
[Added to the original trac issue at 4.03am, Thursday, 14th January 2016]

I updated the wiki page to reflect the fact that osm_type is not supported by reverse.

@openstreetmap-trac
Copy link
Author

Author: TomH
[Added to the original trac issue at 7.11am, Thursday, 14th January 2016]

I've reverted that edit, as you misunderstood.

You either use lat+lon or osm_type+osm_id to do a reverse geocode. What you can't do is combine them to do the geocode by lat+lon and also filter by type.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant