I would like to use Google Directions Api on 'DRIVING' mode, but I want to know the best route driving a bus and not a car.
I'm not talking about 'TRANSIT' mode. I don't want to take a bus but drive it.
Does anybody know if that option is possible?
As geocodezip mentioned in the comments, that functionality is just not possible.
If you choose to set the mode property within the Direction Service API to 'DRIVING', GM will assume you want standard driving directions for a motor vehicle (car).
Here's an extract from their documentation concerning possible travel modes for the Directions Service API:
The following travel modes are currently supported:
DRIVING (Default) standard driving directions using the road network.
BICYCLING bicycling directions via bicycle paths & preferred streets.
TRANSIT directions via public transit routes.
WALKING walking directions via pedestrian paths & sidewalks.
So to answer your question. No, unlike the TRANSIT option, there's no way to specify a form of vehicle you would like to use within the 'DRIVING' option of the Direction Service API.
But that might change one day.
Related
I'm using the Here API to calculate routes for trucks with 40t. Using the HERE devtools, i got the same error of my APP. The answer is "The API can't calculate the route because of illegal access". I checked the map (image attached) and in the street where my journey will start, with a difference of some meters, it exists two limitations 12t and 18t. The street is one way... If you see the satellite image exists several trucks... The company is testing the software says the trucks goes their...
Can some help me on this?
https://fleet.api.here.com/2/calculateroute.json?waypoint0=41.325299,2.141551&waypoint1=stopOver,3600!41.3291843,2.0317197&waypoint2=stopOver,3600!40.91260530,-8.42291420&waypoint3=38.855951,-9.104382&mode=fastest;truck;traffic:enabled&departure=2020-08-19T02:57:58&alternatives=0&weightPerAxle=14t&limitedWeight=40t&height=4m&width=2.55m&length=16.5m&trailersCount=
If you want to ignore the restrictions for trucks in the route, add the parameter truckRestrictionPenalty and set the value to soft.
The route violating truck restrictions is indicated in the response with dedicated route and manoeuvre notes. The route with the note of the type violation and the text truckRestriction may be travelled at your own responsibility. While driving on such a route, extra care has to be taken as it may result in a vehicle or road infrastructure damage.
You can read more about the parameter here.
Thanks for your feedback, but we are using the Fleet Telematics Api not the Routing API. Using your info, We researched a litle more and we found the equivalent parameter: ignoreWaypointVehicleRestriction.
We added these params &ignoreWaypointVehicleRestriction=5000;0;all and the API returned the route with the warning.
Thanks,
I have latitude and longitude where my car is driving on highway. I want to know whether my car speed is greater than highway speed where I am driving
You can achieve this by using the simple Routing API(used for routing usecases) or Fleet Telematics API(used for complex routing problems like trucks).
Routing API: The below example provides the speed limits in a particular route. You can check this against your car speed limit to verify if you are driving within limits. Read more about the api in Here developer site - https://developer.here.com/documentation/routing/topics/resource-get-route.html
https://route.api.here.com/routing/7.2/calculateroute.json?waypoint0=41.69758,-87.78397&waypoint1=41.70056,-87.77429&mode=fastest;car&storage=readonly&linkAttributes=speedLimit&app_code=yyyyy&app_id=xxxx&representation=linkPaging
Fleet Telematics API: You can get the speedlimit information along a route using this api as well. Here provides numerous examples on how to do this in https://tcs.ext.here.com/examples site. Just login with your Here credentials and search for speed. You can take a look at the source code there. You can also read more about this api in Here website https://developer.here.com/documentation/fleet-telematics/dev_guide/index.html
Hope you find these useful!Happy Coding!
I am working on a GSM based tracking device . i have successfully able to plot the approximate location on google maps using Gmap.net library for windows application and google maps api for android application.I want to mainly do the tracking of the Rail coach .with my current device i gets the approximate location near the railway track.I want to shift that Location /Maker on the near by Rail track.i need help and suggestions on how to achieve this task.please help.
Afaik the gmap.net library does not provide any feature around pinning tracking data, so I guess some manual work might be necessary.
The naive approach is to map your track on your own, google maps etc. is fine. I fact I've used gmap.net once itself to create exactly that.
Then all you need to do is some math (useful key word here is 'shortest path'), to locate the closest matching tracking point and use interpolation to distinguish your anticipated position on the track. You can also add some plausibility checks to speed up the whole process such as "knowing" where on your track you've already been.
I've got experience in real-time tracking for TV events and can go in deeper detail if you want.
I want to write an application that gives me the exact route of a subway.
When you use Google Maps it just connects two stops linearly, but not the actual way.
Is there a way to move a route anywhere on a map without being bound to roads?
If there's any solution (doesn't have to be with the Google Maps API) please let me know.
Edit:
Example
Google shows the train route like the brown line, but the train actually drives the blue line. What I would like to do is get the blue line so that I can get the coordinates of the route and calculate the curves and elevation.
I know that I could add like 50 waypoint and get get a "fake" route with them, but I would like to have it automatic and not done by hand.
To show the transit directions (subway, bus, tram, etc.) Google Maps uses the data provided by transit agencies in the form of GTFS feeds. This is a responsibility of the agency to provide a detailed shape of the route for the transport according to the GTFS specification. You can have a look at GTFS documentation to figure out how does it work:
https://developers.google.com/transit/gtfs/
https://developers.google.com/transit/gtfs/reference/#general_transit_feed_specification_reference
I hope this helps.
I would like to use the snap-to-roads functionality to normalize bike paths. Bikes sometimes follow different rules (they may drive in the wrong direction of a one-way street). Is it possible to use "bike rules" in snap-to-roads or would a better way be using the directions API (with bike mode)?
Regards,
Sarah
The Google Maps Roads API (snap to road) is not useable for bikes. See the Dokumentation and the demo under: https://developers.google.com/maps/documentation/roads/snap#demo
So the directions API is the way to go or use online or offline services.
best regards, Reinhard