Giter Site home page Giter Site logo

12_bloom's Introduction

banner

What is Trawl Watch

Trawl Watch is an initiative launched by the * Bloom Association* to track and expose the most destructive fishing vessels. Inspired by L’Avion de Bernard, which monitors the movements of private jets, Trawl Watch aims to make visible the impact of these massive trawlers on our oceans. These vessels, often referred to as mégachalutiers, deploy gigantic nets that can engulf marine life from the surface down to the ocean floor. The consequences are both ecological—as they devastate crucial nursery and breeding areas for marine animals—and social, as they deprive artisanal fishermen of a healthy marine ecosystem. The solution proposed by Bloom is to dismantle these industrial fishing ships and redistribute their quotas to small-scale fishers. A petition has been launched, and Bloom continues to track these megatrawlers while awaiting action from European institutions.

Did you know that, in Europe, the largest fishing vessels, which represent 1% of the fleet, catch half of the fish? These factory-vessels can measure up to 144 meters in length and catch 400,000 kilos of fish per day! This is as much as 1,000 small-scale fishing vessels in one day at sea.

These veritable sea monsters are devastating Europe’s biodiversity and coastlines. It is important to measure the scale of the damage: about 20 of these factory-vessels can obliterate hundreds of thousands of marine animals and biodiversity treasures in one day, including in the so-called ‘Marine Protected Areas’ of French territorial waters, which are not protected at all.

What is Bloom Association

BLOOM is a non-profit organization founded in 2005 that works to preserve the marine environment and species from unnecessary destruction and to increase social benefits in the fishing sector. BLOOM wages awareness and advocacy campaigns in order to accelerate the adoption of concrete solutions for the ocean, humans and the climate. BLOOM carries out scientific research projects, independent studies and evaluations that highlight crucial and unaddressed issues such as the financing mechanisms of the fishing sector. BLOOM’s actions are meant for the general public as well as policy-makers and economic stakeholders.

Table of contents

Principles

#TODO

Requirements

Bloom is tested with:

Main version (dev) Stable version (1.0.0)
Python 3.8, 3.9, 3.10, 3.11 3.8, 3.9, 3.10, 3.11
Platform AMD64/ARM64(*) AMD64/ARM64(*)
Docker 24 24
PostgreSQL 14 14

Getting started

Clone the Bloom application repository

    git clone https://github.com/dataforgoodfr/12_bloom.git
    cd 12_bloom

Installation with Docker/Docker Compose stack (Recommended)

Prerequistes

  • Docker Engine (version >= 18.06.0) with Compose plugin

Building image

    docker compose build

When official Docker image will be available, the building step could be optionnal for user as docker compose up will pull official image from repository

Starting the application

    docker compose up

Load demonstration data

To use Trawl Watch application, some data have to be initialy loaded for demonstration. As these data are protected and can't be publicly published, you just have to contact the Trawl Watch application team. Informations on Who maintains Trawl Watch?

After having filled 12_bloom/data folder with data files get from project team, rename files as following:

  • data/chalutiers_pelagiques.csv
  • data/spire_positions_subset.csv
  • data/vessels_subset.csv
  • data/zones_subset.csv
  • data/ports.csv

Then launch docker compose stack using docker compose file extension to add loading data service

docker compose -f docker-compose.yaml -f docker-compose-load-data.yaml up

You can now jump to Use the Bloom Application

Installation on local machine

Prerequistes

  • Python: 3.9, 3.10, 3.11
  • Python-pip: >=20
  • Postgresql: 14, 15, 16

You must have a functionnal PostgreSQL instance with connexion informations (database server hostname or ip, user, password, database name, port to use)

Install with Poetry

    # Install poetry
    pip install --user "poetry==1.8.1"
    # Mise à disposition de l'exécutable de manière temporaire
    export PATH=$PATH:~/.local/bin/
    # Ensure that poetry will create a `.venv` directory into the project with the command
    poetry config virtualenvs.in-project true
    # Install dependencies from pyproject.toml
    poetry install
    # Make sure everything is all right using
    poetry env info
    # Enable virtual poetry project environment
    poetry shell

Initial configuration

    # Create initial ocnfiguration
    cp .env.template .env
    # Edit .env file
    # Replace POSTGRES_HOSTNAME/PORT with the postgres server hostname:port (localhost if local default port server)
    # Replace POSTGRES_USER/PASSWORD with already configured user on serverside
    # Check if database is up to date with alembic revisions
    alembic upgrade head
    # If upgrade is successful you can load the data
    # Demonstration data must be recovered from TrawlWatch Project Team
    # and put in <project>/data/ folder with correct names
    # * data/chalutiers_pelagiques.csv
    # * data/spire_positions_subset.csv
    # * data/vessels_subset.csv
    # * data/zones_subset.csv
    $ python3 src/bloom/tasks/load_dim_vessel_from_csv.py 
    $ python3 src/bloom/tasks/load_dim_port_from_csv.py
    $ python3 src/bloom/tasks/load_dim_zone_amp_from_csv.py
    $ python3 src/bloom/tasks/compute_port_geometry_buffer.py

Starting the application

    # Enable virtual poetry project environment
    poetry shell
    # Start streamlit application
    streamlit run src/Trawlwatcher.py

You can now jump to Use the Bloom Application

Database migration

Trawlwatch DB model has been refactored during DataForGood season 12. If you run a version of Trawlwactch using the old model follow next steps to upgrade.

  • Upgrade DB model:
$ alembic upgrade head
  • Run data conversion from the old model to the new model (actually copy data from spire_vessel_positions to spire_ais_data). This may take long if you have a long positions history:
$ python src/bloom/tasks/convert_spire_vessels_to_spire_ais_data.py
  • Load new references data (AMP zone, ports, vessels):
$ /venv/bin/python3 src/bloom/tasks/load_dim_vessel_from_csv.py 
$ /venv/bin/python3 src/bloom/tasks/load_dim_port_from_csv.py
$ /venv/bin/python3 src/bloom/tasks/load_dim_zone_amp_from_csv.py
$ /venv/bin/python3 src/bloom/tasks/compute_port_geometry_buffer.py
  • If you feel it, drop old tables:
DROP TABLE mpa_fr_with_mn;
DROP TABLE spire_vessel_positions;
DROP TABLE vessels;

Use the Bloom Application

Access Web Interface

After having succeed with With Docker/Docker Compose stack or On local machine installation and managed to Load demonstration data you should now access the Bloom application with you favorite web browser

  • Access to http://localhost:8501 Home
  • Navigate to "Vessel Exploration"
  • Enter MMSI 261084090 as example
  • Clic on "Load"
  • You can select voyage_id and view track of vessel Loaded

Official source code

You cna find official source code on Github Repository

Contributing

Want to help build Bloom Application Check out our contributing documentation.

Official Docker (container) images for Bloom Application are described in images.

Who uses Trawl Watch?

What goes into the next release?

#TODO

Can I use the Trawl Watch logo in my presentation?

#TODO

Links

#TODO

More information can be found there

  1. Database initialisation
  2. Development environment # outdated
  3. Architecture description
  4. Useful SQL examples

FAQ

#todo

12_bloom's People

Contributors

njouanin avatar ronanmorgan avatar saboniamine avatar sarahlunette avatar rv2931 avatar mnicolleutc avatar machbry avatar marioncoutarel avatar hehlinge42 avatar lucaszimmermann avatar wbarillon avatar guillaumegilles avatar erawpalassalg avatar n-toussaint avatar gaudinnicolas avatar romainm13 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.