Skip to content
Sharon Fitzpatrick edited this page Jan 24, 2023 · 15 revisions

official_coastseg_logo

Table of Contents

Useful Links

What is CoastSeg?

Coastseg stands for Coastal Segmentation, it is an interactive jupyter notebook for downloading satellite imagery with CoastSat and applying image segmentation models to satellite imagery. CoastSeg provides an interactive interface for drawing Regions of Interest (ROIs) on a map, downloading satellite imagery, loading geojson files, extracting shorelines from satellite imagery, and more.

  • A mapping extension for CoastSat using Segmentation Zoo models.
  • An interactive interface to download satellite imagery using CoastSat from Google Earth Engine
  • An interactive interface for extracting shorelines from satellite imagery
  • An interactive interface to apply segmentation models to satellite imagery

gif of map with rectangles on it

CoastSeg is a web browser tool for framing satellite image data extraction problems

  • It is an interactive mapping extension for CoastSat using Segmentation Zoo models
  • CoastSeg facilitates satellite-derived shoreline mapping using CoastSat functionality, in a web-browser for greater interactivity and data visualization options, providing a web mapping interface to prepare data downloads, view data, analyze segmentation outputs, and subsequent analyses
  • CoastSeg also facilitates the application of Segmentation Zoo models for customized mapping of coastal landscapes, using deep learning based image segmentation on coastal satellite imagery

Highlights

  1. CoastSeg will interface with, and extend the functionality of, CoastSat and CoastSat.Slope by
    • facilitating deep learning based image segmentation on coastal satellite imagery, and
    • providing a web mapping interface to prepare data downloads, view data, analyze segmentation outputs, and subsequent analyses

The hope is to provide a standardized workflow that does not involve external processes such as a GIS or file browser, so analysis can be carried out on a cloud computer, among other potential advantages.

  1. CoastSeg will facilitate the application of Segmentation Zoo models for deep-learning-based image segmentation on geospatial imagery with a web mapping interface. Our hope is that the use of deep learning models would facilitate custom mapping of coastal features beyond the current scope of CoastSat.

  2. CoastSeg will eventually facilitate custom image segmentation and mapping, by helping implement models that you have trained using Segmentation Gym and Doodler models

Helpful Guides in the Wiki


How to use the Map

See https://github.com/SatelliteShorelines/CoastSeg/wiki/How-to-Use-the-Map

How to Use the Settings

See https://github.com/SatelliteShorelines/CoastSeg/wiki/Settings

What is an ROI (Region of Interest)?

See https://github.com/SatelliteShorelines/CoastSeg/wiki/What-is-an-ROI%3F

How to Extract Shorelines

See https://github.com/SatelliteShorelines/CoastSeg/wiki/How-to-Extract-Shorelines

How to Save and Load the Map State from Config Files

See https://github.com/SatelliteShorelines/CoastSeg/wiki/How-to-Use-Config-Files

How to Extract Transects Cross Distances for Extracted Shorelines

See https://github.com/SatelliteShorelines/CoastSeg/wiki/How-to-Calculate-Transect-Cross-Distance-for-Extracted-Shorelines

Quick Start

To get started with CoastSeg open this google colab which will open a jupyter notebook online. The notebook will walk you through connecting to Google Earth Engine, connecting to your google drive so you can save your downloaded images, and using the map dashboard to download satellite imagery.

Alternatively, if you want to get started on your local computer follow the installation instructions, activate the coastseg environment, then change to the CoastSeg directory cd coastseg. Run one of the following notebooks with jupyter lab to get started using coastseg.

Notebook to Download Satellite Imagery

jupyter lab SDS_coastsat_classifier.ipynb

Notebook to Run Image Segmentation Models

jupyter lab SDS_unet_classifier.ipynb

Installation Instructions

In order to use Coastseg you need to install Python packages in an environment. We recommend you use Anaconda to install the python packages in an environment for Coastseg. After you install Anaconda on your PC, open the Anaconda prompt or Terminal in Mac and Linux and use the cd command (change directory) to go the folder where you have downloaded the Coastseg repository.

  1. Create an Anaconda environment
  • This command creates an anaconda environment named coastseg and installs python 3.9 in it
  • You can also use python 3.10
  • We will install the CoastSeg package and its dependencies in this environment.
    conda create --name coastseg python=3.9 -y
  1. Activate your conda environment

    conda activate coastseg
  • If you have successfully activated coastseg you should see that your terminal's command line prompt should now start with (coastseg).

coastseg activated in anaconda prompt

  1. Install Conda Dependencies
    • CoastSeg requires jupyterlab and geopandas to function properly so they will be installed in the coastseg environment.
    • Geopandas has GDAL as a dependency so its best to install it with conda.
    • Make sure to install geopandas from the conda-forge channel to ensure you get the latest version.
    • Make sure to install both jupyterlab and geopandas from the conda forge channel to avoid dependency conflicts
      conda install -c conda-forge geopandas jupyterlab -y
  2. Install the CoastSeg from PyPi
    pip install coastseg

All the Installation Commands:

conda create --name coastseg python=3.9 -y
conda activate coastseg
conda install -c conda-forge jupyterlab geopandas -y
pip install coastseg

Having Installation Errors?

Use the command conda clean --all to clean old packages from your anaconda base environment. Ensure you are not in your coastseg environment or any other environment by running conda deactivate, to deactivate any environment you're in before running conda clean --all. It is recommended that you have Anaconda prompt (terminal for Mac and Linux) open as an administrator before you attempt to install coastseg again.

Conda Clean Steps

conda deactivate
conda clean --all

How to Use CoastSeg

  1. Sign up to use Google Earth Engine Python API

First, you need to request access to Google Earth Engine at https://signup.earthengine.google.com/. It takes about 1 day for Google to approve requests.

  1. Authenticate with earthengine Once your request has been approved, with the coastseg environment activated, run the following command on the Anaconda Prompt(or terminal) to link your environment to the GEE server:
earthengine authenticate

A web browser will open, login with a gmail account and accept the terms and conditions. Then copy the authorization code into the Anaconda terminal. In the latest version of the earthengine-api, the authentication is done with gcloud. If an error is raised about gcloud missing, go to https://cloud.google.com/sdk/docs/install and install gcloud. After you have installed it, close the Anaconda Prompt and restart it, then activate the environment before running earthengine authenticate again.

  1. Activate your conda environment

    conda activate coastseg
  • If you have successfully activated coastseg you should see that your terminal's command line prompt should now start with (coastseg).

coastseg activated in anaconda prompt

  1. Install the CoastSeg from PyPi
    cd <location you downloaded coastseg>
    ex: cd C:\1_repos\CoastSeg
  2. Launch Jupyter Lab
  • make you run this command in the coastseg directory so you can choose a notebook to use.
    jupyter lab

All the Installation Commands:

conda create --name coastseg python=3.9 -y
conda activate coastseg
conda install -c conda-forge jupyterlab geopandas -y
pip install coastseg

Now you are ready to start using CoastSeg!

Clone this wiki locally