google-distancematrix-api

JSON: Google Map Distance Matrix Data in R “How to download JSON data into R?”

江枫思渺然 提交于 2019-12-23 01:54:09
问题 I am trying to get the data from the Google Map API Distance Matrix to R. I am trying to get the JSON data into R. How to download JSON data into R, so I will be able parse later? require(rjson) url <- "https://maps.googleapis.com/maps/api/distancematrix/jsonunits=imperial&origins=19+East+34th+Street+NewYork+NY+10016&destinations=40.5177433,-74.2749576&mode=transit&language=fr-FR&key=API_KEY_HERE" raw.data <- readLines(url, warn = "F") rd <- fromJSON(raw.data) I am getting this error: Error

Can an Android-App-Restricted API key be used for Google Distance Matrix?

坚强是说给别人听的谎言 提交于 2019-12-22 17:58:36
问题 I enabled Google Distance Matrix API and restricted the key for Android Apps because I will be sending http queries from my android app to receive json response: Without restriction, it works and I get expected result. But when it's restricted (with my package name and SHA1) I get a failure message in the json object with a "REQUEST_DENIED" status saying: This IP, site or mobile application is not authorized to use this API key. Request received from IP address [ip_addr], with empty referer.

Google Maps API; “CORS header ‘Access-Control-Allow-Origin’ missing” error [duplicate]

只愿长相守 提交于 2019-12-20 06:38:22
问题 This question already has an answer here : Google Maps API: No 'Access-Control-Allow-Origin' header is present on the requested resource (1 answer) Closed 9 months ago . I'm trying to calculate the estimated travel time between two places, with the Google Maps API. I am asking for the data in the following way: const Url = 'https://maps.googleapis.com/maps/api/distancematrix/json?origins=25.7694708,-80.259947&destinations=25.768915,-80.254659&key=' + API_KEY; try { const response = await

How to display google distance matrix API response in grid cell per row?

醉酒当歌 提交于 2019-12-18 07:08:40
问题 I want to display a grid with start and destination travel point with google distance matrix response value of the same. For this, I have GPS coordinates of origin and destination in the array. I am able to build the grid, and I am unable to fill the google distance in each row from the API callbacks. var dataArray = []; //Using Ajax request to get the result from DB. success:function(data.d) dataArray = data.d.slice(); //sample data set are : StartLatitude, StartLongitude, EndLatitude,

Distance Matrix API: Zip Code 70128 returns zero results

只愿长相守 提交于 2019-12-14 02:04:34
问题 Here's a little puzzler. If I search for a distance involving area code 70128, like so: https://maps.googleapis.com/maps/api/distancematrix/json?units=imperial&origins=40.6782%2C-73.9442&destinations=new+orleans+LA+70128 I get a ZERO_RESULTS status. But I do get results if I do the same search with only the New Orleans zip code changed to a nearby one, like so: https://maps.googleapis.com/maps/api/distancematrix/json?units=imperial&origins=40.6782%2C-73.9442&destinations=new+orleans+LA+70129

how to get coordiantes in response instead of origin & destination addresses in Google Map Distance Matrix API

强颜欢笑 提交于 2019-12-13 07:59:38
问题 I'm using google distance matrix api in my android application. I'm calling Google distance matrix api by sending origin and destination to API. API returns response as: { "destination_addresses" : [ "Islamabad, Islamabad Capital Territory, Pakistan" ], "origin_addresses" : [ "Lahore, Punjab, Pakistan" ], "rows" : [ { "elements" : [ { "distance" : { "text" : "234 mi", "value" : 376505 }, "duration" : { "text" : "4 hours 20 mins", "value" : 15608 }, "status" : "OK" } ] } ], "status" : "OK" } I

Duration_in_traffic less than duration in google Distance Matrix API

穿精又带淫゛_ 提交于 2019-12-12 08:44:37
问题 I am using both the "duration_in_traffic" and "duration" feature using the DistanceMatrix API. For a given coordinate pair, I see the following results: { "destination_addresses": [ "Hamburg, Germany" ], "origin_addresses": [ "85748 Garching, Germany" ], "rows": [ { "elements": [ { "distance": { "text": "761 km", "value": 760831 }, "duration": { "text": "7 hours 1 min", "value": 25242 }, "duration_in_traffic": { "text": "6 hours 42 mins", "value": 24145 }, "status": "OK" } ] } ], "status":

Google Distance Matrix API error Invalid Request

主宰稳场 提交于 2019-12-12 06:26:17
问题 I have the following code to create a request in PHP to get a response from Google Distance Matrix API: //get info from google $map_url = 'https://maps.googleapis.com/maps/api/distancematrix/json'; $midnight = strtotime('tomorrow midnight'); $params = array( 'units' => 'metric', 'origins' => str_replace(' ', '+', str_replace('.', '', $arr['address'])), 'destinations' => str_replace(' ', '+', str_replace('.', '', $rink_arr['address'])), 'traffic_model' => 'best_guess', 'departure_time' =>

Unable to build a bicycle route in Google maps

一个人想着一个人 提交于 2019-12-12 04:25:51
问题 i am wonder ! when i using origin1 and destinationA not working status = "ZERO_RESULTS"; but if used origin2 and destinationB it is working perfectly do i missed anything var origin = "55.930385, -3.118425" var destination = "50.087692, 14.421150" override func viewDidLoad() { super.viewDidLoad() durationDestance(origin: origin, destination: destination, mode:"bicycling") } func durationDestance(origin: String, destination: String, mode:String) { var urlString : String = "https://maps

Google API distancematrix returning wrong json result in VBA

泪湿孤枕 提交于 2019-12-11 10:17:01
问题 hope someone can point me in the right direction. I have a function in VBA which is called from Excel, to call the distance from one postal code to another. This is working fine, until now. The distance only has to be calculated for The Netherlands, but it is not possible to limit the query-string to a country. Now I have a postal code 2151 KD, I use it in my querystring as a from or to postal code. like: http://maps.googleapis.com/maps/api/distancematrix/json?origins=1251KD&destinations