I am using CSMapAnnotation classes for different purposes. Now I have to show route between two locations. I do have latitude and longitude for both of the locations.
Can any one please help the best way to achieve that ?
You can use this example:
http://blog.kadirpekel.com/2010/05/30/drawing_routes_onto_mkmapview_using_unofficial_google_maps_directions_api/
It will call the routing api and parse the result.
Then a new layer is added above the map with the route between A and B.
Related
I have a problem with OSRM and leaflet, i need to create a route.
What the user do :
select (multiple or no) any itinerary (polyline) displayed on map
when they are selected the user can create the route
and here, my problem, how can i create a route from coordinates of they polilynes ?
i have tried a lot of things, but nothing worked, with osrm we need to add waypoints, but my coordinates are note waypoints and they are many many many !
how can i proceed ? recuce the array of coords ? but i need to be sure that the route use the correct itinerary :/
While fetching a driving route from OSRM, is it possible to fetch the names of the roads that feed into that path (so crossings and side roads)? If so, how can this be done?
Unfortunately you can only retrieve the names of the roads that are part of the route. This information is available if you pass the option steps=true.
The .routes[].legs[].steps[] object (RouteStep) has a property name that contains the street name.
Greetings fellow SO users,
I am extracting data with import.io from a site which contains city names. What I want to accomplish is to get the coordinates to each city from Nominatim and finally create/get a JSON response which contains the city name and the corresponding coordinates for each.
So I basically need to use the result from one API as the input for another (Nominatim).
Or in other words: feed a JSON list of city names to OSM's Nominatim and get back the coordinates to each city.
I wonder if this is even possible or what other options I have. Finally this would be used with leaflet to put some markers at a map.
There are tutorials for Nominatim, how to query etc. but only one query at a time. Is it even possible to query a whole list of places?
What you want to achieve in here is what we call Chained APIs. So you will need two APIs, where the input of the second one is the output of the first one.
In this case you will need some custom processing between the two APIs. From the first API you are getting the city name and from here you need to generate a list of URLs in the format http://nominatim.openstreetmap.org/search?q=CITY&format=xml one per each CITY.
After that you can use the Bulk Extract feature in import.io and pass the whole list of URLs to be queried against the API.
I need to fetch zipcodes falling all along the route using MapQuest API.Plz suggest i tried to find on mapquest forum as well as on stack .I also did google but can't manage to find appropriate solution.
Ex : Suppose i define a Route from point A to Point B. Now i need to fetch all zipcodes falling in between this route.
You'll want to look at the Corridor Search, which is part of the Search API Web Service. You have two options; you can either pass in the shapePoints that make up the route (corridor) that you want to search along, or you can use the Directions API to calculate a route and then use the sessionId from the Directions API response as input into the Search request.
Here's an example using the Directions API in conjunction with the Search API:
Use the Directions API to calculate a route between two points. In this example, I'm calculating a route between Denver, CO and Aurora, CO:
http://www.mapquestapi.com/directions/v2/route?key=YOUR-APP-KEY-GOES-HERE&from=Denver,CO&to=Aurora,CO
Locate the sessionId parameter in the response.
Use the Search API to perform a corridor search on the uspostalcodes table. I'm also filtering the results from the table to include just the name of the postal code and none of the other info that is available in the table.
http://www.mapquestapi.com/search/v2/corridor?key=YOUR-APP-KEY-GOES-HERE&sessionId=YOUR-SESSION-ID-GOES-HERE&width=1&buffer=0&hostedData=mqap.uspostalcodes|||POSTCODE
You can adjust the width/buffer options as well to refine your search.
Hope this helps!
In my application i have to get the location name using latitude and longitude values, I think we can get them through reverse geocoding is there any method that we can use and get the location value
Thank You
You may also want to take a look at Geonames.org for placenames lookup. It provides acess to a database with more than 8 million geolocations through a JSON or XML api.
An objective-c wrapper of the web services can be found at ILGeoNames3.
MKReverseGeocoder.