How to insert google API in MATLAB?

I want to embed the google map api in my matlab application to find the shortest distance between two different locations (coordinates). I tried to show the poly lines on it.

How can I achieve this in matlab?

Thanks Abi

+3
source share
2 answers

MATLAB can initialize Java classes. Java itself has been enhanced to use scripting languages. Getting Javascript on the JVM in just 15 minutes can be a valuable approach to using the Google Maps API from within MATLAB.

+1
source

I believe the best way is to use google distance matrix api and urlread in matlab.

try the following:

orig_coord = '37.869733350860730,-122.284758688533';
dest_coord = '37.871700000000000,-122.253300000000';
mode='walking';

url = ['https://maps.googleapis.com/maps/api/distancematrix/json?origins=(',orig_coord,')&destinations=(',dest_coord,')&mode=',mode,'&language=en-EN&sensor=false'];

str = urlread(url);

JSON Parser .

0

Source: https://habr.com/ru/post/1787381/


All Articles