COLABORATI / sunders

Surveillance under Surveillance

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Surveillance under Surveillance

Surveillance under Surveillance shows you cameras and guards — watching you — almost everywhere. You can see where they are located and, if the information is available, what type they are, the area they observe, or other interesting facts.

Different icons and colors give you a quick overview about the indexed surveillance entries. Click on those icons on the map to get the available information.

Icon Description
Fixed cameras Fixed camera — usually observing a limited area
Dome cameras Dome camera — usually observing a 360° area
Guards Guard — e.g. an employee of a security service
Automatic Licence Plate Recognition ALPR — Automatic Licence Plate Recognition
Color Description
Public surveillance Red background — observing a public outdoor area, accessable by everyone
Outdoor surveillance Blue background — observing a private outdoor area, accessable only by authorized persons
Indoor surveillance Green background — observing an indoor area
Fixed cameras, fixme
Dome cameras, fixme
Guards, fixme
Automatic Licence Plate Recognition, fixme
Yellow icon — camera or guard marked with a fixme key because it needs further attention

A running instance of this project can be visited at https://kamba4.crux.uberspace.de.

Installation

If you like to run Surveillance under Surveillance on your own LAMP or LNMP server follow these steps:

  1. Get the sources
  • Copy the content of home/sunders/ to your home directory, e.g. to ~/sunders/.

  • Copy the content of www/sunders/ to your server's www directory, e.g. to /var/www/sunders/.

  1. Set up the datebase
  • Change to the directory ~/sunders/init_cameras/db/.

  • Open the file createDB.sql and enter a password for the new database user camera.

  • Create the database camera by executing the file createDB.sql.

    mysql -h localhost -u root --password=[mysql root password] < createDb.sql

  1. Initialize the database

Decide whether you like to start with the surveillance entries of the first planet.osm file from September 12, 2012 or if you like to start with the latest planet.osm file or an extract of an individual country or region.

Start with the surveillance entries of the first planet.osm file from September 12, 2012

Pros: You don't have to download the latest +50GB planet.osm file to create a sql import file.

Cons: It could take several days until your database is up-to-date and contains all surveillance entries that have been added between September 12, 2012 and today. Furthermore you start with a data record for the whole planet. Maybe you are only interested in the data of a certain country or region.

  • Execute the file initializeDB_planet_20120912.sql for database user camera.

    mysql camera -h localhost -u camera --password=[camera user password] < initializeDB_planet_20120912.sql

Start with the latest planet.osm file or an extract of an individual country or state

Pros: You start with the latest data records. Furthermore you can choose what country or region you like to map.

Cons: If you like to map the whole planet you have to download the latest +50GB planet.osm file. According to your internet connection this could take a while. At last you have to install the command line Openstreetmap data processor Osmosis on your computer.

  • Download the latest osm.bz2 file you like to extract the data from, e.g. from planet.openstreetmap.org or from download.geofabrik.de. They also offer a MD5 sum to verify the downloaded file.

  • Copy the just downloaded osm.bz2 file to the directory ~/sunders/init_cameras/.

  • Open the file ~/sunders/init_cameras/createInitialDataFiles.sh and enter the name of the osm.bz2 file as XML_FILE.

    XML_FILE=[file name].osm.bz2

  • Execute createInitialDataFiles.sh to create the files surveillance.osm and initializeDB.sql.

  • Move the new files surveillance.osm and initializeDB.sql to the directory ~/sunders/init_cameras/db/ and change to that directory.

  • Execute the file initializeDB.sql for database user camera.

    mysql camera -h localhost -u camera --password=[camera user password] < initializeDB.sql

  1. Update the database
  • Change to the directory ~/sunders/update_cameras/.

  • Rename the file config.php.example to config.php.

  • Open the file config.php and enter the MYSQL_PASSWD of the database user camera. Furthermore enter the REPLICATE_URL that fits to your project, e.g. from planet.openstreetmap.org or from download.openstreetmap.fr. Here are some examples:

    https://planet.openstreetmap.org/replication/minute/ http://download.openstreetmap.fr/replication/planet/minute/ http://download.openstreetmap.fr/replication/europe/minute/ http://download.openstreetmap.fr/replication/europe/netherlands/minute/

  • The update process is based on the sequence number comparison between the current state.txt file from the replication server, and the locally stored lastState.txt. So if you downloaded a osm.bz2 file, you should modify the sequenceNumber in the lastState.txt file accordingly.

  • Execute the file update_camera.sh to import all surveillance entries that have been added between the creation of the osm.bz2 file and today.

  1. Schedule automatic database updates
  • Add this line to your crontab:

    * * * * * /home/[user]/sunders/update_cameras/update_camera.sh > /dev/null 2>&1

  • Go to the directory ~/sunders/update_cameras/logs to check if your schedule works. After one minute there should be a new log file.

  • Go back to your crontab to change the schedule to the values you prefer, e.g. to 23 * * * * to run the update at every 23rd minute past every hour.

  1. Configure the website
  • Change to the directory /var/www/sunders/.

  • Rename the file config.php.example to config.php.

  • Open the file config.php and change the definitions of DEFAULT_ZOOM, DEFAULT_LAT, and DEFAULT_LON to set the initial focus of the map to the location you want.

Surveillance nodes

Surveillance under Surveillance uses data from Openstreetmap contributors that is not visualized on the regular Openstreetmap site. If you like to add new cameras or guards or if you like to revise existing entries use your existing OSM account or create a new one.

These are the most common key/value combinations to describe a surveillance node at Openstreetmap:

Mandatory to display an icon on the map

Icon Key Value
man_made surveillance
Public surveillance surveillance public
Outdoor surveillance surveillance outdoor
Indoor surveillance surveillance indoor
Fixed camera surveillance:type
camera:type
camera
fixed / panning
Dome camera surveillance:type
camera:type
camera
dome
Guard surveillance:type guard
Automatic Licence Plate Recognition surveillance:type ALPR

Mandatory to draw camera's field of view

Key Value
camera:direction 0 - 360 (in degrees) or
N / NE / E / SE / S / SW / W / NW
camera:angle 15 - 90 (in degrees)
from an almost horizontal view to a ground-pointed camera
default: 15°
height 3 - 12 (in meters)
default: 5m
Example 1 Example 2 Example 3
Field of view (direction: 90°, angle: 15°, height: 5m) Field of view (direction: 90°, angle: 15°, height: 10m) Field of view (direction: 90°, angle: 60°, height: 10m)
direction = 90°
angle = 15°
height = 5m
direction = 90°
angle = 15°
height = 10m
direction = 90°
angle = 60°
height = 10m

Optional

Key Value
surveillance:zone bank / building / parking / shop / town / traffic
camera:mount ceilling / pole / wall
operator organization or person operating the camera
name name of the camera
ref reference number of the camera
image link to an externally hosted image that depicts the surveillance object

Credits

  • Surveillance under Surveillance is based on the phantastic osmcamera [CC-BY-SA / MIT / GPLv3 / WTFPL] project of khris78.
  • Furthermore it uses the v0.7.7 code of Leaflet/Leaflet [BSD-2-Clause] and the v0.2.1 code of Leaflet/Leaflet.label [MIT].
  • The map itself is the work of millions of OpenStreetMap [CC BY-SA] contributors.
  • The eye, the chain, and the locks are icons of Font Awesome [SIL OFL 1.1 / MIT / CC BY 3.0].
  • The font Grabstein Grotesk [OLF] is used for the titles.

About

Surveillance under Surveillance

License:Other


Languages

Language:PHP 48.1%Language:JavaScript 24.3%Language:CSS 21.1%Language:Shell 6.5%