dime-worldbank / googletraffic

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

Problem when create png file to save raster #9

Closed gustavguimaraes closed 6 months ago

gustavguimaraes commented 1 year ago

I have identified a small error while using the package. Not sure why the png file wasn't created before running the "webshot" function. I added a dir.create and file.create command before the webshot and it worked.

ramarty commented 1 year ago

@gustavo234guimaraes ah thanks for flagging this!

And just to make sure, is the issue with the gt_make_raster function or the gt_make_png function? Are you able to show a screenshot of the error you were getting?

Basically the process is (1) create HTML that shows interactive map with traffic --> (2) Webshot creates png from HTML / interactive map --> (3) png converted to raster.

If you're able to point to where you added dir.create and file.create I can add that to the package to resolve the issue -- or feel feel to make a pull request too!

gustavguimaraes commented 1 year ago

The error is in gt_html_to_raster. I identified after the first image error and corrected it as shown in the third image. I don't have very advanced knowledge in R, so I don't know if the error was actually the lack of these commands, because I've used the package other times and it worked perfectly.

Screenshot_1 Screenshot_2 Screenshot_3