Info
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
Obtain GPS within a specific region
조회 수: 1 (최근 30일)
이전 댓글 표시
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?
댓글 수: 0
답변 (0개)
이 질문은 마감되었습니다.
참고 항목
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!