komoot / photon

an open source geocoder for openstreetmap data
Apache License 2.0
1.94k stars 286 forks source link

Reverse lookup of coordinates missing state property #838

Closed dhimmel closed 2 weeks ago

dhimmel commented 3 weeks ago

When looking up this coordinate in the United States in the state of New Hampshire, no state and county information is returned:

https://photon.komoot.io/reverse?lat=44.1791949&lon=-71.1657218&lang=en

{
  "features": [
    {
      "geometry": {
        "coordinates": [-71.1689614, 44.178123],
        "type": "Point"
      },
      "type": "Feature",
      "properties": {
        "osm_type": "N",
        "osm_id": 357730905,
        "country": "United States",
        "osm_key": "natural",
        "countrycode": "US",
        "osm_value": "peak",
        "postcode": "03846",
        "name": "The Knoll",
        "type": "locality"
      }
    }
  ],
  "type": "FeatureCollection"
}

A nearby point also in New Hampshire does return this information https://photon.komoot.io/reverse?lat=44.31949&lon=-71.1657218&lang=en

{
  "features": [
    {
      "geometry": {
        "coordinates": [-71.1583899, 44.3181199],
        "type": "Point"
      },
      "type": "Feature",
      "properties": {
        "osm_type": "W",
        "osm_id": 267558894,
        "extent": [-71.1678626, 44.3267357, -71.1490249, 44.3100633],
        "country": "United States",
        "osm_key": "highway",
        "countrycode": "US",
        "district": "Bean's Purchase",
        "osm_value": "path",
        "name": "Carter-Moriah Trail",
        "county": "Coös County",
        "state": "New Hampshire",
        "type": "street"
      }
    }
  ],
  "type": "FeatureCollection"
}

Nomatim is able to get the state: https://nominatim.openstreetmap.org/reverse.php?lat=44.1791949&lon=-71.1657218&zoom=15&format=jsonv2

  "display_name": "Jackson, Carroll County, New Hampshire, 03846, United States",
  "address": {
    "village": "Jackson",
    "county": "Carroll County",
    "state": "New Hampshire",
    "ISO3166-2-lvl4": "US-NH",
    "postcode": "03846",
    "country": "United States",
    "country_code": "us"
  },

Any ideas on why state and county are missing for certain reverse lookups? Is the intent of photon to provide this information?

Originally reported at https://github.com/russellporter/openskimap.org/issues/139.

lonvia commented 2 weeks ago

I believe that was already fixed with #808. It's high time for another release.

dhimmel commented 2 weeks ago

Great news!

It's high time for another release

Any release would be greatly appreciated, since for my application the changes likely need to be live at https://photon.komoot.io/reverse to realize the benefits.

dhimmel commented 4 days ago

Thanks for the 0.6.0 release. The https://photon.komoot.io/reverse?lat=44.1791949&lon=-71.1657218&lang=en URL does not return state and county fields but I'm not actually sure where to see what version of photon is running at https://photon.komoot.io.

lonvia commented 4 days ago

The bug fix needs an updated data dump. The weekly dump (and first from version 0.6.0) on https://download1.graphhopper.com/public/ came out yesterday and the next update on photon.komoot.io is due in 2 hours.

mtmail commented 4 days ago

@dhimmel https://photon.komoot.io/status returns when data was last imported (but not the Photon version number)

dhimmel commented 2 days ago

Thanks all! I just retried the API call and received:

{
  "features": [
    {
      "geometry": {
        "coordinates": [-71.1689614, 44.178123],
        "type": "Point"
      },
      "type": "Feature",
      "properties": {
        "osm_type": "N",
        "osm_id": 357730905,
        "country": "United States",
        "osm_key": "natural",
        "city": "Jackson",
        "countrycode": "US",
        "osm_value": "peak",
        "postcode": "03846",
        "name": "The Knoll",
        "county": "Carroll County",
        "state": "New Hampshire",
        "type": "other"
      }
    }
  ],
  "type": "FeatureCollection"
}

So the results now contain city, county, and state. Problem solved!