<commit_before><h3>Contribute</h3>

<h4>Bug Tracking and open tasks</h4>
Known tasks and bugs may be found <a href="https://github.com/OpenSeaMap/depth_webfrontend/issues/">here</a>.<br>
Reports for the web page can be reported there.
Errors that may come from the server parts are reported there as well.<br>
If you think your tracks were not processed correctly, create an issue as well stating the track id.

<h4>Binaries Backend Processing</h4>
The backend processing transforms the raw data OpenSeaMap receives into filter readable data points that may be shown on a map.
The latest binaries can be found here.
<ul>
	<li><a href="https://depth.openseamap.org:8443/jenkins/job/DepthBackProcessingMaster/lastSuccessfulBuild/artifact/.repository/net/sf/seesea/net.sf.seesea.postprocess.product/1.0.0-SNAPSHOT/net.sf.seesea.postprocess.product-1.0.0-SNAPSHOT-win32.win32.x86_64.zip">Windows x86_64</a></li>
	<li><a href="https://depth.openseamap.org:8443/jenkins/job/DepthBackProcessingMaster/lastSuccessfulBuild/artifact/.repository/net/sf/seesea/net.sf.seesea.postprocess.product/1.0.0-SNAPSHOT/net.sf.seesea.postprocess.product-1.0.0-SNAPSHOT-win32.win32.x86.zip">Windows x86_32</a></li>
	<li><a href="https://depth.openseamap.org:8443/jenkins/job/DepthBackProcessingMaster/lastSuccessfulBuild/artifact/.repository/net/sf/seesea/net.sf.seesea.postprocess.product/1.0.0-SNAPSHOT/net.sf.seesea.postprocess.product-1.0.0-SNAPSHOT-linux.gtk.x86_64.zip">Linux x86_64</a></li>
	<li><a href="https://depth.openseamap.org:8443/jenkins/job/DepthBackProcessingMaster/lastSuccessfulBuild/artifact/.repository/net/sf/seesea/net.sf.seesea.postprocess.product/1.0.0-SNAPSHOT/net.sf.seesea.postprocess.product-1.0.0-SNAPSHOT-linux.gtk.x86.zip">Linux x86_32</a></li>
	<li><a href="https://depth.openseamap.org:8443/jenkins/job/DepthBackProcessingMaster/lastSuccessfulBuild/artifact/.repository/net/sf/seesea/net.sf.seesea.postprocess.product/1.0.0-SNAPSHOT/net.sf.seesea.postprocess.product-1.0.0-SNAPSHOT-macosx.cocoa.x86_64.zip">MacOSX</a></li>
</ul>

<h5>Postgres Database Setup</h5>
In order to process the raw data you need to create two <a href="https://www.postgresql.org/download/">postgres</a> databases with <a href="http://postgis.net/install/">postgis</a> enabled.
Any postgres version above 9.0 should fit the purpose. Postgis version should be 2.0 or higher.
<h6>Linux</h6>
Execute the following commands as postgres super user (required in order to create the postgis extension)
<pre>psql -d postgres -c "CREATE USER osm WITH LOGIN NOSUPERUSER INHERIT NOCREATEDB NOCREATEROLE NOREPLICATION PASSWORD = '<PASSWORD>';"
psql -d postgres -c "CREATE DATABASE osmapi WITH OWNER = osm ENCODING = 'UTF8';
psql -d postgres -c "CREATE DATABASE depth WITH OWNER = osm ENCODING = 'UTF8';
psql -d osmapi -c "CREATE EXTENSION postgis;"
psql -d depth -c "CREATE EXTENSION postgis;"</pre>
A script <pre>postgres.sql</pre> that creates the two databases resides in the root folder of the application.

<h6>Windows</h6>
Download and install <a href="https://www.pgadmin.org/download/">PGAdmin</a>. Login as superuser.
<img src="images/NewUser.png">Create user osm with password changeme. Enable login rights in the dialog.</img>
<img src="images/CreateDatabase.png">Create a new database owned by user osm</img>
<img src="images/CreateDatabaseOSMAPI.png">Create two database osmapi and depth</img>
<img src="images/CreateExtension.png">Create postgis extension for each database</img>

