i am tryiing to pass parameters in bing map distance matrix api with request.get(url,parameter) but it is not passing in correct order
i tried this
enter code here
parameters = {
'origins':[47.6044,-122.3345],
'destinations':{"latitude":47.6731,"longitude":-122.2057},
"travelMode": "driving",
'key':api_for_bing
}
but it gives the response :
'https://dev.virtualearth.net/REST/v1/Routes/DistanceMatrix?origins=47.6044&origins=-122.3345&destinations=latitude&destinations=longitude&travelMode=driving&key=my_key'
can any one help me with this.
while it shoud be like this
'https://dev.virtualearth.net/REST/v1/Routes/DistanceMatrix?origins=47.6044,-122.3345;47.6731,-122.1185;47.6149,-122.1936&destinations=47.4747,-122.2057&travelMode=driving&key=my_key'
First, you probably want to hide your personal Bing Maps Key. Second, there are sample calls available at https://learn.microsoft.com/en-us/bingmaps/rest-services/examples/distance-matrix-example
Your call above only shows one start and one destination which is not actually a matrix but rather just a single route. If you are not actually looking for multiple routes then you probably should use the Routing API (Directions Manager)rather than Distance Matrix.
Related
I’m new to here-aip, and I’m not sure if my needs can be addressed via service offering (I'm open to other location like services / utilities).
I have a list of (ordered) geo-points describing a transit (already taken place in the past) and I would like to get a clue of a feasible transportation mode in which this transit had taken place (e.g.: this looks like a train trip!).
input example :
lon
lat
121.240436
24.952392
121.24043
24.95239
121.240436
24.952392
121.23966
24.952605
121.23964
24.9526
121.23964
24.95227
121.23964
24.95227
121.239683
24.952316
121.23967
24.95232
121.240149
24.951126
121.24016
24.95111
I have thought about providing the list of points as a constraint and receive the estimated duration using each transportation mode (then on my side I can compare the possible duration with the actual duration and conclude the transportation mode).
I currently understand that if I provide two points (e.g. start and end) I can get a duration estimation and route, but I need more then that (e.g. if the actual transit is circular, providing start point and end point will not be meaningful).
Any ideas?
You can make use of VIA parameter to define the multiple waypoints while calculating the route.
Please refer the below link for more details.
https://developer.here.com/documentation/routing-api/dev_guide/topics/use-cases/via.html
And Refer below example which explain how we can use the VIA parameter in the request.
https://router.hereapi.com/v8/routes?apikey={YOUR_API_KEY}&origin=52.542948,13.37152&destination=52.523734,13.40671&via=52.529061,13.369288&via=52.522272,13.381991&return=polyline,summary,actions,instructions,turnByTurnActions&transportMode=car&departureTime=2022-04-05T20:45:00-07:00
I would like to retrieve the following (historical) information while using the
ek.get_data()
function: ISIN, MSNR,MSNP, MSPI, NR, PI, NT
for some equity indices, take ".STOXX" as an example. How do I do that? I want to specify I am using the get data function instead of the timeseries function because I need daily data and I would not respect the 3k rows limit in get.timeseries.
In general: how do I get to know the right names for the fields that I have to use inside the
ek.get_data()
function? I tried with both the codes that the Excel Eikon program uses and also the names used in the Eikon browser but they differ quite a lot from the example I saw in some sample code on the web (eg. TR.TotalReturnYTD vs TR.PCTCHG_YTD. How do I get to understand what would be the right name for the data types I need?
Considering the codes in your function (ISIN, MSNR,MSNP, MSPI, NR, PI, NT), I'd guess you are interested in the Datastream dataset. You are probably beter off using the DataStream WebServices (DSWS) API instead of the Eikon API. This will also relieve you off your 3k row limit.
I try to consume some GTFS Feeds and work with them.
I created a MySQL Database and a Python Script, which downloads GTFS - Files and import them in the right tables.
Now I am using the LeafLet Map - Framework, to display the Stops on the map.
The next step is to display the routes of a bus or tram line on the map.
In the GTFS - Archive is no shapes.txt.
Is there a way to display the routes without the shapes.txt ?
Thanks!
Kali
You will have to generate your own shape using underlying street data or public transit lines. See detailed post by Anton Dubrau (he is an angel for writing this blog post).
https://medium.com/transit-app/how-we-built-the-worlds-prettiest-auto-generated-transit-maps-12d0c6fa502f
Specifically:
Here’s an example. In the diagram below, we have a trip with three
stops, and no shape information whatsoever. We extract the set of
tracks the trip uses from OSM (grey lines). Our matching algorithm
then finds a trajectory (black line) that follows the OSM, while
minimizing its length and the errors to the stops (e1, e2, e3).
The only alternative to using shapes.txt would be to use the stops along the route to define shapes. The laziest way would be to pick a single trip for that route, get the set of stops from stop_times.txt, and then get the corresponding stop locations from stops.txt.
If you wanted or needed to, you could get a more complete picture by finding the unique ordered sets of stops among all of the trips on that route, and define a shape for each ordered set in the same way.
Of course, these shapes would only be rough estimates because you don't have any information about the path taken by the vehicles between stops.
I need to find latitudes and longitudes of all points that lie along the route between two points (start point and end point, both represented as lat-long pair) in the google map. I have 1 million start points and the corresponding 1 million end points. So, basically I would have 1 million routes and I need to find all points that lie along each of these 1 million routes, separately. I do not want to call google javascript api, because there is a restriction on the no of calls that one can make per day. Also, this will not scale. Can anyone please suggest, how can I do it using python and some offline api/tool for google map?
You say you represent a route as start/end point, you have to consider that for each pair of start and end points you can have more than one route (depending on the mode of travel, etc.).
This is why you need routing. If you don't want to use Google's directions API you can check OpenStreetMap's routing APIs or roll your own router using existing libraries and engines on OSM data.
Similar question: Calculating shortest path on maps (Google Maps, Openstreetmaps, etc)
Well i want to use facebook's graph api to get checkins from a specific geo-graphical location with python.
In the api documentation area i didn't find the right combinations of api parameters to get it done;
http://developers.facebook.com/docs/reference/api/checkin/
For example , if i want to get all checkins in coffee-shops in Harvard-square(Boston) what would be the api call ? (without going into specifying every coffee-shop in that location)
thanks.
You can search for coffee places as follows:
https://graph.facebook.com/search?q=coffee&type=place.
You can then narrow narrow your search to a specific location and distance by adding the center parameter (with latitude and longitude) and an optional distance parameter:
https://graph.facebook.com/search?q=coffee&type=place¢er=37.76,-122.427&distance=1000
This is documented by Facebook here.