Skip to content

[REQUEST] OSM geocoding language #957

@ajoah

Description

@ajoah

💡 Feature Summary

Response of OSM geocoding in the current user language

🤔 Problem Statement

When i want to add a new adventure, the quick start feature is really cool but the anwser is in osm local language (japanese for Japan, german for Germany...).

🛠️ Proposed Solution

It would be better to use the AdventureLog user language.

Code

Indeed, there is no language header in the osm request :

def search_osm(query):
url = f"https://nominatim.openstreetmap.org/search?q={query}&format=jsonv2"
headers = {'User-Agent': 'AdventureLog Server'}
response = requests.get(url, headers=headers)
data = response.json()
return [{
"lat": item.get("lat"),
"lon": item.get("lon"),
"name": item.get("name"),
"display_name": item.get("display_name"),
"type": item.get("type"),
"category": item.get("category"),
"importance": item.get("importance"),
"addresstype": item.get("addresstype"),
"powered_by": "nominatim",
} for item in data]

Documentation : https://nominatim.org/release-docs/develop/api/Search/#language-of-results

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestreadyReady for contributors to work on. PRs are allowed for these issues.

    Projects

    Status

    Ready

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions