dime-worldbank / googletraffic

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

Issue with `gt_make_raster` #14

Closed hapham-econ closed 8 months ago

hapham-econ commented 10 months ago

I tried to run the gt_make_raster() function in Quickstarts but it does not work. How can I fix this?


> r <- gt_make_raster(location   = c(40.712778, -74.006111),
                     height     = 2000,
                     width      = 2000,
                     zoom       = 16,
                     google_key = google_key)
Pausing for 16 seconds to allow traffic data to renderfile:///C:\Users\phamv\AppData\Local\Temp\RtmpQhYOam\fileaba4539f77ef.htmlC:\Users\phamv\AppData\Local\Temp\RtmpQhYOam\fileaba4539f77ef.html screenshot completed
Warning message:
In dir.create(filename_dir) :
  'C:\Users\phamv\AppData\Local\Temp\RtmpQhYOam' already exists
ramarty commented 10 months ago

Hi @hapham-econ sorry about the issue!

If you do: print(r), do you see anything?

hapham-econ commented 10 months ago

Hi @ramarty , here is what I see. I am running on a Windows machine, so it can be a Windows specific problem I guess...


> print(r)
class      : RasterLayer 
dimensions : 2010, 2006, 4032060  (nrow, ncol, ncell)
resolution : 2.15e-05, 1.63e-05  (x, y)
extent     : -74.02768, -73.98455, 40.69639, 40.72915  (xmin, xmax, ymin, ymax)
crs        : +proj=longlat +datum=WGS84 +no_defs 
source     : memory
names      : file69e436b95e1c_1 
values     : NA, NA  (min, max)
ramarty commented 10 months ago

@hapham-econ Thanks for this! Some others have had issues on Windows as well - I'll spend some time looking into the issue this week and post an update here.

In the meantime, one alternative to consider could be data from Mapbox: https://github.com/dime-worldbank/googletraffic#alternatives-to-google-maps-traffic-information-

ramarty commented 8 months ago

Hi @hapham-econ Apologies it has taken me forever to address this issue, but the new version on CRAN should be working now for windows, but let me know if you're still having issues!

hapham-econ commented 8 months ago

@ramarty Thank you so much! I just tried it out and it works perfectly (at least the examples work). Have a nice rest of the day!