Surveillance under Surveillance https://kamba4.crux.uberspace.de/
kamba4 2df4beffbd fix html error | před 4 roky | |
---|---|---|
home | před 6 roky | |
www | před 4 roky | |
.gitignore | před 7 roky | |
LICENSE.md | před 6 roky | |
README.md | před 4 roky |
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.
If you like to run Surveillance under Surveillance on your own LAMP or LNMP server follow these steps:
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/.
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
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
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.
Schedule automatic database updates
* * * * * /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.
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.
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.
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
define('USE_STATISTICS', true);
define('USE_STATISTICS', true);
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 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:
Icon | Key | Value |
---|---|---|
man_made |
surveillance |
|
surveillance |
public |
|
surveillance |
outdoor |
|
surveillance |
indoor |
|
surveillance:type |
camera |
|
surveillance:type camera:type |
camera fixed |
|
surveillance:type camera:type |
camera panning |
|
surveillance:type camera:type |
camera dome |
|
surveillance:type |
guard |
|
surveillance:type |
ALPR |
Key | Value |
---|---|
surveillance:type |
camera |
camera:type |
fixed |
camera:direction |
0 - 360 (in degrees) orN / 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 |
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 |