Skip to content

Case Study 2 A Difficult Location in Alaska

For this case study we will select an difficult site located outside of Unalakleet Alaska. This site has a simple shoreline,lots of cloud cover, and not imagery available due to ice and clouds covering the region most of the year making it a difficult test site.

unakleet_site

Prerequisites

  1. Before you begin make sure you have a GEE account if not follow the guide in How to Authenticate with Google Earth Engine(GEE)

  2. Have installed CoastSeg by following the Installation Guide

SetUp

1.Activate the coastseg conda environment

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

  • Only do this step if you haven't already cloned CoastSeg to your computer
1
git clone --depth 1 https://github.com/SatelliteShorelines/CoastSeg.git

3.Change to the CoastSeg Directory

  • Open a command prompt like anaconda prompt and go the location you installed CoastSeg
1
cd coastseg

Launch the Notebook

1.Launch Jupyter Lab

  • Run this command in the coastseg directory to launch the notebook SDS_coastsat_classifier
1
2
conda activate coastseg
jupyter lab SDS_coastsat_classifier.ipynb

2.Authenticate with Google Earth Engine

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

auth_cell_cropped

3.Draw an Bounding Box

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

  • 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

case_study_2_bbox_for_ak

4.Create and Load a Reference Shoreline

  • This site does not have a shoreline available so we will have to make our own. Follow the tutorial at How to Create Reference Shoreline for a guide on how to create your own reference shoreline

  • Here is a guide on how to upload your own here

  • I used geojson.io to create my reference shoreline

5.Create and Load Transects

  • This site does not have any transects available so we will have to make our own. Follow the tutorial at How to Create Reference Shoreline for a guide on how to create your own transects

  • Here is a guide on how to upload your own here transects

  • I used geojson.io to create my transects.This technique is in the tutorial How to Create Reference Shoreline

case_study_2_shoreline_transects_upload

6.Modify the Settings

  • Change the satellites to L8 and L9

  • Change the dates to 04/01/2023 - 011/01/2024

  • Change the months to not select November since our site will be covered in sea ice

  • The reason we choose these dates is because its less likely the ocean will be covered in ice. Shoreline extraction does not work properly with sea ice present

  • Change the max bad pixel percentage to 50.0% -- This is the maximum percentage of pixels that can be covered in either cloud or no data pixels if a downloaded image exceeds this limit it will be deleted

  • Change the cloud threshold to 50% -- This is the maximum percentage of pixels that can be covered in cloud if a downloaded image exceeds this limit it will be deleted

  • Change the size of the reference shoreline buffer to 290 meters

-- In the image below you can see the reference shoreline buffer in purple for this location. The reference shoreline buffer is the region in which a shoreline can be extracted. If its too small then the shoreline might not be found and if its too big then clouds in the reference shoreline buffer might get misidentified as shoreline.

case_study_1_extracted_shoreline_rel_sl_buffer

  • Turn off the Apply Cloud Mask

-- The cloud mask being off does not impact whether images are filtered out during the download process it only controls if the clouds are blotted off the images.

-- The reason for this is that Alaska is very cloudy and often light clouds will be masked out close to the shoreline causing gaps in the shoreline due to the cloud distance threshold. If we don't mask out the clouds then we get a few more usable images

-- In this example you can see the clouds where masked out in this image but these clouds were onshore so they would not have interfered with the cloud masking. However, the cloud masking was turned on and the 'cloud distance' parameter which removes any shorelines within 'cloud distance' to a cloud causes there to be gaps in the shoreline. You could lower cloud distance to something like 10-20m to fix this or turn off cloud masking

case_study_2_why_cloud_mask_off

  • Click Save Settings

case_study_2_save_settings

7.Name the Session

  • Let's call this 'case_study_2'

  • This is the name of the folder that will be saved in CoastSeg/sessions

case_study_2_session

8.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 12/01/2023 - 03/01/2024

case study 1 preview imagery

9.Add a Shoreline Extraction Area

  • Our study site has a small pond located along the shoreline that will get picked up in the reference shoreline buffer and the pond's water land interface will get misidentified as a shoreline

To get around this issue we have 2 options:

1.Shrink the reference shoreline buffer

-- This would probably be the best solution for this specific, but if you have a dynamic coastline this may not be the best solution for you

2.Add a shoreline extraction area

Example of Bad Shoreline

  • In this image below you can see the pond's water land interface gets misidentified as part of the shoreline

case_study_2_why_shoreline_extraction_area_needed_pond

How to Draw a Shoreline Extraction Area

  • Draw a shoreline extraction area that does not include the pond

case_study_2_shoreline_extraction_area

Example of Good Shoreline from New Shoreline Extraction Area

  • Here is what the shoreline detection image will look like with this new shoreline extraction area

case_study_2_good_shoreline_extraction_area

10.Download the ROI

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

  • Because we set the cloud threshold to 60% and the percent of bad pixels to 66% you can see that several downloads were skipped because they exceeded the limits

  • When the download finishes CoastSeg will print the location where the downloads were saved in this case its 'pgj2''CoastSeg\data\ID_pgj2_datetime04-22-24__09_38_49'

