Closed KHwong12 closed 3 years ago
Thanks for this. -seems Google has got a bit stricter on the use of this API. Changing to 25 fixes the issue as you say. Feel free to prepare a pull request if you like. Alternatively I can get to this a bit later on.
Sure. I will prepare a PR.
I will add an additional argument max_dimension
to the function, which should be the square of init_grid_size
in the make_isochrone
function.
Sure. I will prepare a PR.
I will add an additional argument
max_dimension
to the function, which should be the square ofinit_grid_size
in themake_isochrone
function.
Thanks for the contribution, all looks good and have merged PR
First of all, thanks for writing this package. I have been looking for scripts to generate isochrone maps with google map API for a long time.
When I tried to generate the isochrone polygon, the
make_isochrone
function fails. I checked the code and believe the error may be caused by the request URL to the google map Distance Matrix Service. Currently, it only allows 25 origins/destinations in a single request. (https://developers.google.com/maps/documentation/javascript/distancematrix)But the request URL in
distance_from_origins
anddistance_to_destinations
is now requesting 100 points at one time. The functions return a list of NULL and thusmake_isochrone
fails to work. I am not sure why the lineerr <- httr::http_error(doc)
does not throw an error though.https://github.com/Chrisjb/RDistanceMatrix/blob/8aaf799a320afe04bc15b554ae2fe85a38f14c79/R/utils-isochrone.R#L51-L58
https://github.com/Chrisjb/RDistanceMatrix/blob/8aaf799a320afe04bc15b554ae2fe85a38f14c79/R/utils-isochrone.R#L108-L115
I changed the value 100 to 25 in my local machine and the functions work.