ipeaGIT / aopdata

Download data from the Access to Opportunities Project (AOP)
https://ipeagit.github.io/aopdata/
13 stars 4 forks source link

read_access sugestions #39

Closed Joaobazzo closed 2 years ago

Joaobazzo commented 2 years ago

I've been downloading the data through the read_access function and I saw three enhancements that could be made.

  1. The first is the need to mention the cities code in the read_access, read_population, read_grid, and read_landuse documentation. I could only find the codes when I downloaded using city = all.

  2. Also, the function could be implemented to accept a vector of cities' names, instead of a single city. By doing this the user doesn't need to use any lapply() command to extract the desired files.

  3. When we use mode = 'public_transport' with city = 'all', we get this error:

    > a <- aopdata::read_access(city = 'all', mode = 'public_transport', 
    peak = TRUE, year = 2019, geometry = TRUE)
    Using mode public_transport
    Downloading accessibility data from year 2019
    |=====================================================| 100%
    Error in aopdata::read_access(city = "all", mode = "public_transport",  : 
    One of the selected cities does not have public transport data for that year.

There could be a condition that uses c("for", "rec", "bho","rio", "spo", "cur", "poa") when the commands (mode = 'public_transport' with city = 'all') are used together.

If you guys agree with these suggestions, I can go forward and open a PR.

rafapereirabr commented 2 years ago

Hi @Joaobazzo . Thanks for the suggestions. A

  1. By city code you mean the code_muni or the abbrev_muni ?

  2. The read_ functions already accept a vector. For example.

library(aopdata)
pop <- read_population(city=c('bel', 'poa'))
acc <- read_access(city=c('Belem', 'Porto Alegre'))
  1. This is a very good suggestion. The trick to implement it is that the list of cities which have public transport data vary from year to year. Please feel free to propose a solution an open a PR.
Joaobazzo commented 2 years ago
  1. Yeap. The list of cities by code_muni and abbrev_muni was not mentioned in the documentation
  2. That's true. I might have been confused with something else.
  3. Ok, I'll see how we can do considering the variation year a year.
rafapereirabr commented 2 years ago

@Joaobazzo , we are ready to close this one, right?

Joaobazzo commented 2 years ago

@rafapereirabr . There is still number 3 to be implemented. However, since we will be updating the whole data set soon, considering other years and car modes, I believe we'll update the function anyways. We can close this.