Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

Obtain GPS within a specific region

3 Ansichten (letzte 30 Tage)
Dan
Dan am 26 Okt. 2015
Geschlossen: MATLAB Answer Bot am 20 Aug. 2021
Hello everyone,
I have a large set of GPS locations, however I am only interested in obtaining those GPS locations that fall within a specific region, for this example let's say England.
I currently approach the problem using Google API (with usage limits):
longitude = 2.2333;
latitude = 53.4667;
%Generate the string to Pass over to Google
url = sprintf('https://maps.googleapis.com/maps/api/geocode/xml?latlng=%.4f,%.4f&sensor=true', latitude, longitude);
Google returns an XML structure that is stored in a "buffer"
buffer = urlread(url);
With this information, I perform a search to identify if the XML file provides any mention of England.
%Obtain the formatted address
results = regexp(buffer, '<formatted_address>(.*?)<', 'tokens') ;
%Search and store any mention of 'England'
resOut = [];
for k = 1 : length(results)
resOut = [resOut,strfind(results{k}{1}, 'England')];
end
Question: Is there a "cleaner" more efficient way of identifying GPS locations within a specific region?

Antworten (0)

Diese Frage ist geschlossen.

Produkte

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by