Closed robcrystalornelas closed 1 year ago
This notebook generates static and interactive maps (html) for this brazilian cities, this htmls are served with github pages inside of the same repository: Brasilia Camipiñas Sao Paulo Rio de Janeiro
Awesome, thanks so much for these resources @Claudio9701. I'm still running into an error when I try to run up.routing.start_osrm_server('brasil', 'south-america', 'foot')
Do I need to start up a docker container? I'm wondering if it would be most helpful if we schedule a pairing session to discuss.
I also haven't downloaded the latest version of urbanpy and was wondering if that may solve this. The error I get is:
No such file or directory: 'docker'
Great @robcrystalornelas!
From our conversation a few weeks ago, I realized it is too hard for an example notebook to depend on instantiating docker containers. Thus, I made this example notebook which calculates the distance matrix using python only. This way is easier but slower.
Using the a local OSRM Server built with docker its the fastest way to the calculation. It is possible to use it with the pypi version of urbanpy but in the case of brazil the OSM data is divided by subregions. Sadly, the first urbanpy version can't automatically download the subregion data in these cases (The new one can! at least in linux and macos-based systems 😅). So there are some manual tweaks needed, the steps to make it work are the following:
$ pip install urbanpy
# Server config
OSRM_COUNTRY = "sul" # subregion name
OSRM_CONTINENT = "south-america_brazil" # combination of continent_country
OSRM_PROFILE = "foot" # other options are 'car' or 'bicycle'
up.routing.start_osrm_server(OSRM_COUNTRY, OSRM_CONTINENT, OSRM_PROFILE)
time.sleep(20) # Subsequent start times should be between 5 - 20 seconds
distance, duration = up.routing.osrm_route(origin=point1, destination=point2)
up.routing.stop_osrm_server(OSRM_COUNTRY, OSRM_CONTINENT, OSRM_PROFILE)
This is the output of a OSRM server working properly:
![image](https://user-images.githubusercontent.com/24416566/217225164-16ae3ae3-57dc-48e7-a436-0844c47981c3.png)
I've tested the [notebook](https://github.com/Claudio9701/urbanpy-brazil-demo/blob/master/Pop_Access_UrbanPy_Demo_BR.ipynb) mentioned in the [previous comment](https://github.com/github/IADB-education/issues/8#issuecomment-1404032357) and the results are the following:
- No. of resolution 8 hexagons generated: 977
- No. of education facilities downloaded: 44
- Maps:
| ![image](https://user-images.githubusercontent.com/24416566/217228186-385ff601-3334-48f5-bc19-d2f60acce35c.png) | ![image](https://user-images.githubusercontent.com/24416566/217228029-4bcf3a8e-455a-4ac4-9211-ccdc8a834803.png) | ![image](https://user-images.githubusercontent.com/24416566/217228094-a8fff84e-f2d1-4848-b337-0465154bb3d1.png) |
|---|---|---|
| Adm. limits | Population | Accessibility |
- [See the Interactive map](https://claudio9701.github.io/urbanpy-brazil-demo/florianopolis).
Let me know if this helps. Also, I was thinking that 44 is a small number maybe a double check with local sources is needed. Good luck!
OK Great, thanks for this help @Claudio9701. I'm going to give it a try over the next couple of days and will let you know how it goes ✨
Also, I think we can schedule a pairing session for thursday or friday evening (from 18 h onwards in paris time) if it works for you and your team :D
Awesome, just added a meeting to our calendars 👍🏻
We have completed part of project visualizing travel time to schools
Data visualizations for travel time to schools can take the form of heatmaps or other visualizations.
One thing to note is that rather than saving heatmaps or any maps we produce as JPEG or PNG files, we should figure out a way to save them as zoomable maps where the links can be shared.