<ul>
	<li>Optional: For gauge update processing (not requried by default) you need a complete opensteetmap database. Instructions how to setup such a database can be found <a href="http://wiki.openstreetmap.org/wiki/Setting_up_a_local_copy_of_the_OpenStreetMap_database,_kept_up_to_date_with_minutely_diffs">here</a></li>
</ul>

<h5>Configuration</h5>
The backend processing is built on a highly modular component architecture that is based on OSGi and configured through OSGi.
Each of the <a href=#documentation>documented</a> steps can be enabled or disabled.
Consult each of the configuration files for detailed options. Delete or rename a configuration file if you want to disable a particular system component.

<h6>Data Retrieval</h6>
There are two ways the retrieve the raw data (currently ~150GB).
<ul>
	<li>Download the the data through bittorrent</li>
	<li>Become a contributor by request and download the data directly</li>
</ul>
<a href="https://depth.openseamap.org/torrents.zip">Download</a> the latest torrent zip file and unzip it.
Add all contained torrents to your favorite bittorrent client and please keep sharing for others since our bandwith is very limited.<br>

To configure downloading files through the official API configure the file <pre>net.sf.seesea.data.sync.HttpDepthDataSync.cfg</pre>
<pre>user=youruser
password=<PASSWORD>
checkSSLCertificate=false
apiURL=https://depth.openseamap.org:8443/org.osm.depth.upload/api2/track
storageLocation=data
trackRange=1000,2000
</pre>

You must provide your API username and password that you use for
the website depth.openseamap.org. Initially the sync is configured to download track file id from 1000 to 2000 to limit bandwidth impact.<commit_msg>B: Fix images<commit_after><h3>Contribute</h3>

<h4>Bug Tracking and open tasks</h4>
Known tasks and bugs may be found <a href="https://github.com/OpenSeaMap/depth_webfrontend/issues/">here</a>.<br>
Reports for the web page can be reported there.
Errors that may come from the server parts are reported there as well.<br>
If you think your tracks were not processed correctly, create an issue as well stating the track id.

<h4>Binaries Backend Processing</h4>
The backend processing transforms the raw data OpenSeaMap receives into filter readable data points that may be shown on a map.
The latest binaries can be found here.
<ul>
	<li><a href="https://depth.openseamap.org:8443/jenkins/job/DepthBackProcessingMaster/lastSuccessfulBuild/artifact/.repository/net/sf/seesea/net.sf.seesea.postprocess.product/1.0.0-SNAPSHOT/net.sf.seesea.postprocess.product-1.0.0-SNAPSHOT-win32.win32.x86_64.zip">Windows x86_64</a></li>
	<li><a href="https://depth.openseamap.org:8443/jenkins/job/DepthBackProcessingMaster/lastSuccessfulBuild/artifact/.repository/net/sf/seesea/net.sf.seesea.postprocess.product/1.0.0-SNAPSHOT/net.sf.seesea.postprocess.product-1.0.0-SNAPSHOT-win32.win32.x86.zip">Windows x86_32</a></li>
	<li><a href="https://depth.openseamap.org:8443/jenkins/job/DepthBackProcessingMaster/lastSuccessfulBuild/artifact/.repository/net/sf/seesea/net.sf.seesea.postprocess.product/1.0.0-SNAPSHOT/net.sf.seesea.postprocess.product-1.0.0-SNAPSHOT-linux.gtk.x86_64.zip">Linux x86_64</a></li>
	<li><a href="https://depth.openseamap.org:8443/jenkins/job/DepthBackProcessingMaster/lastSuccessfulBuild/artifact/.repository/net/sf/seesea/net.sf.seesea.postprocess.product/1.0.0-SNAPSHOT/net.sf.seesea.postprocess.product-1.0.0-SNAPSHOT-linux.gtk.x86.zip">Linux x86_32</a></li>
	<li><a href="https://depth.openseamap.org:8443/jenkins/job/DepthBackProcessingMaster/lastSuccessfulBuild/artifact/.repository/net/sf/seesea/net.sf.seesea.postprocess.product/1.0.0-SNAPSHOT/net.sf.seesea.postprocess.product-1.0.0-SNAPSHOT-macosx.cocoa.x86_64.zip">MacOSX</a></li>
