The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Software » comp.soft-sys.matlab

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Google API
Replies: 3   Last Post: Apr 21, 2014 10:11 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]

Posts: 6
Registered: 12/23/13
Re: Google API
Posted: Apr 14, 2014 8:04 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"Mazin" wrote in message <life7r$mk0$>...
> I need to setup matlab to use some Google API features.
> I need to give matlab a physical address "street address' and then matlab passes that to Google to get the longitude and latitude of that address , then I can do my own calculation with the longitude and latitude I receive.
> In the file exchange section I found some ready made functions but I couldn't follow them entirely. I'm asking first do I need to do any special setup to link matlab to Google before running a code ?

Here some code, where adresse is your address as a string.

% Parent URL
url = '';

% Read from google:
xDoc = xmlread(strcat(url,adresse));

allPlaces = xDoc.getElementsByTagName('place');
firstPlace = allPlaces.item(0);

if ~isempty(firstPlace)
lat = str2double(firstPlace.getAttribute('lat'));
lon = str2double(firstPlace.getAttribute('lon'));

else % Location in South Atlantic Ocean
lat = -1;
lon = -1;

Date Subject Author
Read Google API
Read Re: Google API
matt dash
Read Re: Google API
Read Re: Google API

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.