Surveillance under Surveillance https://kamba4.crux.uberspace.de/

kamba4 2df4beffbd fix html error 4 years ago
home f78639d8d4 Fixed #4 6 years ago
www 2df4beffbd fix html error 4 years ago
.gitignore b4962b003b Alpha version of new statistics page. 7 years ago
LICENSE.md a33236500e Updated to Leaflet 1.3.1 and removed Leaflet.label plugin. 6 years ago
README.md 38e80fcb7d Update README.md 4 years ago

README.md

Surveillance under Surveillance

https://sunders.uber.space

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
Cameras Camera — no further information
Fixed cameras Fixed camera — usually observing a limited area
Panning cameras Panning camera — usually able to observe various areas
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
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

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/.

  2. Set up the database

    • 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

  3. 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.

  2. 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.

  3. 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. Furthermore you can set the DEFAULT_LANGUAGE.

  4. Check the website

    • Enter the URL of your Surveillance under Surveillance instance (e.g. https://myserver/sunders/) into your browser.

    • You should see a map with camera icons now.

  5. Optional: Add statistics table to your database

    • Go to the directory ~/sunders/init_cameras/db/.

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

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

    • Open the file ~/sunders/update_cameras/config.php. Change the value of USE_STATISTICS from false to true and enter the username of your GeoNames account at WEBSERVICE_USER.

    define('USE_STATISTICS', true);

    • Open the file /var/www/sunders/config.php and change the value of USE_STATISTICS from false to true.

    define('USE_STATISTICS', true);

    • Schedule automatic statistics updates by adding this new line to your crontab. Enter your preferred schedule values, e.g. 42 * * * * to run the update at every 42nd minute past every hour.

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

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
Camera surveillance:type camera
Fixed camera surveillance:type
camera:type
camera
fixed
Panning camera surveillance:type
camera:type
camera
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
surveillance:type camera
camera:type fixed
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
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 v1.3.1 code of Leaflet/Leaflet [BSD-2-Clause].
  • The map itself is the work of millions of OpenStreetMap [ODbL / CC BY-SA] contributors.
  • The results of the web services OpenStreetMap Nominatim [ODbL] and GeoNames [CC BY 3.0] are used for location searching and for surveillance node statistics.
  • The icons are from Font Awesome [SIL OFL 1.1 / MIT / CC BY 3.0].
  • The font Grabstein Grotesk [OLF] is used for the titles.