#CCTVViewer
CCTVViewer allows you to view a number of the CCTVs on New York State roads and a few other states. The CCTVs are displayed as markers on a Google Map and on mouse rollover the CCTV image feed pops up. The CCTV information is retrieved from the 511 NY Data Feed available at (www.511ny.org/developer.aspx). A user name and password is required to access the data feed. The data feed returns an XML document with each CCTV. Each CCTV has a number of nodes that describe where it is located and the URL of the image feed. When the initial page loads, a map is initialized with all of the CCTVs. If the user rolls over a marker an ajax request is submitted to retrieve the URL of the CCTV's image. This is so the latest image is displayed. The images aren't updated all the time on the data feed so they may stay the same for an amount of time.
The CCTVs are kept in a database table, cctv. This table is populated during a migration, so to setup the database just run rake db:migrate
. There is a rake task that will refresh the URLs for each CCTV. The rake task is ran every 11 seconds by a Clockwork (https://github.com/tomykaira/clockwork) worker.
###Future Plans
I'd like to get the CCTV map updating properly and everything running smoothly. I also want to integrate some of the other data feeds from the 511 NY site. There is a data feed for all the traffic events that I plan on making a map for. This has been started but isn't working properly yet. I'll probably integrate the two maps as well and make it so users can view the CCTV images that are closest to each traffic event.