Cameras On Route
![Screenshot of Cameras on Route sample application](img/cameras-on-route-screenshot.jpg)
Vizzion's Cameras On Route sample application illustrates a number of considerations when developing an application that displays cameras along a navigation route, including matching cameras to a route, choosing which cameras to show, and displaying camera images.
In addition to pseudocode illustrating the recommended techniques, the full sample application source code is available for download.
Matching Cameras to a Route
Vizzion’s Camera API allows cameras to be matched to a route either by a sequence of latitude/longitude coordinates, or by a sequence of TMC segment codes.
In this sample application, the MapQuest routing API is used to retrieve latitude/longitude coordinates for a route, and then the GetCamerasOnRoute method is used to return all cameras along the route, including any available hotspot cameras (see Hotspot Cameras). GetCamerasOnRoute automatically sorts the cameras, starting with the camera closest to the start of the route.
![Image of cameras matches to a route](img/matching-cameras-to-route.jpg)
Choosing Cameras to Show
In many situations there will be too many cameras along a route to display, and navigation applications will need to selectively discard some of the cameras.
In this sample application, out-of-service cameras are discarded first (see Out-of-Service Cameras). Next, the first camera on the route is selected, and any cameras within 1 km of the first camera are discarded. This process is repeated until the end of the route is reached. The following pseudocode illustrates this process:
Pseudocode |
---|
CamerasDataSet = GetCamerasOnRoute("(-83.0512, 42.3377),(-83.0529,42.3401)...", "", 0, <password>) For Each (Camera1 in CamerasDataSet) For Each (Camera2 in remainder of CamerasDataSet) If (Distance from Camera1 to Camera2 < 1 km) Remove Camera2 |
Displaying Camera Images
In this sample application, a 3:2 aspect ratio is used to display images (see Display Aspect Ratio), and image sizes are requested to exactly match the display size (see Requested Aspect Ratio). In addition to the camera name, the camera copyright notice, capture time (see Capture Time Display), and viewpoint (see Viewpoint Display) are all displayed alongside the current image.
A "deck of cards" analogy is used to display cameras along a route, and clicking the topmost “card” will advance to the next camera. Other designs for displaying cameras along a route include placing thumbnail images directly on the map, displaying a horizontal or vertical scrolling list of cameras, and another "deck of cards" analogy using a swipe to remove the topmost "card". Vizzion's Automotive Concepts video illustrates some of these ideas.
![Automotive concepts utilizing a scrolling list to show cameras](img\automotiveconcepts-scrollinglist.jpg)
Downloads
Download | Details |
---|---|
Source code | Requires Visual Studio 2012 or later |