komoot / photon

an open source geocoder for openstreetmap data
Apache License 2.0
1.91k stars 281 forks source link

state, county tag not available for all documents. #802

Closed mb12 closed 4 months ago

mb12 commented 4 months ago

Can someone please suggest a workaround or a solution for the following?

For a lot of well known places, the state and county tags are not dumped in the photon database. I have verified it manually by writing an ES query for that osm_id in Kibana. I have also verified that there isn't any state, county information for that osm_id when I query it using command line in nominatim. Here is one specific example. Its for osm_id=4039486. Its for "Lake Superior" in US. Is it possible to dump the county and state tags for the corresponding document in the photon database?

I understand that this is a multipolygon geometry spanning multiple counties, states. For those cases, it is perfectly fine to add any county, state. Preferably, the same logic that is used for roads/streets spanning multiple administrative regions. For the specific example, I have included nominatim dumps it as "addresstype": "water",.

From a user's point of view, it very easy to disambiguate between names if county, state information can be appended for displaying. E.g. Bass Lake, Wisconsin vs Bass Lake, Michigan vs Bass Lake, California.

I have also included the specific result from nominatim query search below that I have referenced above.

nominatim search --query 'Lake Superior' | less
{
        "place_id": 46758114,
        "licence": "Data © OpenStreetMap contributors, ODbL 1.0. http://osm.org/copyright",
        "osm_type": "relation",
        "osm_id": 4039486,
        "lat": "47.714434600000004",
        "lon": "-88.21163556659235",
        "category": "natural",
        "type": "water",
        "place_rank": 22,
        "importance": 0.5320626804991205,
        "addresstype": "water",
        "name": "Lake Superior",
        "display_name": "Lake Superior, United States",
        "boundingbox": [
            "46.4102412",
            "49.0186830",
            "-92.2727700",
            "-84.3543804"
        ]
    }