-
Notifications
You must be signed in to change notification settings - Fork 8
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
overpass API to download building data first draw #51
Conversation
Hi, I have tested the retrieve_osm_data() function and it downloads buildings data without problem in .json format. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fantastic @Emre-Yorat89 :D
Great contributions and attached are some comments
scripts/download_osm_data.py
Outdated
@@ -96,7 +129,12 @@ def convert_iso_to_geofk( | |||
out_path = Path.joinpath(store_path_resources, "out") | |||
out_formats = ["csv", "geojson"] | |||
new_files = os.listdir(out_path) | |||
|
|||
microgrid_coordinates = snakemake.config["microgrids_list"]["microgrid_1"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This currently works for a microgrid only.
We should loop over all microgrids in microgrids_list to download the data for each microgrid independently and then put them together.
We can do this in two ways:
- repeat the process, create a file for each microgrid and then merge all the files
- make only a single overpass query and update the query "overpass_query" to account for the different microgrids. This basically means to add into the query the logic of searching in the box of the first microgrid or the box of the second microgrid and so on and so forth. I'm unsure this is possible but we can investigate
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
secondly, ideally, we should load the microgrid_list using params, as:
microgrids_list = snakemake.params.microgrids_list
beyond this, in the snakefile, under download_osm_data, we should add:
params:
...
microgrids_list = config["microgrids_list"]
scripts/download_osm_data.py
Outdated
microgrid_coordinates = snakemake.config["microgrids_list"]["microgrid_1"] | ||
features = "building" | ||
overpass_url = "https://overpass-api.de/api/interpreter" | ||
retrieve_osm_data( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently, the retrieve_osm_data function is executed after the standard approach.
It would be great to have an option and execute either the standard apporach or the novel one using overpass-api
Closes # (if applicable).
Changes proposed in this Pull Request
Checklist
config.default.yaml
andconfig.tutorial.yaml
.test/
(note tests are changing the config.tutorial.yaml)doc/configtables/*.csv
and line references are adjusted indoc/configuration.rst
anddoc/tutorial.rst
.doc/release_notes.rst
is amended in the format of previous release notes, including reference to the requested PR.