Where is the traffic flow direction stored in OSM route data? - openstreetmap

I downloaded OSM route data and opened it in QGIS in order to see if traffic flow direction could be displayed (and this is the case). To do so, I just changed the symbology by replacing the simple line symbol by the arrow.
So, I am wondering where this information is stored in the downloaded route data? How is QGIS able to display it?

Every way in OSM has a direction. A way can have a oneway tag. If oneway=yes is set then traffic can only flow in the direction of the way. If oneway=-1 is set then traffic can only flow against the direction of the way.

Related

Google map in flutter application

Can we implement google maps in a flutter application which runs once and fetches route from location1 to location2 and then we can move over the route without placing any new request to google API console?
Like, for the hikers and travelers who is supposed to be in a part where they may not have internet access then can user offline routes saved on device.
Thanks
I have tried google console APIs but it requires timely requests and costs a lot.
In my case, I use Flutter Map with Google Map Tile layer. When performing routing, API server sends me a list of Coordinates that make up a path from start to end. Then I just add them to Polyline layer to display on the map.
yes, you can do it. You have to hit the direction API to get the direction from point A to Point B. In JSON response you will get all the required data, like polyline points, steps, routes, and Lat, Lng. Save the polyLine points and draw polylines on GoogleMaps. And when you move, simply get your latLng from GPS using a geolocator or Location package and set a listener on it for every movement. And now it will work without the internet. But for another request, you will need internet.

Is it possible to convert a (Leaflet) route into a polyline?

I'm currently making a map with roads that I have driven in the past. Right now, for one route I enter a few waypoints, and the route is calculated through these waypoints using OSRM.
It works fine, but the problem is that on every pageload this route will be recalculated (which makes sense, cause that's how routing works). Let's say I have 50 routes, that'll be a lot of requests. However, I want to be able to calculate the route once, and save the line that is generated as a polyline, which essentially caches the route forever.
Since the routes all stay the same, and no recalculation is necessary, this would be the best way, because then I don't need to setup my own OSRM server or pay for a routing service. (I might need to recalculate routes every once in a while, but that's alright).
Is this way of converting/cachine routes possible? It would be great if I could get this project working live without any routing attached to it.
Thanks for your help in advance!

Can traffic conditions be ignored when generating directions in bing maps web control API?

For our application we are presenting route options to a user that will be used for planning purposes (distance, time, etc). Is there a way, with the bing maps web control api, to ignore traffic conditions? For example, if a major highway is closed at the time the directions are generated, I don't want to route around that. Other conditions are fine, such as highway or non-highway, or possibly just other options that are similar. But we don't want to change the route options based on current traffic. Thanks.
Simply set the routeOptimization option in the directionsRequestOptions to shortestTime. I believe that is the default. The calculated route will be based on posted speed limits and not on traffic conditions. The response includes two times, one with and one without traffic for the route path.

Bing maps traffic API not returning any data?

I've been attempting to use the Bing traffic API to return traffic data for a specific area, but I never seem to get any traffic info back, even at peak hours when I can see several incidents listed with the BBC Travel website.
I haven't been able to find a way through the Bing API to show a bounding box on a map to verify that I'm getting the right area, but when I display the bounding rectangle on a google map, it covers the area that I'm interested in. I've also tried expanding the area considerably to include surrounding areas, and then I do sometimes get some data, but that seems quite erratic and disappears again when I expand the bounding box again??
The URL I'm using is:
http://dev.virtualearth.net/REST/v1/Traffic/Incidents/51.4,-2.8,51.7,-2.3/true?o=xml&key=MyKey
(South, West, North, East co-ordinates).
And it covers the following area on a google map, which is exactly what I'm expecting:
Am I doing something completely wrong with the API call or is this some weird behaviour that shouldn't be happening?
The BBC pulls in their Traffic incident data from a different source. Looking into the Traffic Manager Module in the Bing Maps V7 control I do see some incidents, not the same as the BBC though. The Bing Maps control also has traffic flow maps as well.
Here are a couple of other API's you can try out:
http://data.gov.uk/dataset/live-traffic-information-from-the-highways-agency-road-network
http://www.highways.gov.uk/traffic-information/

What is the best way to fetch user location server side

I know that the best way to fetch the user position (not only cords, but also country name and city name) is using client side script, right?
But I have seen that user can deny to say his position, so, how can I determinate it in the server side? What is the best way to do it? Is there any Zend Framework extension?
It's possible with the IP but not 100% sure. You can look for web service like this one : http://www.ip2location.com/ or if you just want the country download the ip database.
You can find visitors position according to IP addresses. This data is not as exact as gps position or cell data information although at least you can find out visitior's country.
PHP has core functionality to access ip:
http://www.php.net/manual/en/reserved.variables.server.php
The are certain projects that can handle ip to place (country) conversion:
http://code.google.com/p/php-ip-2-country/