Package: coastseg-beta-package
CoastSegA mapping extension forCoastSatusingSegmentation Zoomodels.GUI interface to download satellite imagery using CoastSat from Google Earth EngineThis Project is Not Finished YetHi there! This package is still under active development. Feel free to contribute, but don't use this software expecting a finished product.Please note that we're in the planning stages only - please check back later. Please see ourWikifor further informationWe welcome collaboration! Please use ourDiscussions tabto provide feedback or offer help - thanks!AuthorsPackage maintainers:@dbuscombe-usgsMarda Science / USGS Pacific Coastal and Marine Science Center.@2320sharon: Lead Software DeveloperContributions:@ebgoldsteinInstallation InstructionsLooking to Contribute?See our contribution guide to see how to install coastseg for contributing:contribution guideCreate an environment with AnacondaIn order to use Coastseg you need to install Python packages in an environment. We recommend you useAnacondato install the python packages in an environment for Coastseg.After you install Anaconda on your PC, open the Anaconda prompt or Terminal in in Mac and Linux and use thecdcommand (change directory) to go the folder where you have downloaded the Coastseg repository.Create a new environment namedcoastsegwith all the required packages by entering these commands:Install Coastseg From PyPi(Highly Recommended)Create an Anaconda environmentWe will install the CoastSeg package and its dependencies in this environment.conda create --name coastseg python=3.9 -yActivate your conda environmentconda activate coastsegIf you have successfully activated coastseg you should see that your terminal's command line prompt should now start with(coastseg).Install geopandas with Condainstallpydensecrfbecause it is a dependency of doodleverse_utilsGeopandashasGDALas a dependency so its best to install it with conda.Make sure to install geopandas from theconda-forgechannel to ensure you get the latest version.Make sure to install both jupyter and geopandas from the conda forge channel to avoid dependency conflictsconda install -c conda-forge jupyter geopandas pydensecrf -yInstall the CoastSeg from PyPipip install coastseg-beta-packageAll the Installation Commands:condacreate--namecoastsegpython=3.9-ycondaactivatecoastsegcondainstall-cconda-forgejupytergeopandaspydensecrf-ypipinstallcoastseg-beta-packageInstall CoastSeg Locally (Without PyPi package)Clone the CoastSeg repo:git clone --depth 1https://github.com/2320sharon/CoastSeg.git--depth 1: means "give me only the present code, not the whole history of git commits" - this saves disk space, and timeCreate an Anaconda environmentWe will install the CoastSeg package and its dependencies in this environment.conda create --name coastseg python=3.9 -yActivate your conda environmentconda activate coastsegIf you have successfully activated coastseg you should see that your terminal's command line prompt should now start with(coastseg).Install geopandas with CondaGeopandashasGDALas a dependency so its best to install it with conda.Make sure to install geopandas from theconda-forgechannel to ensure you get the latest version.conda install -c conda-forge jupyter geopandas -yGit CloneInstall the coastseg pip package-e(editable install flag) install coastseg using thepyproject.tomllocated in coastseg's directory to install the coastseg package. Seepip documentation for -efor more information on how editable installations work.By making an editable install you won't need to install the coastseg files from pypi and will have all the files you need to develop with coastseg added to your python path. Using an editable install will avoid any import errors caused by not installing the package from pypi.pip install -e .Having Installation Errors?Use the commandconda clean --allto clean old packages from your anaconda base environment. Ensure you are not in your coastseg environment or any other environment by runningconda deactivate, to deactivate any environment you're in before runningconda clean --all. It is recommended that you have Anaconda prompt (terminal for Mac and Linux) open as an administrator before you attempt to installcoastsegagain.Conda Clean Stepsconda deactivate
conda clean --allHow to Use CoastsegHi there! This section is still under active development. So it may not be that helpful to you. If you have any suggestions of what you'd tutorials or guides you'd like submit an issue.@todo add screenshots and a full guide on how to use coastsegHow to Start CoastsegChange to the CoastSeg DirectoryIn your command prompt or terminal run thecd(change directory) command to the CoastSeg directorycd C:\Users\User1\CoastSegAfter you' ve installed coastseg's environment activate thecoastsegenvironment activate with:conda activate coastsegStart the Jupyter Notebookjupyter lab<notebook_name>.ipynb@ add screenshot and official notebookHow to Sign up to use Google Earth Engine Python APIFirst, you need to request access to Google Earth Engine athttps://signup.earthengine.google.com/. It takes about 1 day for Google to approve requests.Once your request has been approved, with thecoastsegenvironment activated, run the following command on the Anaconda Prompt 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 tohttps://cloud.google.com/sdk/docs/installand install gcloud. After you have installed it, close the Anaconda Prompt and restart it, then activate the environment before running earthengine authenticate again.Now you are ready to start using CoastSeg!Note: remember to always activate the environment with conda activate coastsat each time you are preparing to use the toolbox.Thanks @kvos for this awesome guide!How to Download ImageryAuthenticate with Google Earth Engine (GEE)@todo show screenshots of login processSelect your Download SettingsLoad Your Download Settings to CoastSegCreate the CoastSeg Dashbaord and MapDraw a bounding boxClick Generate ROIs buttonClick ROI's on the mapClick Download ROI's buttonOpendatafolder in CoastSeg Directory to View DownloadsDownloads are organized by ROI id and labeled with the date and time they were downloadedHow to Load Configs@todo add a screenshot of a sample configonly.geojsonfiles can be loaded as configsSave a config file withSave ConfigbuttonHow to Save Your Drawings to GeojsonHow to Extract ShorelinesHow to Extract Transects Cross Distances for Extracted ShorelinesContribution GuideThis guide walks you through how to contribute to the coastseg project. It will explain how to install development dependencies.Install the Codebasegit clone your fork of coastseg onto your local computergit clone https://github.com/your-username/CoastSeg.gitChange to the directory containing CoastSeg projectcd CoastSegTo push your changes to the CoastSeg later on add CoastSeg as an upstream repository:@todo replace with the official CoastSeg repogit remote add upstreamhttps://github.com/2320sharon/CoastSeg/CoastSeg.gitupstream: refers to the official CoastSeg repository hosted on GitHuborigin:refers to your personal fork on your computerInstall your package locally as a pip editable installationpip install -e .Create Development EnvironmentTo correctly create your development environment make sure you run all these commands within the directory where coastseg's source code is installed. The contents of the directory should be similar to the following:CoastSeg Directory Structurecoastseg has a source layoutâ”œâ”€â”€ CoastSeg
â”‚Â Â  â”œâ”€â”€ src
â”‚Â Â  |  |_ coastseg
â”‚Â Â  |  |  |_ __init__.py
â”‚Â Â  |  |  |_bbox.py
â”‚Â Â  |  |  |_roi.py
â”‚Â Â  |  |  |_shoreline.py
â”‚Â Â  |  |  |_transects.py
â”‚Â Â  |  |  |_coastseg_map.py
â”‚Â Â  |  |  |_common.py
â”‚Â Â  |  |  |_exceptions.py
â”‚Â Â  |  |  |_map_UI.py
â”‚Â Â  |  |  |_tkinter_window_creator.py
â”‚Â Â  |  |  |_UI_models.py
â”‚Â Â  |  |  |_zoo_model.py
â”‚Â Â  |  |  |_coastseg_logs.py
|
â”œâ”€â”€ docs
|   |_config.md
|   |_install.md
|
â”œâ”€â”€ tests
|   |_ test_data
|   | |_<data used to test coastseg>
|   |_ __init__.py
|   |   |_ conftest.py
|   |   |_ test_sniffer.py
|
|___data
|    |_ <data downloaded here>
|
â”œâ”€â”€ README.md
â”œâ”€â”€ .github
â””â”€â”€ .gitignore
â””â”€â”€ pyproject.tomlInstall The Development EnvironmentGo to the location where CoastSeg was installed on your computer.cd <directory where you have coastseg source code installed>Example:cd c:\users\CoastSegCreate an Anaconda environment specifically for developmentWe will make a unique development environment namedcoastseg_devwith python 3.9we wan this environment to be separate from the original coastseg environment because extra dependencies no in the original coastseg environment will be installed.conda create coastseg_dev python = 3.9Activate coastseg development environmentconda activate coastseg_devInstall Geopandas and Jupyter in this environmentMake sure to install jupyter and geopandas from the channelconda-forgeotherwise there might be compatibility issuesconda install -c conda-forge jupyter geopandas -yPip install coastseg's dependencies from the local version of coastseg on your computerpip install -e . -vMake sure to run this command in theCoastSegdirectory that contains thepyproject.tomlfile otherwise this command will fail because pip won't find thepyproject.tomlfile-emeans create an editable install of the package. This will add the files to the python path on your computer making it possible to find the sub directories of the package.See theofficial documentation.-vmeansverbose. This will cause pip to print more messages to the console.means use the current working directory to installmake sure you run this command in the directory containing thepyproect.tomlfile. Otherwise pip won't know which dependencies to installInstall development dependencies withinrequirements_dev.txtpip install -r requirements_dev.txt-r :this flag tells pip to install the dependencies from a requirements text file. See theofficial documentation.How to Submit An IssueSubmit a.txtfile containing your coastseg or coatseg_dev's dependenciesconda list -e > coastseg_deps.txt
or for your development environment
conda list -e > coastseg_dev_deps.txtWrite a detailed list of all the steps you took to cause your issueWrite your OS and web browserIf you made any changes to the source code make separate notebook to replicate the error your encounteredInclude any data files used to replicate the issueCreate a branchAdd CommitsSubmit a PR on Github