Skip to content

Getting Started

CoastSeg works best on sand and gravel beaches. It is not as effective at other sites or a marsh beaches.

Prerequisites

1.Sign up to use Google Earth Engine Python API

  1. Follow the guide to setup Google Earth Engine: Sign up for Google Earth Engine for the First Time

  2. Follow the guide to enable Google earth Engine for your project : Check if Google Earth Engine API is Enabled

2. Install Git

  1. Install git on your computer following the guide here

3. Install CoastSeg in Anaconda

Follow one of the install guides under "Installation" to install CoastSeg.

Installation & SetUp

1.Activate the coastseg conda environment

  • Open anaconda prompt.
  • Make sure you have coastseg installed if not follow the installation guide : basic install guide
1
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

2.Download CoastSeg from GitHub

  • Before you run this step make you have install git on your computer a guide is linked here

  • Open 'git bash' (use this in the search bar on windows) and open the app.

  • Here is an example below where I have installed CoastSeg in a folder called 'projects', but you can install it wherever you'd like just make sure to remember the location.

  • After the download finishes close git bash.

1
2
3
mkdir projects
cd projects
git clone --depth 1 https://github.com/SatelliteShorelines/CoastSeg.git

git bash

Extract Shorelines

1.Launch Jupyter Lab

  • If you have never used jupyter notebook before please check out this guide: How to Use Jupyter Notebook

  • Open Anaconda prompt

  • Enter jupyter lab SDS_coastsat_classifier.ipynb in anaconda prompt and your notebook should automatically open in the browser

    1. PLEASE MAKE SURE YOU RUN THIS IN THE COASTSEG DIRECTORY WHERE THE NOTEBOOK SDS_coastsat_classifier.ipynb IS LOCATED
1
2
3
cd <location you installed Coastseg>
conda activate coastseg
jupyter lab SDS_coastsat_classifier.ipynb
  • If this doesn't work then try entering the full path to the notebook

-- If you notebook is at C:\projects\CoastSeg then you would enter the path C:\projects\CoastSeg\SDS_coastsat_classifier.ipynb

1
jupyter lab C:\projects\CoastSeg\SDS_coastsat_classifier.ipynb

jupyter notebbok open classifier

2.Authenticate with Google Earth Engine

  • Run the cell located under 'Authenticate with Google Earth Engine (GEE)'

run_cell

3.Run the Cell 'Create Coastseg Map Dashboard'

  • Run the cell to create the map dashboard

run map dashboard

  • After you run the cell you should see the UI appear

  • Scroll down to the interactive map

ran map dashboard

4.Draw an Bounding Box

  • Draw a bounding box along the coast in this box is where ROIs will be created.

  • You can only draw bounding boxes along the coast to generate ROIs this is because CoastSeg is only designed to extract shorelines.

Option 1: Draw a Bounding Box with the box tool

draw_bbox

Option 2: Draw a Bounding Box with the polygon tool

  • This is useful if you have back - barrier shorelines that you don't want to include

draw_bbox_polygon_remove_back_barrier

5.Generate ROI (Region of Interest)

  • ROIs can only be generated along a shoreline

  • If no shoreline is found then an error message will appear telling you no ROIs can be created. If this happens create your own reference shoreline following the guide here How to Create Reference Shoreline

generate_roi

6.Load Transects

  • Not all locations in the world have transects or shorelines available. Feel free to submit an issue to contribute transects or shorelines.

  • Make sure there are transects inside the ROI you have selected otherwise you won't be able to extract shorelines

  • If there isn't a reference shoreline or any transects available for your site check out the guide on how to upload your own here

load_rois_then_transects_on_map_demo

7.Modify the Settings

  • Change the satellites to L8 and L9

  • Change the dates to 12/01/2023 - 03/01/2024

  • Click Save Settings

save_settings_getting_started_circle

8.Name the Session

  • Name the session 'demo_session'. This will be the name of the folder saved in CoastSeg/sessions.

  • The folder will contain a subdirectory for each ROI from which shorelines were extracted.

  • Keeping sessions and downloaded data separate allows users to create multiple sessions from the same downloaded data, enabling experimentation with different settings.

save_demo_session

9.Preview the available Imagery

  • Preview the amount of available imagery for the selected ROI between the dates

  • In this example ROI 'cwm3' has 18 images available from LandSat 8 and 16 images available from LandSat 9 for the date range

case study 1 preview imagery

10. Download the ROIs

  • Click the ROIs you want to download on the map (they will turn blue when selected).

  • If no transects or reference shorelines are available for the region you have uploaded, follow the guide here.

  • NEVER rename your ROIs. This is because CoastSeg keeps track of the filename in the 'config.json' and you won't be able to load it into CoastSeg again if you do. The ROI's ID is the filename, so that information will be lost if you rename it.

  • The downloaded data can be found in CoastSeg/data under a folder with a name in the format ID_<ROI ID>_datetime<currenttime>. For example, you can see the JPGs for all the images you downloaded in CoastSeg/data/ID_<ROI ID>_datetime06-17-24__11_12_40/jpg_files/preprocessed/RGB. You can read more on how ROIs are structured in this guide

  • This is example of the RGB imagery from a downloaded ROI. Here you can see the user sorted some of the imagery into a bad folder so it would not be used to extract shorelines. A full tutorial on how to filter bad imagery is available here. coastseg/data/roi/

case_study_1_download_roi

11.Extract Shorelines save_settings_download_extract

  • Extracting shorelines involves loading the ROI data for each selected ROI from CoastSeg/data/<ROI ID> and processing the downloaded rasters to extract shorelines. The resulting files are saved in CoastSeg/sessions/<YOUR SESSION NAME>/ROI_ID_NAME for each ROI. Note that the downloaded data is NOT copied to the session; instead, the config.json file in each session keeps track of the location of the downloaded ROI in CoastSeg/data. You can read more about what is in each session in this guide.

  • Extracting shorelines works by finding the land water interface in the image and drawing a line along this boundary.

  • Additionally, a time series of shoreline positions along each transect is generated.

  • You can find images that show the extracted shoreline on each image in CoastSeg/sessions/<YOUR SESSION NAME>/ROI_ID_NAME/jpg_files/detection as illustrated below:

coastseg/sessions/session/roi/jpg_files/detection

shoreline_transect_intersection

Apply Tidal Correction to Extracted Shorelines (Optional)

1.Download the tide model

2.Load the Session with Extracted Shorelines

  • Re-open the jupyter notebook

  • Under the 'Kernel' menu Click 'restart and clear outputs of all cells'

restart kernel and clear outputs of all cells

  • Click 'Load Session' and load 'sample_session'

select load session and tide correct

3.Click Correct Tides

  • Click the ROI ID from the dropdown

    -- You should see some extracted shorelines on the map if you don't then the ROI ID won't appear in the dropdown

  • Enter Beach Slope

  • Enter Beach Elevation relative to Mean Sea Level

select roi id for tide correction

load_session_correct_tides_demo