Open agila5 opened 2 weeks ago
cc also @juanfonsecaLS1! Let me know if this implementation is ok. In that case, I will also add an example to the package's vignette (since I'm not sure how to formally create a test or an example without stressing too much Geofabrik servers).
Another question @agila5: do we and should we start adding dates to the filenames?
Another question @agila5: do we and should we start adding dates to the filenames?
IMO no since OSM data are updated almost continuously and saving each tiny difference detected in OSM files kinda defeats the purpose of storing the data. Anyway, feel free to create a new issue on that topic and we can discuss there!
IMO no since OSM data are updated almost continuously and saving each tiny difference detected in OSM files kinda defeats the purpose of storing the data. Anyway, feel free to create a new issue on that topic and we can discuss there!
Fine by me, it' worth documenting the behaviour and stating that people need to save their own time-stamped extracts if they want versions, not something that the package does. Just to check, the behaviour is that force_download = FALSE
, meaning that re-running oe_get()
will not lead to a re-downloading of the data, right?
Follow-on question: should force_download
be switched to TRUE
when version != "latest"
?
I should probably read the diff more carefully to find out but thought it worth putting my thinking in words..
This is great! I think it is a good way to do it. Probably, the documentation of oe_get_network
could also be updated to mention the version
parameter.
On the test, how about using a small file, e.g. Monaco which is less than 600 KB?
Thanks for your work!
On the test, how about using a small file, e.g. Monaco which is less than 600 KB?
:+1: :pray:
Fine by me, it' worth documenting the behaviour and stating that people need to save their own time-stamped extracts if they want versions, not something that the package does.
Will do as soon as I update the vignette (#236). Please notice that, after the current PR, we kinda have a versioning system as long as a user requires the adoption of an old (and fixed) OSM extract instead of the latest one (which is the default). For example, oe_get("Italy")
points to the latest pbf file which is different and updated more or less every day. On the other hand, oe_get("Italy", version = "200101")
points to a fixed OSM extract (which included the data up to 2020-01-01) that (AFAIK) will remain the same state forever (or as long as Geofabrik servers keep it).
Just to check, the behaviour is that force_download = FALSE, meaning that re-running oe_get() will not lead to a re-downloading of the data, right?
Yes. When force_download = FALSE
(the default) then the data are not re-downloaded when the same .osm.pbf file already exists in the download directory.
Follow-on question: should force_download be switched to TRUE when version != "latest"?
IMO no since each fixed (and not default) OSM extract points to a different .pbf file.
In fact, I see no pratical reason for re-downloading the same old pbf file since the data will be (or should be) always the same.
This is great! I think it is a good way to do it. Probably, the documentation of oe_get_network could also be updated to mention the version parameter.
Done
On the test, how about using a small file, e.g. Monaco which is less than 600 KB?
I'm not sure since the problems are not really related to the size of the extract, but more rate limit of Geofabrik website....
Please let me know if this is clear.
@Robinlovelace @juanfonsecaLS1 do you have any further comment after the last commits? Otherwise I will merge.
It can be used to download old OSM extracts from Geofabrik provider. Fixes #295.
For example:
Created on 2024-11-06 with reprex v2.0.2