</ul>

<h5>Postgres Database Setup</h5>
In order to process the raw data you need to create two <a href="https://www.postgresql.org/download/">postgres</a> databases with <a href="http://postgis.net/install/">postgis</a> enabled.
Any postgres version above 9.0 should fit the purpose. Postgis version should be 2.0 or higher.
<h6>Linux</h6>
Execute the following commands as postgres super user (required in order to create the postgis extension)
<pre>psql -d postgres -c "CREATE USER osm WITH LOGIN NOSUPERUSER INHERIT NOCREATEDB NOCREATEROLE NOREPLICATION PASSWORD = '<PASSWORD>';"
psql -d postgres -c "CREATE DATABASE osmapi WITH OWNER = osm ENCODING = 'UTF8';
psql -d postgres -c "CREATE DATABASE depth WITH OWNER = osm ENCODING = 'UTF8';
psql -d osmapi -c "CREATE EXTENSION postgis;"
psql -d depth -c "CREATE EXTENSION postgis;"</pre>
A script <pre>postgres.sql</pre> that creates the two databases resides in the root folder of the application.

<h6>Windows</h6>
Download and install <a href="https://www.pgadmin.org/download/">PGAdmin</a>. Login as superuser.
Create user osm with password <PASSWORD>me. Enable login rights in the dialog.
<img src="images/NewUser.png"/><br/>
Create a new database owned by user osm
<img src="images/CreateDatabase.png"/><br/>
Create two database osmapi and depth
<img src="images/CreateDatabaseOSMAPI.png"/><br/>
Create postgis extension for each database
<img src="images/CreateExtension.png"/><br/>

<ul>
	<li>Optional: For gauge update processing (not requried by default) you need a complete opensteetmap database. Instructions how to setup such a database can be found <a href="http://wiki.openstreetmap.org/wiki/Setting_up_a_local_copy_of_the_OpenStreetMap_database,_kept_up_to_date_with_minutely_diffs">here</a></li>
</ul>

<h5>Configuration</h5>
The backend processing is built on a highly modular component architecture that is based on OSGi and configured through OSGi.
Each of the <a href=#documentation>documented</a> steps can be enabled or disabled.
Consult each of the configuration files for detailed options. Delete or rename a configuration file if you want to disable a particular system component.

<h6>Data Retrieval</h6>
There are two ways the retrieve the raw data (currently ~150GB).
<ul>
	<li>Download the the data through bittorrent</li>
	<li>Become a contributor by request and download the data directly</li>
</ul>
<a href="https://depth.openseamap.org/torrents.zip">Download</a> the latest torrent zip file and unzip it.
Add all contained torrents to your favorite bittorrent client and please keep sharing for others since our bandwith is very limited.<br>

To configure downloading files through the official API configure the file <pre>net.sf.seesea.data.sync.HttpDepthDataSync.cfg</pre>
<pre>user=youruser
password=<PASSWORD>
checkSSLCertificate=false
apiURL=https://depth.openseamap.org:8443/org.osm.depth.upload/api2/track
storageLocation=data
trackRange=1000,2000
</pre>

You must provide your API username and password that you use for
the website depth.openseamap.org. Initially the sync is configured to download track file id from 1000 to 2000 to limit bandwidth impact.
{'fraction_non_alphanumeric': 0.11484405082787832, 'fraction_numerical': 0.026184058529072005, 'mean_word_length': 5.369711833231147, 'pattern_counts': {'":': 0, '<': 170, '<?xml version=': 0, '>': 170, 'https://': 20, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 16, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '811915', 'n_tokens_mistral': 3619, 'n_tokens_neox': 3422, 'n_words': 947}