Show location data on the map

The NextBus toolkit comes with another application that lets you view data in a way that is more natural for moving geographic locations, namely on a map. Similar to MyMainComposite, this application connects to the kind of stream exported by NextBusIngest and FileIngest. Without any further configuration, it can take the latitude and longitude values in the tuples and an ID attribute, and generate an appropriate map.

The map is simple and is intended only as a quick method for learning about your data.

  1. In the NextBus toolkit, launch NextBusVisualize. In the Edit Configuration dialog, scroll down to the Submission Time Values. Note the value of the port variable: 8080. Widen the Name column to see the full name.
    In the Instance Graph, each of the two exported streams is connected to each of the downstream jobs. The arrows look a bit confusing, but if you select each of the branches, you can untangle them.

  2. To open the map in Firefox, double-click the Live Map desktop launcher. Minimize the Studio window or move it out of the way to see it. You will see a map of the San Francisco Bay Area with a large number of green bus markers crowding the city and blue cars concentrated in the downtown area.
  3. Use the map controls or mouse wheel to zoom in and pan (hold down the left mouse button to drag and center the map) so that you can see the individual vehicles. The buses jump around as their locations are updated. You can see that the map is live!
    The map refreshes every second, but remember that NextBus data is updated only every 30 seconds. If you zoom in far enough by clicking the zoom tool three times from the starting level, you can see the simulated cars from the file move continually around downtown San Francisco. They jump periodically, as the locations start over at the top of the file.
    Click any one of the markers to get the full list of attributes for that vehicle.