Bing maps traffic API not returning any data? - bing-maps

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/

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.

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

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.

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.

Getting current location and posting it to a web service

Ok... maybe forbidden by Apple, but assuming this is permitted. What would be the best way to get the current location (not difficult) and posting it to a web service (also not much of a challenge). The app is for an artist who wants people to see where he is at the moment. Personally, I wouldn't want people to know where I am 24/7 but that's performance art I guess. An exact location is not wanted but a town or area would be preferred. I could modify the string when it gets to the server and make it more vague by rounding the LOG and LAT.
The app the fans would use would retrieve his current location from the server and update the map view with a location.
I suppose one way would be for him to find out his coordinates and post that to a web page but I'd like it to update automatically.
A response with code is not necessary, just a general opinion on methodology/advisability would be appreciated
I would probably give him a webpage to go to that records his position every time he visits. It would be a private URL, and perhaps use some lightweight authentication. For versatility, I'd record the exact position in the database (in case he changes his mind on how it should work later on). However, you could use an external service or another purchased database with zips or city information with lat/lng data, so you could just provide users of the client app with his general vicinity rather than exact location.
The alternative would be to give him an ad hoc app that does the same thing, but putting together that location recording webpage would be a much simpler process. Could be handy for other things, too.
Here's a little writeup about getting location from mobile Safari, just as a reference: http://mobiforge.com/developing/story/location-iphone-web-apps
Why wouldn't you just use google latitude and read out his status?
I think this should really be done as a web page web-app. You can get coordinates from the device through mobile safari and you can skip the app approval process. You can also set it up so it runs fullscreen on his phone and he won't know the difference. You can also put a password on it.
There is a good chance it would not get approved as a regular app.
You can always meta refresh the page to keep it updating.
http://smithsrus.com/gps-geolocation-in-safari-on-iphone-os-3-0/
"Artist" must log in to his application (thus insuring that he want to share his coordinates with your webserver), then you use CLLocationManager to get his coordinates and make a reverse geocoding using Google Maps API to get country and city for given coordinates.
Can't see anything special about it :)

I'm trying to understand the concept of pulling information off the web and into an app Please!

Generally speaking, how does an app like "Around Me" acquire the information it displays?
For example: the restaurants that show up in a list that are near me with the address and distance (I think I get the distance piece) where is this information extracted from? Is it Google or something?
I'm not asking how to implement this (that's over my head!) just get an idea of how it occurs.
Thanks StackOverFlow people.
I haven't seen that specific app, but most such apps either have an embedded database of locations or they dynamically query a server back-end (e.g. using HTTP) to fetch a set of locations near you. They know where you are because the app has access to location services to find out your geographic location.
The iPhone has a GPS unit which gives you your latitude and longitude, which it then sends to a backend server (Say Google Maps) and queries it for, in your case a restaurant. The server responds with a set of locations around you.