Get GPS location from coordinates?
18 次查看(过去 30 天)
显示 更早的评论
Is there anyway that I can get Matlab to tell me a location based on the input of GPS coordinates? So, for example, if I gave it the coordinates (42.3899, -89.0366), how can I get Matlab to tell me that that's Roscoe, Illinois?
4 个评论
Walter Roberson
2019-1-7
Sakina Jafferi: in theory anyone who is not banned by court order or government regulation from providing you with code, could provide the code you requested . In practice it is unlikely that anyone would bother. If the code is available through search engines then you can do the search since you are the person who needs the results. If the code is not available through search engine then providing the code would take significant research and coding and testing , and it is unlikely that anyone would volunteer to do all that work on behalf of someone who has given no indication that they have put in any effort themselves . The people who have the skills and experience to code that efficiently and who are frequent volunteers are likely to also have the experience to recognize the task as being typical of a topic assigned as a 4th year honours project .
采纳的回答
Cedric
2013-7-29
编辑:Cedric
2013-7-29
There are several solutions, depending the amount of data that you have to process, the time that you are willing to spend on coding, the time that you can afford spending on processing data, etc. You have two main options (there might be newer tools that I am not aware of though):
1. You can use e.g. a dataset of cities with their coordinates (Shapefile, Excel file, DBF file, etc), and just look for the minimal distance between a point and cities locations. This has the advantage that it is fast and local (no internet), but the disadvantage that you probably won't find a dataset with finer information than significant town/cities. You might also need to buy a license for using "high quality" datasets (I don't know if you could use ESRI datasets without a license for example). EDIT: here are a few relevant links:
- ESRI Data and Maps (your university/company might have a site license for ArcGIS and DVDs for Data and Maps).
- Boutell Zip/Lat/Lon Database: here.
- Another "similar" here.
- GeoNames, that could be placed in the next category of solutions, but their data is available here as text files.
2. You can use some online service/API and manage sending requests and processing responses (XML, etc). This has the disadvantage that it requires an internet connection and that sending/processing requests/responses can be time consuming, especially if you have a limited access to the API (number/rate of requests). It has the advantage though that you can get much more information, because APIs can give you access to very large databases (e.g. Google). Here are a few relevant links:
- https://developers.google.com/maps/documentation/geocoding/?csw=1
- Example with your coordinates: http://maps.googleapis.com/maps/api/geocode/json?latlng=42.3899,-89.0366&sensor=true
FEX (untested, because I usually build my own tools on this matter):
- http://www.mathworks.com/matlabcentral/fileexchange/24126-google-geocode-api
- http://www.mathworks.com/matlabcentral/fileexchange/22565-yahoo-geocode-api
EDIT: to illustrate the issue with local datasets, here is the ESRI Data&Maps 9.3 dataset of 3557 cities. As you can see, if you have locations in e.g. Alaska, Montana, Nevada, chance is that the closest city will be quite far according to this dataset..
8 个评论
Cedric
2013-7-30
You're welcome; let me know if you get stuck wrapping all that together. Parsing XML is not the easiest thing to do as it is based on tools which are not fully documented.
更多回答(1 个)
Gholamreza Akbarizadeh
2019-12-11
Hello all.
Using API keys is a restriction, and I think it is not an efficient way for an App. Is it another way to simply read the data form Google Map as a url, and get the location name specified by GPS coordinates?
Regrads.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Mapping Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!