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

feat: fetch location data from OpenStreetMap Nominatim #38

Merged
merged 3 commits into from
Nov 22, 2023

Conversation

raphodn
Copy link
Member

@raphodn raphodn commented Nov 16, 2023

What

following #36, we want to enrich the newly created Location with data fetched from OSM Nominatim.

We use OSMPythonTools

@raphodn raphodn self-assigned this Nov 16, 2023
@raphodn raphodn requested a review from raphael0202 November 16, 2023 17:49
@raphodn raphodn changed the base branch from raphodn/price-location-relationship to raphodn/location-detail-endpoint November 16, 2023 17:50
@raphodn raphodn linked an issue Nov 16, 2023 that may be closed by this pull request
4 tasks
@raphodn raphodn force-pushed the raphodn/location-detail-endpoint branch from db17982 to 03a4c8c Compare November 16, 2023 18:31
@raphodn raphodn force-pushed the raphodn/location-openstreetmap-details branch 2 times, most recently from aa55803 to b2b7354 Compare November 16, 2023 18:38
app/utils.py Outdated Show resolved Hide resolved
return client.query(search_query, lookup=True).toJSON()


def fetch_location_openstreetmap_details(location: LocationBase):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

adding the type of the return item would be nice!

@raphodn raphodn force-pushed the raphodn/location-detail-endpoint branch from 03a4c8c to 9a269f2 Compare November 21, 2023 00:07
Base automatically changed from raphodn/location-detail-endpoint to main November 21, 2023 00:14
@raphodn raphodn force-pushed the raphodn/location-openstreetmap-details branch from b2b7354 to 37d4db1 Compare November 21, 2023 00:25
@raphodn raphodn force-pushed the raphodn/location-openstreetmap-details branch from 37d4db1 to b7781f5 Compare November 22, 2023 11:15
@raphodn raphodn merged commit 2044e6b into main Nov 22, 2023
3 checks passed
@raphodn raphodn deleted the raphodn/location-openstreetmap-details branch November 22, 2023 11:37
@teolemon teolemon added the ✨ enhancement New feature or request label Nov 23, 2023
raphodn added a commit that referenced this pull request Dec 23, 2023
@raphodn
Copy link
Member Author

raphodn commented Dec 23, 2023

In this additional commit - c37e7a6 - I tried to improve the selection of the city.

The city field is not often filled, there is a whole hierarchy of places : https://wiki.openstreetmap.org/wiki/Key:place

id nom isolated_dwelling city_district hamlet village town city municipality
w238176793 Station essence Intermarché Super Le Pontou Murat Murat Saint-Flour
n3927413952 Intermarché Camiols Saint-Flour
n8078310347 Intermarché La Malmouche Marcenat Saint-Flour
w162786410 Intermarché Super Vialle Chalet Massiac Saint-Flour
n9343987897 Intermarché Pitot Saint-Flour Saint-Flour
w32520537 Monoprix Grenoble Grenoble

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create a Location model
3 participants