covid19datahub / COVID19

A worldwide epidemiological database for COVID-19 at fine-grained spatial resolution
https://covid19datahub.io
GNU General Public License v3.0
251 stars 93 forks source link

CZE google mobility indicators are NA in Prague (key_nuts = "CZ010") #208

Closed umbe1987 closed 2 years ago

umbe1987 commented 2 years ago

It seems google mobility indicators for Prague are all NA even if they are present in google mobility report CSV.

The code I am using is:

library(data.table)
test <- covid19(gmr = T, country = "Czech Republic", level = 3, start = "2020-01-01", end = Sys.Date())
setDT(test)
google_indicators <- c(
  "retail_and_recreation_percent_change_from_baseline",
  "grocery_and_pharmacy_percent_change_from_baseline",
  "parks_percent_change_from_baseline",
  "transit_stations_percent_change_from_baseline",
  "workplaces_percent_change_from_baseline",
  "residential_percent_change_from_baseline"
)
test[key_nuts == "CZ010", ..google_indicators, ]

The result is all NA even if in the downloaded file (2020_CZ_Region_Mobility_Report.csv) the values are present.

Is it a problem related to how the join is made?

eguidotti commented 2 years ago

Hi @umbe1987, thanks for your message!

It seems google mobility indicators for Prague are all NA even if they are present in google mobility report CSV.

It seems to me that the google indicators for Prague are for level 2 (place_id = ChIJi3lwCZyTC0cRIKgUZg-vAAE). If you try the following, you should get the Google reports for Prague:

test <- covid19(gmr = T, country = "Czech Republic", level = 2, start = "2020-01-01", end = Sys.Date())

At level 3 (districts) it seems that Prague is subdivided into East and West district by Google. However, the cases are not subdivided into East and West for level 3. So I left this match blank. But maybe I should use the same place_id = ChIJi3lwCZyTC0cRIKgUZg-vAAE also for Prague at level 3 as the cases are actually the same for Prague at the two levels... what do you think?

umbe1987 commented 2 years ago

Hello @eguidotti and thanks for you feedback.

IMO it would make sense for CZE, as Prague seems the only area missing from the join and it is "an important area". I am not totally aware on the way cases and google reports are merged together, but if place_id = ChIJi3lwCZyTC0cRIKgUZg-vAAE can be used when asking for level = 3 I think this would be a useful change.

eguidotti commented 2 years ago

Sorry, I fogot to update this thread but the issue was fixed already last week. Thanks!

umbe1987 commented 2 years ago

Sorry, I fogot to update this thread but the issue was fixed already last week. Thanks!

This is great news! Thank you @eguidotti! :+1: