dime-worldbank / googletraffic

R package to query Google Maps traffic data and transform into data
Other
55 stars 9 forks source link

gt_make_raster error #15

Open eadelgadillom opened 7 months ago

eadelgadillom commented 7 months ago

I have this error when tried to run

r <- gt_make_raster(location   = c(10.96854, -74.78132),height     = 2000, width      = 2000, zoom       = 16, google_key = google_key)

>Pausing for 16 seconds to allow traffic data to renderfile:///C:\Users\eduar\AppData\Local\Temp\RtmpKsOI2D\file2fd044ba780a.htmlC:\Users\eduar\AppData\Local\Temp\RtmpKsOI2D\file2fd044ba780a.html screenshot completed
Error in h(simpleError(msg, call)) : 
  error in evaluating the argument 'x' in selecting a method for function 'extent': cannot transform sfc object with missing crs
In addition: Warning message:
In dir.create(filename_dir) :
  'C:\Users\eduar\AppData\Local\Temp\RtmpKsOI2D' already exists
ramarty commented 6 months ago

@eadelgadillom Apologies for the delay! After running this, and you print r, do you see anything?

eadelgadillom commented 6 months ago

No nothing.

r Error: object 'r' not found

It seems like the file hasn't been generated, but upon attempting to open the screenshot for that specific area in the folder, it is present. tiff generation fails in gt_make_raster

ramarty commented 6 months ago

@eadelgadillom Could you print sessionInfo() and send the first few rows?

Could be worth installing the latest version of the package (there's been a few minor updates) and see if it works then?

eadelgadillom commented 6 months ago

sessionInfo() R version 4.3.2 (2023-10-31 ucrt) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 11 x64 (build 22635)

Matrix products: default

locale: [1] LC_COLLATE=English_United States.utf8 LC_CTYPE=English_United States.utf8 LC_MONETARY=English_United States.utf8 [4] LC_NUMERIC=C LC_TIME=English_United States.utf8

time zone: America/Bogota tzcode source: internal

attached base packages: [1] stats graphics grDevices utils datasets methods base

other attached packages: [1] leaflet.providers_2.0.0 leaflet_2.2.1 raster_3.6-26 sp_2.1-2
[5] dplyr_1.1.4 ggplot2_3.4.4 googletraffic_0.1.4

eadelgadillom commented 6 months ago

I tried to run latest version but its not working, same error:

Error in h(simpleError(msg, call)) : error in evaluating the argument 'x' in selecting a method for function 'extent': cannot transform sfc object with missing crs