Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export additional information about OSM objects in Photon API #574

Closed
4 tasks
lonvia opened this issue Apr 29, 2021 · 1 comment
Closed
4 tasks

Export additional information about OSM objects in Photon API #574

lonvia opened this issue Apr 29, 2021 · 1 comment

Comments

@lonvia
Copy link
Collaborator

lonvia commented Apr 29, 2021

Nominatim has the capability to save any OSM tag as extra information with a place object and to return this via the API. Photon currently ignores this information completely even though it might be interesting for special purpose installations (e.g. a search engine for restaurants also wants to return the cuisine information if available.)

Returning arbitrary tags is a bit difficult with ElasticSearch but we could add a fixed set of selected tags. These would not be searchable but only be returned as extra information, just like Nominatim does. I'd suggest an additional property extra, which contains the tags that are available. If there is not extra infromation for a place, the property would be omitted completely, e.g

{
  "features": [
    {
      "geometry": {   "coordinates": [  11.5500582,  48.1778972], "type": "Point"  },
      "type": "Feature",
      "properties": {
        "osm_id": 4068438,
        "country": "Germany",
        "city": "Munich",
        "countrycode": "DE",
        "type": "house",
        "osm_type": "N",
        "osm_key": "amenity",
        "osm_value": "restaurant",
        "name": "Alphut",
        "extra": {
           "cuisine" : "vegan"
        }
      }
    },
      "geometry": {   "coordinates": [  11.5500582,  48.1778972], "type": "Point"  },
      "type": "Feature",
      "properties": {
        "osm_id": 291856,
        "country": "Germany",
        "name": "Munich",
        "osm_type": "place",
        "osm_value": "city"
      }
     }
  ]
}

Implementation steps:

  • Provide an additional parameter -extratags for the import that selects the tags to add to the Photon database.
  • Dynamically change the mapping to add fields for the additional tags.
  • Add extra information to the JSON output.
  • Add tests for the new function.

CC @hbruch

@lonvia
Copy link
Collaborator Author

lonvia commented May 11, 2021

Implemented in #576.

@lonvia lonvia closed this as completed May 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant