Skip to main content

An interactive jupyter notebook for downloading satellite imagery

Project description

CoastSeg

image

image
image

Last Commit Maintenance Wiki GitHub Wiki

Python TensorFlow Keras

official_coastseg

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

  • Create ROIs(regions of interest) along the coast and automatically load shorelines on the map.
  • Use Google Earth Engine to automatically download satellite imagery for each ROI clicked on the map.

gif of map with extracted shorelines on it

  • Coastseg can automatically extract shorelines from downloaded satellite imagery.

Table of Contents

Useful Links

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.10 in it.
    conda create --name coastseg python=3.10 -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
    
  3. Uninstall the h5py installed by pip and reinstall with conda-forge
    pip install jsonschema==4.19.0  
    pip uninstall h5py -y
    conda install -c conda-forge h5py -y
    

How to Update

Update to a specific version

  • To update coastseg to a specific version specify the version after the ==

pip install coastseg==0.0.72.dev6

Update to the latest version

pip install coastseg --upgrade

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

Getting Started

  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. 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. Download CoastSeg from GitHub

Once you’ve created the coastseg environment you’ll need to run git clone the coastseg code onto your computer. Follow the guide How to Clone CoastSeg in the wiki for how to perform a git clone to download the coastseg code onto your computer.

  1. Launch Jupyter Lab
  • Run this command in the coastseg directory to launch the notebook SDS_coastsat_classifier
    jupyter lab SDS_coastsat_classifier.ipynb
    
  1. Use the SDS_coastsat_classifier to Download Imagery

Check out the wiki guide How to Download Imagery for comprehensive guides for how to use coastseg to download imagery and apply image segmentation models to the imagery you download.

Authors

Package maintainers:

Contributions:

Citations

Thank you to all the amazing research who contributed their transects to coastseg.

  1. Hawaii small islands https://pubs.usgs.gov/of/2011/1009/data.html
  2. Barter Island, Alaska https://www.sciencebase.gov/catalog/item/5fa1f10ad34e198cb793cee4
  3. Pacific Northwest, Gulf, and SE USA: Dr Sean Vitousek, USGS-PCMSC, based on DSAS transects
  4. Atlantic barrier islands: https://www.sciencebase.gov/catalog/item/5d5ece47e4b01d82ce961e36
  5. Mexico, New Zealand, Japan, Chile, Peru all from: https://zenodo.org/record/7758183#.ZCXZMcrMJPY
  6. Snyder, A.G., and Gibbs, A.E., 2019, National assessment of shoreline change: A GIS compilation of updated vector shorelines and associated shoreline change data for the north coast of Alaska, Icy Cape to Cape Prince of Wales: U.S. Geological Survey data release, https://doi.org/10.5066/P9H1S1PV.
  7. Gibbs, A.E., Ohman, K.A., Coppersmith, R., and Richmond, B.M., 2017, National Assessment of Shoreline Change: A GIS compilation of updated vector shorelines and associated shoreline change data for the north coast of Alaska, U.S. Canadian border to Icy Cape: U.S. Geological Survey data release, https://doi.org/10.5066/F72Z13N1.
  8. Himmelstoss, E.A., Kratzmann, M., Hapke, C., Thieler, E.R., and List, J., 2010, The National Assessment of Shoreline Change: A GIS Compilation of Vector Shorelines and Associated Shoreline Change Data for the New England and Mid-Atlantic Coasts: U.S. Geological Survey Open-File Report 2010-1119, available at https://pubs.usgs.gov/of/2010/1119/.
  9. Kilian Vos. (2023). Time-series of shoreline change along the Pacific Rim (v1.4) [Data set]. Zenodo. https://doi.org/10.5281/zenodo.7758183
  10. Vos, Kilian, Wen, Deng, Harley, Mitchell D., Turner, Ian L., & Splinter, Kristen D. (2022). Beach-face slope dataset for Australia (Version 2) [Data set]. Zenodo. https://doi.org/10.5281/zenodo.7272538

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

coastseg-1.0.0.tar.gz (78.8 MB view hashes)

Uploaded Source

Built Distribution

coastseg-1.0.0-py3-none-any.whl (15.0 MB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page