I have a list of 200 some addresses. I used geocommons to convert these addresses into long/lat coordinates in kml and gpx format. I need to generate a map by connecting all the points to create a path. What would be the best way to do this? Is there a service that automatically does this, or should I dabble into something like the google maps API?
You need links between the nodes to calculate some kind of path. To get a realistic path for say a car or a person you need a accurate road data. This is normaly something you pay for, at least where I come from, but maybe there some way to get it for free.
If you get the road data it will probably not in wgs84, rather in some local or national system and you probably have to convert your point in to that other coordinate system.
To do the calculations you could use some kind of "GIS-tool" like the Open Source QGIS. I'm not cure if they got a one-click solution for your problem but I believe you can solve it with this tool. There are also well-defined algoritms to solve it by hand, just search for Traveling Salesman Problem.
Regards
Related
Assume that you have the boundaries of states/counties of any country in a text file as follows:
State \t State Name \t Lat/Long of entire State Boundary(comma separated).
I want to to store this information in a data structure** and then given a lat-long, retrieve the state.
I don't want to use APIs and don't want to do the brute force approach (that is, build a polygon for each state and then do a point in polygon algorithm until a hit)
With my limited knowledge, I think KD-Trees or R-Trees is the way to do? Although both of the seem like good choice, I am not sure which one to use. It would be very helpful if you can provide a detailed explanation - from creating the Data Structure to performing the search.
I am more interested in the counties than states because of their finer granularity. May be it is worth stopping the tree building at a larger granularity and then do a point in polygon approach for all the counties in that granularity (Minimum bounding region). Conceptually this seems doable, but I am not sure how to implement this.
If you haven't already chosen a Geospatial friendly database, pick Postgis. Mysql 5.7 will also do the trick but Postgis is more mature and feature rich.2
Download the world borders shapefile.
Import the shapefile into postgis or into mysql
Make use of the ST_Within function available in both mysql and postgis to determine if a given point is inside any country and to retrieve the name or other information for that country.
Note that the ST_within query is fast, and you don't need to do a lot hard on your own. This is a one liner.
Setting up the database and importing the database maybe hard work, but you will have to do that anyway even if you come up with a home made solution.
What would be my best option if i want to map multiple lat, longs onto a map within an iOS App?
I have hundreds of points captured from a GPS receiver over an hours walk. Does anyone have any thoughts on how to best ingest all these points and spit out a map with the exact route followed??
Any help with this would be great. Is there anyway i can provide all the data points to the Google Maps API and they return a map plus meta data for things like total distance?
What have you tried so far? What part are you unsure about? How do you want to display the route and when?
As far as I understand, you are saving coordinates to a database at a defined interval. We don't know at what frequency. You will be able to display each point on a map, and eventually link them alltogether with a polyline. But that won't follow roads. For this you would need to use the Directions service. But this service has limitations:
You cannot assume that giving the service your start and end coordinates it would calculate the same route that you followed.
You can give the service a few waypoints but you are limited to 8 waypoints per request (with the free API).
The free API allows for 2500 requests per day / 10 per second.
Let me know if there is anything else I can help you with.
I have a set of routing data, in both CSV or KML format. It is basically a list of Lat / Lon and some supporting information.
I am looking for a way to display this as a route (e.g. with lines between the points in the order they appear in the list) online. Ideally a free option, as I'm not likely to need it again in the near future.
I have found hundreds (maybe an exageration) of ways of plotting the points, but not one that will include the lines. I'm trying to avoid the long and tedious process of converting one of these to an image and drawing the lines by hand.
Can anyone suggest such a site?
This question was asked on a google group for google maps. The user received an answer that pointed him towards the google map API. Given how other apps / web pages do this using google maps (never seen it done any other way) I would imagine this would be the best route to go down as its probably something they have built into the service.
https://groups.google.com/forum/?fromgroups=#!topic/google-maps-js-api-v3/F_iroBiBeww
There are lots of existing questions relating to this issue, but I have looked at as many of them as I could find and did not get an answer.
I'm trying to perform an offline reverse geocoding lookup on iOS based on a latitude and longitude. I'd like to be able to provide a latitude and longitude, and be provided with the country in which that point lies. I can do this with Geonames (such as: http://api.geonames.org/countryCode?lat=45.03&lng=8.2&username=demo), but I need a similar ability offline, without Internet functionality on the device.
CLLocation does not provide offline services that work reliably enough for what I'm doing, it relies on caches made while you were previously online, etc. Messy.
I've tried this: https://github.com/drodriguez/reversegeocoding but haven't had any luck, it requires some slightly complex / confusing Terminal installations using something called Thor which I've never heard of, and was throwing up a variety of errors, so I bailed on it.
I've found a few downloadable maps, but these seem to be even more complicated, and worryingly, hundreds of megabytes or even gigabytes in size – much beyond the scope of an iOS app. I only need countries, nothing smaller than that (cities, streets, locations, etc.) so I think I should be able to get a much smaller file.
So my key question is: is there some pre-existing database or tool, preferably with iOS support, that I can feed a latitude/longitude, and get a country? And, if not, what steps should I take to get such functionality working on my own?
Thanks in advance.
ReverseGeocodeCountry is a simple lightweight offline country reverse geocoder for iOS, it has a static JSON file with country polygon data that is used to reverse geocode any lat/lng:
https://github.com/krisrak/ios-offline-reverse-geocode-country
The "Countries of the World" is a .csv text file with countries, coordinates, localised country names, capitals and other information. It seems to be free to use. You just have to import it into an SQLite database.
Edit Just noticed you want reverse geocoding. The database would only be good for forward geocoding.
You can download shapefiles for all countries at http://www.gadm.org/download. If you download a .kmz, you can unpack it to a list of coordinates for the borders. You could probably take every 5th or 10th coordinate to get smaller size (with less accuracy).
Just in case I can suggest another good written offline geocoding library.
https://github.com/Alterplay/APOfflineReverseGeocoding
Let's say I'm just wondering around with my cellphone and I want to know exactly which place of business I'm in. This would seem to be easy, but I don't see away to do it. It's possible to reverse geocode but this gives an address range. Google doesn't seem to have http base local search using local information, because you could kind of guess from the local search or points of interest. It needs to be through an http API, not an ajax driven map. Is there a way to do this?
You might look at GeoAPI, which lets you search for businesses near a particular lat/lon coordinate and returns detailed information about the business (name, type, hours, etc.). It's a simple JSON API with good documentation and examples.
There's likely more APIs out there for local business data -- which I personally would love to hear about if people want to add them as answers to this question or comments on my answer. What's your favorite? What are the advantages and disadvantages?