1

for a urban research, I need to work with google map API in R. the simplified problem is that in a specific time interval, I want to compare the number of crossings(updated: compare the congestion) in differently available routes between two points. So, my question is that is there any API which gives me the data like that?

In different libraries which work with google map API, I found some function for traffic. but they give only a static layer on the map. for example:

library(googleway)

google_map(key = 'map_api_key') %>%
    add_traffic()

which had been answered here

Or, google_snaptoroad() in googleway library that I can't understand what would it do.

mjoudy
  • 149
  • 1
  • 1
  • 10
  • 1
    `snaptoroad` will take a given marker (or pair of lat/lon coordinates) and 'snap' it to the nearest road. Useful for correcting GPS traces, for example. – SymbolixAU Apr 06 '18 at 08:28
  • 2
    I don't think there's a Google API which provides the data you're after – SymbolixAU Apr 06 '18 at 10:51
  • I think the expression of "number of crossings" is totally misleading. Actually, I want to compare the traffic congestions in different routes. – mjoudy Apr 06 '18 at 11:38
  • Ok, but I still don't think you can get that from Google's API. – SymbolixAU Apr 06 '18 at 11:54

1 Answers1

1

there is a package called 'googletraffic' in R, can get google traffic layer which show the congestion level on each street.

link to googletraffic package in R

Hope
  • 11
  • 3
  • 1
    While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - [From Review](/review/late-answers/34172054) – L Tyrone Apr 06 '23 at 02:35