case_study_2_gen_and_download_roi

11.Sort the Downloaded Imagery

  • Open Coastseg/data and open the folder containing the ROI ID, in my case thats 'pgj2', so I opened 'CoastSeg\data\ID_pgj2_datetime04-22-24__09_38_49'

  • You can see the ROI ID in the hover menu located to the top right of the map

  • Read this quick guide on how to filter bad imagery in CoastSeg.

Sort out Images with Sea Ice

  • Sort any bad images into the 'bad folder'

  • Sort out images with snow, sea ice, or cloud cover

Images Sample Image
case_study_2_sea_ice_bad_sort case_study_2_sea_ice_example
Filter out images with sea ice and snow
case_study_2_sample_cloud_imgs case_study_2_bad_cloud
Filter out images with clouds

Why is Sea Ice Bad for Extracting Shorelines?

  • Sea Ice forms offshore and changes where the land water interface is meaning that the reference shoreline no longer covers the region where the shoreline can be extracted

case_study_2_sea_ice_detection_bad_example

Why is Snow Bad for Extracting Shorelines?

  • Snow will get misclassified as either whitewater or water sometimes making shoreline extraction variable.

  • In this example the snow was mis classified as whitewater

case_study_2_snow_detection_shoreline_

Why are Clouds Bad for Extracting Shorelines?

  • Clouds get misclassified as shorelines as you can see in the example below

  • Clouds getting misclassified as shorelines is the reason behind why we typically mask out clouds

Bad Shoreline Detection Due to Clouds
case_study_2_clouds_bad_detection
case_study_2_bad_clouds1
case_study_2_bad_clouds2

12.Extract Shorelines

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

  • A time series of shoreline position along each transect is generated as well

shoreline_transect_intersection

case_study_2_extract_shorelines

13. Examine Detection Images for Extracted Shorelines

  • The detection images for the extracted shorelines is at 'CoastSeg\sessions\case_study_2\

  • In these images you can see how well the shoreline were extracted depending on cloud cover, the size of the reference shoreline buffer and the rest of the extract shoreline settings

  • There are a few images with some bad shorelines. Lets remove those in step 13

case_study_2_shoreline_detection_folder

14. Remove Outlier/Bad Extracted Shorelines

  • Use the Load Extracted Shoreline feature to view all the extracted shorelines on the map

  • Find any bad shorelines and click the trash icon to put that shoreline in the trash

  • Once you've put all the bad shorelines in the trash click the empty trash button and this will delete all those shorelines from all the files in the session directory.

case_study_2_remove_outllier_shorelines

15. Adjust the Settings to Extract Better shorelines

  • For difficult sites such as Alaska you'll need to create a few sessions with different combinations of settings in order to extract the best shorelines

  • For this example I had to create 4 sessions to find the best combination of settings. For this reason we HIGHLY recommed you create a small session first (1-2 years worth of imagery) and optimize the settings first before running a large session.

  • One trick we recommended is to download your entire dataset first, then adjust the date range to a year when you extract your shorelines. This will cause CoastSeg to only extract shorelines from the date range you set in the settings rather than the entire range of dates you downloaded.

16. Open the Extracted Shoreline Session Outputs in QGIS

Config_gdf.geojson

  • This screenshot show the contents of the config_gdf.geojson file in QGIS, you can see the ROI, the transects and the reference shoreline on the map

case_study_2_config_gdf

extracted_shorelines_points.geojson & extracted_shorelines_lines.geojson

  • This screenshot show the contents of the extracted_shorelines_points.geojson & extracted_shorelines_lines.geojson files in QGIS

  • These files contain the 2D shoreline vectors extracted directly from the satellite imagery. These are NOT the shoreline positions along the transects. The shoreline position along the transect is located in the timeseries files eg. raw_transect_time_series_points.geojson,raw_transect_time_series.csv, raw_transect_time_series_vectors.geojson, raw_transect_time_series_merged.csv

Zoomed Out 2D Extracted Shorelines as Points and Lines

case_study_2_extracted_shorelines_points

Zoomed In 2D Extracted Shorelines as Points and Lines

case_study_2_extracted_shorelines_points_zoomed_in

raw_transect_time_series_points.geojson & raw_transect_time_series_vectors.geojson

  • These files contain the shoreline positions along the transects. This is the geojson format of the 'raw_transect_time_series_merged.csv' and 'raw_transect_time_series.csv'

case_study_2_timeseries_extracted_shorelines_points

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 'case_study_2'

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

case_study_1_tide_correction

Example

case_study_2_correct_tides

4.View the Tidally Corrected TimeSeries in QGIS

4 new files will be generated:

1.'tidally_corrected_transect_time_series.csv'

2.'tidally_corrected_transect_time_series_merged.csv'

3.'tidally_corrected_transect_time_series_points.geojson'

4.'tidally_corrected_transect_time_series_vectors.geojson'

  • This screenshot show the difference between the tidally_corrected_transect_time_series_vectors and raw_transect_time_series_vectors as you can see applying tidal correction shifts the raw shoreline position along the transect to account for the tide position

case_study_2_raw_and_tide_corrected_timeseries_qgis