osmextract icon indicating copy to clipboard operation
osmextract copied to clipboard

Issue with the 'version' feature when OSM split up a country into regions at certain point in time

Open eugenividal opened this issue 10 months ago • 3 comments

A follow-up regarding the version feature:

Sometimes, OSM divides a country into smaller regions at certain point in time. To retrieve historical data in such cases, we need to examine two web pages, the national level and, once the country is split up, the regional level.

For example, if we want historical data for Barcelona from now until 2021, we get the daya from this URL. However, for earlier data (e.g., from 2012 to 2021), we need to go to the national-level download page.

With the current feature, when this is the case, to downloading data from previous years to the area split, you have to explicitly specify the desired level (national, i.e. 2). Otherwise, the process doesn't work.

It would be helpful to either explain this issue in the vignette or enhance the feature/function to automatically determine the appropriate level based on the availability of OSM data.

eugenividal avatar Jan 24 '25 10:01 eugenividal

Good spot Eugeni, probably a good one to document.

Robinlovelace avatar Jan 24 '25 11:01 Robinlovelace

I think the note could go here, or earlier in the script around line 8:

https://github.com/ropensci/osmextract/blob/13380e63539db0509c2c7ae89e1a81c99ba0de05/R/get.R#L47-L52

PR welcome!

Robinlovelace avatar Jan 24 '25 11:01 Robinlovelace

Or, if you want, feel free to open a new Issue and I will check it as soon as possible :)

EDIT: Sorry, I didn't notice that this was already a new issue 🤦‍♂

agila5 avatar Jan 24 '25 11:01 agila5