coastseg 0.0.72.dev6__tar.gz → 0.0.72.dev8__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {coastseg-0.0.72.dev6/src/coastseg.egg-info → coastseg-0.0.72.dev8}/PKG-INFO +32 -15
- {coastseg-0.0.72.dev6 → coastseg-0.0.72.dev8}/README.md +31 -14
- {coastseg-0.0.72.dev6 → coastseg-0.0.72.dev8}/pyproject.toml +1 -1
- {coastseg-0.0.72.dev6 → coastseg-0.0.72.dev8}/src/coastseg/coastseg_map.py +147 -38
- {coastseg-0.0.72.dev6 → coastseg-0.0.72.dev8}/src/coastseg/common.py +122 -66
- {coastseg-0.0.72.dev6 → coastseg-0.0.72.dev8}/src/coastseg/extracted_shoreline.py +76 -28
- {coastseg-0.0.72.dev6 → coastseg-0.0.72.dev8}/src/coastseg/factory.py +9 -10
- {coastseg-0.0.72.dev6 → coastseg-0.0.72.dev8}/src/coastseg/map_UI.py +39 -3
- {coastseg-0.0.72.dev6 → coastseg-0.0.72.dev8}/src/coastseg/roi.py +41 -9
- {coastseg-0.0.72.dev6 → coastseg-0.0.72.dev8}/src/coastseg/settings_UI.py +22 -15
- {coastseg-0.0.72.dev6 → coastseg-0.0.72.dev8}/src/coastseg/shoreline.py +132 -56
- {coastseg-0.0.72.dev6 → coastseg-0.0.72.dev8}/src/coastseg/zoo_model.py +0 -3
- {coastseg-0.0.72.dev6 → coastseg-0.0.72.dev8/src/coastseg.egg-info}/PKG-INFO +32 -15
- {coastseg-0.0.72.dev6 → coastseg-0.0.72.dev8}/LICENSE +0 -0
- {coastseg-0.0.72.dev6 → coastseg-0.0.72.dev8}/MANIFEST.in +0 -0
- {coastseg-0.0.72.dev6 → coastseg-0.0.72.dev8}/docs/config.md +0 -0
- {coastseg-0.0.72.dev6 → coastseg-0.0.72.dev8}/docs/extract_shorelines.md +0 -0
- {coastseg-0.0.72.dev6 → coastseg-0.0.72.dev8}/docs/gifs/change_layer_demo.gif +0 -0
- {coastseg-0.0.72.dev6 → coastseg-0.0.72.dev8}/docs/gifs/colab_demo.gif +0 -0
- {coastseg-0.0.72.dev6 → coastseg-0.0.72.dev8}/docs/gifs/colab_downloads_location.gif +0 -0
- {coastseg-0.0.72.dev6 → coastseg-0.0.72.dev8}/docs/gifs/create_rois_demo.gif +0 -0
- {coastseg-0.0.72.dev6 → coastseg-0.0.72.dev8}/docs/gifs/extract_shorelines_and_transects.gif +0 -0
- {coastseg-0.0.72.dev6 → coastseg-0.0.72.dev8}/docs/gifs/gee_auth_tutorial.gif +0 -0
- {coastseg-0.0.72.dev6 → coastseg-0.0.72.dev8}/docs/gifs/generate_rois_and_display_area.gif +0 -0
- {coastseg-0.0.72.dev6 → coastseg-0.0.72.dev8}/docs/gifs/load_config_demo.gif +0 -0
- {coastseg-0.0.72.dev6 → coastseg-0.0.72.dev8}/docs/gifs/load_geojson_demo.gif +0 -0
- {coastseg-0.0.72.dev6 → coastseg-0.0.72.dev8}/docs/gifs/load_geojson_files_demo.gif +0 -0
- {coastseg-0.0.72.dev6 → coastseg-0.0.72.dev8}/docs/gifs/load_shoreline_transect_demo.gif +0 -0
- {coastseg-0.0.72.dev6 → coastseg-0.0.72.dev8}/docs/gifs/settings_demo.gif +0 -0
- {coastseg-0.0.72.dev6 → coastseg-0.0.72.dev8}/docs/map_guide.md +0 -0
- {coastseg-0.0.72.dev6 → coastseg-0.0.72.dev8}/docs/models.md +0 -0
- {coastseg-0.0.72.dev6 → coastseg-0.0.72.dev8}/docs/roi.md +0 -0
- {coastseg-0.0.72.dev6 → coastseg-0.0.72.dev8}/docs/settings.md +0 -0
- {coastseg-0.0.72.dev6 → coastseg-0.0.72.dev8}/docs/transect_time_series.md +0 -0
- {coastseg-0.0.72.dev6 → coastseg-0.0.72.dev8}/setup.cfg +0 -0
- {coastseg-0.0.72.dev6 → coastseg-0.0.72.dev8}/setup.py +0 -0
- {coastseg-0.0.72.dev6 → coastseg-0.0.72.dev8}/src/coastseg/__init__.py +0 -0
- {coastseg-0.0.72.dev6 → coastseg-0.0.72.dev8}/src/coastseg/bbox.py +0 -0
- {coastseg-0.0.72.dev6 → coastseg-0.0.72.dev8}/src/coastseg/bounding_boxes/shorelines_bounding_boxes.csv +0 -0
- {coastseg-0.0.72.dev6 → coastseg-0.0.72.dev8}/src/coastseg/bounding_boxes/transects_bounding_boxes.csv +0 -0
- {coastseg-0.0.72.dev6 → coastseg-0.0.72.dev8}/src/coastseg/bounding_boxes/usa_shorelines_bounding_boxes.csv +0 -0
- {coastseg-0.0.72.dev6 → coastseg-0.0.72.dev8}/src/coastseg/bounding_boxes/usa_shorelines_bounding_boxes.geojson +0 -0
- {coastseg-0.0.72.dev6 → coastseg-0.0.72.dev8}/src/coastseg/bounding_boxes/world_reference_shorelines_bboxes.geojson +0 -0
- {coastseg-0.0.72.dev6 → coastseg-0.0.72.dev8}/src/coastseg/bounding_boxes/world_shorelines_bounding_boxes.csv +0 -0
- {coastseg-0.0.72.dev6 → coastseg-0.0.72.dev8}/src/coastseg/coastseg_logs.py +0 -0
- {coastseg-0.0.72.dev6 → coastseg-0.0.72.dev8}/src/coastseg/downloads.py +0 -0
- {coastseg-0.0.72.dev6 → coastseg-0.0.72.dev8}/src/coastseg/exception_handler.py +0 -0
- {coastseg-0.0.72.dev6 → coastseg-0.0.72.dev8}/src/coastseg/exceptions.py +0 -0
- {coastseg-0.0.72.dev6 → coastseg-0.0.72.dev8}/src/coastseg/geodata_processing.py +0 -0
- {coastseg-0.0.72.dev6 → coastseg-0.0.72.dev8}/src/coastseg/models_UI.py +0 -0
- {coastseg-0.0.72.dev6 → coastseg-0.0.72.dev8}/src/coastseg/observable.py +0 -0
- {coastseg-0.0.72.dev6 → coastseg-0.0.72.dev8}/src/coastseg/sessions.py +0 -0
- {coastseg-0.0.72.dev6 → coastseg-0.0.72.dev8}/src/coastseg/transects/Transects_grid_region_0.geojson +0 -0
- {coastseg-0.0.72.dev6 → coastseg-0.0.72.dev8}/src/coastseg/transects/Transects_grid_region_100.geojson +0 -0
- {coastseg-0.0.72.dev6 → coastseg-0.0.72.dev8}/src/coastseg/transects/Transects_grid_region_102.geojson +0 -0
- {coastseg-0.0.72.dev6 → coastseg-0.0.72.dev8}/src/coastseg/transects/Transects_grid_region_103.geojson +0 -0
- {coastseg-0.0.72.dev6 → coastseg-0.0.72.dev8}/src/coastseg/transects/Transects_grid_region_106.geojson +0 -0
- {coastseg-0.0.72.dev6 → coastseg-0.0.72.dev8}/src/coastseg/transects/Transects_grid_region_109.geojson +0 -0
- {coastseg-0.0.72.dev6 → coastseg-0.0.72.dev8}/src/coastseg/transects/Transects_grid_region_110.geojson +0 -0
- {coastseg-0.0.72.dev6 → coastseg-0.0.72.dev8}/src/coastseg/transects/Transects_grid_region_117.geojson +0 -0
- {coastseg-0.0.72.dev6 → coastseg-0.0.72.dev8}/src/coastseg/transects/Transects_grid_region_15.geojson +0 -0
- {coastseg-0.0.72.dev6 → coastseg-0.0.72.dev8}/src/coastseg/transects/Transects_grid_region_16.geojson +0 -0
- {coastseg-0.0.72.dev6 → coastseg-0.0.72.dev8}/src/coastseg/transects/Transects_grid_region_2.geojson +0 -0
- {coastseg-0.0.72.dev6 → coastseg-0.0.72.dev8}/src/coastseg/transects/Transects_grid_region_22.geojson +0 -0
- {coastseg-0.0.72.dev6 → coastseg-0.0.72.dev8}/src/coastseg/transects/Transects_grid_region_23.geojson +0 -0
- {coastseg-0.0.72.dev6 → coastseg-0.0.72.dev8}/src/coastseg/transects/Transects_grid_region_24.geojson +0 -0
- {coastseg-0.0.72.dev6 → coastseg-0.0.72.dev8}/src/coastseg/transects/Transects_grid_region_29.geojson +0 -0
- {coastseg-0.0.72.dev6 → coastseg-0.0.72.dev8}/src/coastseg/transects/Transects_grid_region_30.geojson +0 -0
- {coastseg-0.0.72.dev6 → coastseg-0.0.72.dev8}/src/coastseg/transects/Transects_grid_region_31.geojson +0 -0
- {coastseg-0.0.72.dev6 → coastseg-0.0.72.dev8}/src/coastseg/transects/Transects_grid_region_32.geojson +0 -0
- {coastseg-0.0.72.dev6 → coastseg-0.0.72.dev8}/src/coastseg/transects/Transects_grid_region_33.geojson +0 -0
- {coastseg-0.0.72.dev6 → coastseg-0.0.72.dev8}/src/coastseg/transects/Transects_grid_region_34.geojson +0 -0
- {coastseg-0.0.72.dev6 → coastseg-0.0.72.dev8}/src/coastseg/transects/Transects_grid_region_8.geojson +0 -0
- {coastseg-0.0.72.dev6 → coastseg-0.0.72.dev8}/src/coastseg/transects/Transects_grid_region_95.geojson +0 -0
- {coastseg-0.0.72.dev6 → coastseg-0.0.72.dev8}/src/coastseg/transects/Transects_grid_region_96.geojson +0 -0
- {coastseg-0.0.72.dev6 → coastseg-0.0.72.dev8}/src/coastseg/transects/Transects_grid_region_99.geojson +0 -0
- {coastseg-0.0.72.dev6 → coastseg-0.0.72.dev8}/src/coastseg/transects.py +0 -0
- {coastseg-0.0.72.dev6 → coastseg-0.0.72.dev8}/src/coastseg/upload_feature_widget.py +0 -0
- {coastseg-0.0.72.dev6 → coastseg-0.0.72.dev8}/src/coastseg/watchable_slider.py +0 -0
- {coastseg-0.0.72.dev6 → coastseg-0.0.72.dev8}/src/coastseg.egg-info/SOURCES.txt +0 -0
- {coastseg-0.0.72.dev6 → coastseg-0.0.72.dev8}/src/coastseg.egg-info/dependency_links.txt +0 -0
- {coastseg-0.0.72.dev6 → coastseg-0.0.72.dev8}/src/coastseg.egg-info/requires.txt +0 -0
- {coastseg-0.0.72.dev6 → coastseg-0.0.72.dev8}/src/coastseg.egg-info/top_level.txt +0 -0
- {coastseg-0.0.72.dev6 → coastseg-0.0.72.dev8}/tests/__init__.py +0 -0
- {coastseg-0.0.72.dev6 → coastseg-0.0.72.dev8}/tests/conftest.py +0 -0
- {coastseg-0.0.72.dev6 → coastseg-0.0.72.dev8}/tests/test_bbox.py +0 -0
- {coastseg-0.0.72.dev6 → coastseg-0.0.72.dev8}/tests/test_coastseg_map.py +0 -0
- {coastseg-0.0.72.dev6 → coastseg-0.0.72.dev8}/tests/test_common.py +0 -0
- {coastseg-0.0.72.dev6 → coastseg-0.0.72.dev8}/tests/test_data/config.json +0 -0
- {coastseg-0.0.72.dev6 → coastseg-0.0.72.dev8}/tests/test_data/config_gdf_id_2.geojson +0 -0
- {coastseg-0.0.72.dev6 → coastseg-0.0.72.dev8}/tests/test_data/config_id_2.json +0 -0
- {coastseg-0.0.72.dev6 → coastseg-0.0.72.dev8}/tests/test_data/transect_compatible_bbox.geojson +0 -0
- {coastseg-0.0.72.dev6 → coastseg-0.0.72.dev8}/tests/test_data/transect_compatible_rois.geojson +0 -0
- {coastseg-0.0.72.dev6 → coastseg-0.0.72.dev8}/tests/test_data/transect_compatible_shoreline.geojson +0 -0
- {coastseg-0.0.72.dev6 → coastseg-0.0.72.dev8}/tests/test_data/transect_compatible_transects.geojson +0 -0
- {coastseg-0.0.72.dev6 → coastseg-0.0.72.dev8}/tests/test_data/valid_bbox.geojson +0 -0
- {coastseg-0.0.72.dev6 → coastseg-0.0.72.dev8}/tests/test_data/valid_rois.geojson +0 -0
- {coastseg-0.0.72.dev6 → coastseg-0.0.72.dev8}/tests/test_extracted_shoreline.py +0 -0
- {coastseg-0.0.72.dev6 → coastseg-0.0.72.dev8}/tests/test_roi.py +0 -0
- {coastseg-0.0.72.dev6 → coastseg-0.0.72.dev8}/tests/test_shoreline.py +0 -0
- {coastseg-0.0.72.dev6 → coastseg-0.0.72.dev8}/tests/test_transects.py +0 -0
- {coastseg-0.0.72.dev6 → coastseg-0.0.72.dev8}/tests/test_upload_widget.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: coastseg
|
|
3
|
-
Version: 0.0.72.
|
|
3
|
+
Version: 0.0.72.dev8
|
|
4
4
|
Summary: An interactive jupyter notebook for downloading satellite imagery
|
|
5
5
|
Author-email: Sharon Fitzpatrick <sharon.fitzpatrick23@gmail.com>
|
|
6
6
|
License: MIT License
|
|
@@ -37,6 +37,7 @@ Description-Content-Type: text/markdown
|
|
|
37
37
|
License-File: LICENSE
|
|
38
38
|
|
|
39
39
|
# CoastSeg
|
|
40
|
+
|
|
40
41
|
[](https://colab.research.google.com/github/2320sharon/CoastSeg/blob/main/coastseg_for_google_colab.ipynb)
|
|
41
42
|
|
|
42
43
|
[](https://pypi.python.org/pypi/coastseg)
|
|
@@ -56,8 +57,8 @@ License-File: LICENSE
|
|
|
56
57
|
|
|
57
58
|

|
|
58
59
|
|
|
59
|
-
|
|
60
60
|
## What is CoastSeg?
|
|
61
|
+
|
|
61
62
|
Coastseg stands for Coastal Segmentation, it is an interactive jupyter notebook for downloading satellite imagery with [CoastSat](https://github.com/kvos/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.
|
|
62
63
|
|
|
63
64
|
- A mapping extension for [CoastSat](https://github.com/kvos/CoastSat) using [Segmentation Zoo](https://github.com/Doodleverse/segmentation_zoo) models.
|
|
@@ -66,27 +67,31 @@ Coastseg stands for Coastal Segmentation, it is an interactive jupyter notebook
|
|
|
66
67
|
- An interactive interface to apply segmentation models to satellite imagery
|
|
67
68
|
|
|
68
69
|

|
|
70
|
+
|
|
69
71
|
- Create ROIs(regions of interest) along the coast and automatically load shorelines on the map.
|
|
70
|
-
- Use Google Earth Engine to automatically download satellite imagery for each ROI clicked on the map.
|
|
72
|
+
- Use Google Earth Engine to automatically download satellite imagery for each ROI clicked on the map.
|
|
71
73
|
|
|
72
74
|

|
|
75
|
+
|
|
73
76
|
- Coastseg can automatically extract shorelines from downloaded satellite imagery.
|
|
74
77
|
|
|
75
|
-
## Table of Contents
|
|
76
|
-
|
|
78
|
+
## Table of Contents
|
|
79
|
+
|
|
80
|
+
- [Installation Instructions](#installation-instructions)
|
|
77
81
|
- [Getting Started](#getting-tarted)
|
|
78
82
|
|
|
79
83
|
## Useful Links
|
|
84
|
+
|
|
80
85
|
- [Wiki](https://github.com/SatelliteShorelines/CoastSeg/wiki)
|
|
81
86
|
- [Discussion](https://github.com/SatelliteShorelines/CoastSeg/discussions)
|
|
82
87
|
- [Contribution Guide](https://github.com/SatelliteShorelines/CoastSeg/wiki/Contribution-Guide)
|
|
83
88
|
|
|
84
|
-
|
|
85
89
|
## Installation Instructions
|
|
86
90
|
|
|
87
91
|
In order to use Coastseg you need to install Python packages in an environment. We recommend you use [Anaconda](https://www.anaconda.com/products/distribution) 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.
|
|
88
92
|
|
|
89
93
|
1. Create an Anaconda environment
|
|
94
|
+
|
|
90
95
|
- This command creates an anaconda environment named `coastseg` and installs `python 3.10` in it.
|
|
91
96
|
```bash
|
|
92
97
|
conda create --name coastseg python=3.10 -y
|
|
@@ -117,10 +122,22 @@ In order to use Coastseg you need to install Python packages in an environment.
|
|
|
117
122
|
```
|
|
118
123
|
5. Uninstall the h5py installed by pip and reinstall with conda-forge
|
|
119
124
|
```bash
|
|
120
|
-
pip uninstall h5py
|
|
121
|
-
conda install -c conda-forge h5py
|
|
125
|
+
pip uninstall h5py -y
|
|
126
|
+
conda install -c conda-forge h5py -y
|
|
122
127
|
```
|
|
123
128
|
|
|
129
|
+
## How to Update
|
|
130
|
+
|
|
131
|
+
### Update to a specific version
|
|
132
|
+
|
|
133
|
+
- To update coastseg to a specific version specify the version after the `==`
|
|
134
|
+
|
|
135
|
+
`pip install coastseg==0.0.72.dev6`
|
|
136
|
+
|
|
137
|
+
### Update to the latest version
|
|
138
|
+
|
|
139
|
+
`pip install coastseg --upgrade`
|
|
140
|
+
|
|
124
141
|
## **Having Installation Errors?**
|
|
125
142
|
|
|
126
143
|
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.
|
|
@@ -138,7 +155,6 @@ conda clean --all
|
|
|
138
155
|
|
|
139
156
|
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.
|
|
140
157
|
|
|
141
|
-
|
|
142
158
|
2. Activate your conda environment
|
|
143
159
|
|
|
144
160
|
```bash
|
|
@@ -157,14 +173,13 @@ Once you’ve created the coastseg environment you’ll need to run `git clone`
|
|
|
157
173
|
4. Launch Jupyter Lab
|
|
158
174
|
|
|
159
175
|
- Run this command in the coastseg directory to launch the notebook `SDS_coastsat_classifier`
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
5. Use the `SDS_coastsat_classifier` to Download Imagery
|
|
176
|
+
```bash
|
|
177
|
+
jupyter lab SDS_coastsat_classifier.ipynb
|
|
178
|
+
```
|
|
165
179
|
|
|
166
|
-
|
|
180
|
+
5. Use the `SDS_coastsat_classifier` to Download Imagery
|
|
167
181
|
|
|
182
|
+
Check out the wiki guide [How to Download Imagery](https://github.com/Doodleverse/CoastSeg/wiki/2.-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.
|
|
168
183
|
|
|
169
184
|
# Authors
|
|
170
185
|
|
|
@@ -179,7 +194,9 @@ Contributions:
|
|
|
179
194
|
- [@kvos](https://github.com/kvos)
|
|
180
195
|
|
|
181
196
|
## Citations
|
|
197
|
+
|
|
182
198
|
Thank you to all the amazing research who contributed their transects to coastseg.
|
|
199
|
+
|
|
183
200
|
1. Hawaii small islands https://pubs.usgs.gov/of/2011/1009/data.html
|
|
184
201
|
2. Barter Island, Alaska https://www.sciencebase.gov/catalog/item/5fa1f10ad34e198cb793cee4
|
|
185
202
|
3. Pacific Northwest, Gulf, and SE USA: Dr Sean Vitousek, USGS-PCMSC, based on DSAS transects
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
# CoastSeg
|
|
2
|
+
|
|
2
3
|
[](https://colab.research.google.com/github/2320sharon/CoastSeg/blob/main/coastseg_for_google_colab.ipynb)
|
|
3
4
|
|
|
4
5
|
[](https://pypi.python.org/pypi/coastseg)
|
|
@@ -18,8 +19,8 @@
|
|
|
18
19
|
|
|
19
20
|

|
|
20
21
|
|
|
21
|
-
|
|
22
22
|
## What is CoastSeg?
|
|
23
|
+
|
|
23
24
|
Coastseg stands for Coastal Segmentation, it is an interactive jupyter notebook for downloading satellite imagery with [CoastSat](https://github.com/kvos/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.
|
|
24
25
|
|
|
25
26
|
- A mapping extension for [CoastSat](https://github.com/kvos/CoastSat) using [Segmentation Zoo](https://github.com/Doodleverse/segmentation_zoo) models.
|
|
@@ -28,27 +29,31 @@ Coastseg stands for Coastal Segmentation, it is an interactive jupyter notebook
|
|
|
28
29
|
- An interactive interface to apply segmentation models to satellite imagery
|
|
29
30
|
|
|
30
31
|

|
|
32
|
+
|
|
31
33
|
- Create ROIs(regions of interest) along the coast and automatically load shorelines on the map.
|
|
32
|
-
- Use Google Earth Engine to automatically download satellite imagery for each ROI clicked on the map.
|
|
34
|
+
- Use Google Earth Engine to automatically download satellite imagery for each ROI clicked on the map.
|
|
33
35
|
|
|
34
36
|

|
|
37
|
+
|
|
35
38
|
- Coastseg can automatically extract shorelines from downloaded satellite imagery.
|
|
36
39
|
|
|
37
|
-
## Table of Contents
|
|
38
|
-
|
|
40
|
+
## Table of Contents
|
|
41
|
+
|
|
42
|
+
- [Installation Instructions](#installation-instructions)
|
|
39
43
|
- [Getting Started](#getting-tarted)
|
|
40
44
|
|
|
41
45
|
## Useful Links
|
|
46
|
+
|
|
42
47
|
- [Wiki](https://github.com/SatelliteShorelines/CoastSeg/wiki)
|
|
43
48
|
- [Discussion](https://github.com/SatelliteShorelines/CoastSeg/discussions)
|
|
44
49
|
- [Contribution Guide](https://github.com/SatelliteShorelines/CoastSeg/wiki/Contribution-Guide)
|
|
45
50
|
|
|
46
|
-
|
|
47
51
|
## Installation Instructions
|
|
48
52
|
|
|
49
53
|
In order to use Coastseg you need to install Python packages in an environment. We recommend you use [Anaconda](https://www.anaconda.com/products/distribution) 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.
|
|
50
54
|
|
|
51
55
|
1. Create an Anaconda environment
|
|
56
|
+
|
|
52
57
|
- This command creates an anaconda environment named `coastseg` and installs `python 3.10` in it.
|
|
53
58
|
```bash
|
|
54
59
|
conda create --name coastseg python=3.10 -y
|
|
@@ -79,10 +84,22 @@ In order to use Coastseg you need to install Python packages in an environment.
|
|
|
79
84
|
```
|
|
80
85
|
5. Uninstall the h5py installed by pip and reinstall with conda-forge
|
|
81
86
|
```bash
|
|
82
|
-
pip uninstall h5py
|
|
83
|
-
conda install -c conda-forge h5py
|
|
87
|
+
pip uninstall h5py -y
|
|
88
|
+
conda install -c conda-forge h5py -y
|
|
84
89
|
```
|
|
85
90
|
|
|
91
|
+
## How to Update
|
|
92
|
+
|
|
93
|
+
### Update to a specific version
|
|
94
|
+
|
|
95
|
+
- To update coastseg to a specific version specify the version after the `==`
|
|
96
|
+
|
|
97
|
+
`pip install coastseg==0.0.72.dev6`
|
|
98
|
+
|
|
99
|
+
### Update to the latest version
|
|
100
|
+
|
|
101
|
+
`pip install coastseg --upgrade`
|
|
102
|
+
|
|
86
103
|
## **Having Installation Errors?**
|
|
87
104
|
|
|
88
105
|
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.
|
|
@@ -100,7 +117,6 @@ conda clean --all
|
|
|
100
117
|
|
|
101
118
|
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.
|
|
102
119
|
|
|
103
|
-
|
|
104
120
|
2. Activate your conda environment
|
|
105
121
|
|
|
106
122
|
```bash
|
|
@@ -119,14 +135,13 @@ Once you’ve created the coastseg environment you’ll need to run `git clone`
|
|
|
119
135
|
4. Launch Jupyter Lab
|
|
120
136
|
|
|
121
137
|
- Run this command in the coastseg directory to launch the notebook `SDS_coastsat_classifier`
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
5. Use the `SDS_coastsat_classifier` to Download Imagery
|
|
138
|
+
```bash
|
|
139
|
+
jupyter lab SDS_coastsat_classifier.ipynb
|
|
140
|
+
```
|
|
127
141
|
|
|
128
|
-
|
|
142
|
+
5. Use the `SDS_coastsat_classifier` to Download Imagery
|
|
129
143
|
|
|
144
|
+
Check out the wiki guide [How to Download Imagery](https://github.com/Doodleverse/CoastSeg/wiki/2.-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.
|
|
130
145
|
|
|
131
146
|
# Authors
|
|
132
147
|
|
|
@@ -141,7 +156,9 @@ Contributions:
|
|
|
141
156
|
- [@kvos](https://github.com/kvos)
|
|
142
157
|
|
|
143
158
|
## Citations
|
|
159
|
+
|
|
144
160
|
Thank you to all the amazing research who contributed their transects to coastseg.
|
|
161
|
+
|
|
145
162
|
1. Hawaii small islands https://pubs.usgs.gov/of/2011/1009/data.html
|
|
146
163
|
2. Barter Island, Alaska https://www.sciencebase.gov/catalog/item/5fa1f10ad34e198cb793cee4
|
|
147
164
|
3. Pacific Northwest, Gulf, and SE USA: Dr Sean Vitousek, USGS-PCMSC, based on DSAS transects
|
|
@@ -3,7 +3,7 @@ import os
|
|
|
3
3
|
import json
|
|
4
4
|
import logging
|
|
5
5
|
import glob
|
|
6
|
-
from typing import List, Optional, Tuple, Union
|
|
6
|
+
from typing import Dict, List, Optional, Tuple, Union
|
|
7
7
|
from collections import defaultdict
|
|
8
8
|
|
|
9
9
|
from coastseg.bbox import Bounding_Box
|
|
@@ -33,6 +33,8 @@ from ipyleaflet import GeoJSON
|
|
|
33
33
|
|
|
34
34
|
logger = logging.getLogger(__name__)
|
|
35
35
|
|
|
36
|
+
SELECTED_LAYER_NAME = "Selected Shorelines"
|
|
37
|
+
|
|
36
38
|
|
|
37
39
|
class CoastSeg_Map:
|
|
38
40
|
def __init__(self):
|
|
@@ -58,6 +60,7 @@ class CoastSeg_Map:
|
|
|
58
60
|
|
|
59
61
|
# ids of the selected rois
|
|
60
62
|
self.selected_set = set()
|
|
63
|
+
self.selected_shorelines_set = set()
|
|
61
64
|
|
|
62
65
|
# map objects
|
|
63
66
|
self.rois = None
|
|
@@ -1602,7 +1605,6 @@ class CoastSeg_Map:
|
|
|
1602
1605
|
f"layer_name {layer_name} \non_hover {on_hover}\n on_click {on_click}"
|
|
1603
1606
|
)
|
|
1604
1607
|
self.remove_layer_by_name(layer_name)
|
|
1605
|
-
exception_handler.check_empty_layer(new_layer, layer_name)
|
|
1606
1608
|
# when feature is hovered over on_hover function is called
|
|
1607
1609
|
if on_hover is not None:
|
|
1608
1610
|
new_layer.on_hover(on_hover)
|
|
@@ -1623,6 +1625,36 @@ class CoastSeg_Map:
|
|
|
1623
1625
|
del self.rois
|
|
1624
1626
|
self.rois = None
|
|
1625
1627
|
|
|
1628
|
+
def remove_selected_shorelines(self) -> None:
|
|
1629
|
+
"""Removes all the unselected rois from the map"""
|
|
1630
|
+
logger.info("Removing selected shorelines from map")
|
|
1631
|
+
# Remove the selected and unselected rois
|
|
1632
|
+
self.remove_layer_by_name(SELECTED_LAYER_NAME)
|
|
1633
|
+
self.remove_layer_by_name(Shoreline.LAYER_NAME)
|
|
1634
|
+
# delete selected ROIs from dataframe
|
|
1635
|
+
if self.shoreline:
|
|
1636
|
+
self.shoreline.remove_by_id(self.selected_shorelines_set)
|
|
1637
|
+
# clear all the ids from the selected set
|
|
1638
|
+
self.selected_shorelines_set = set()
|
|
1639
|
+
# reload rest of ROIs on map
|
|
1640
|
+
self.load_feature_on_map(
|
|
1641
|
+
"shoreline", gdf=self.shoreline.gdf, zoom_to_bounds=True
|
|
1642
|
+
)
|
|
1643
|
+
|
|
1644
|
+
def remove_selected_rois(self) -> None:
|
|
1645
|
+
"""Removes all the unselected rois from the map"""
|
|
1646
|
+
logger.info("Removing selected ROIs from map")
|
|
1647
|
+
# Remove the selected and unselected rois
|
|
1648
|
+
self.remove_layer_by_name(ROI.SELECTED_LAYER_NAME)
|
|
1649
|
+
self.remove_layer_by_name(ROI.LAYER_NAME)
|
|
1650
|
+
# delete selected ROIs from dataframe
|
|
1651
|
+
if self.rois:
|
|
1652
|
+
self.rois.remove_by_id(self.selected_set)
|
|
1653
|
+
# clear all the ids from the selected set
|
|
1654
|
+
self.selected_set = set()
|
|
1655
|
+
# reload rest of ROIs on map
|
|
1656
|
+
self.load_feature_on_map("roi", gdf=self.rois.gdf, zoom_to_bounds=True)
|
|
1657
|
+
|
|
1626
1658
|
def create_DrawControl(self, draw_control: "ipyleaflet.leaflet.DrawControl"):
|
|
1627
1659
|
"""Modifies given draw control so that only rectangles can be drawn
|
|
1628
1660
|
|
|
@@ -1880,6 +1912,8 @@ class CoastSeg_Map:
|
|
|
1880
1912
|
on_click = None
|
|
1881
1913
|
if "roi" in feature_name.lower():
|
|
1882
1914
|
on_click = self.geojson_onclick_handler
|
|
1915
|
+
elif "shoreline" in feature_name.lower():
|
|
1916
|
+
on_click = self.shoreline_onclick_handler
|
|
1883
1917
|
return on_click
|
|
1884
1918
|
|
|
1885
1919
|
def get_on_hover_handler(self, feature_name: str) -> callable:
|
|
@@ -1944,24 +1978,17 @@ class CoastSeg_Map:
|
|
|
1944
1978
|
"""
|
|
1945
1979
|
if properties is None:
|
|
1946
1980
|
return
|
|
1947
|
-
logger.info(f"properties : {properties}")
|
|
1948
|
-
logger.info(f"ROI_id : {properties['id']}")
|
|
1949
|
-
logger.info(type(event))
|
|
1950
|
-
logger.info(type(id))
|
|
1951
|
-
logger.info(id)
|
|
1952
1981
|
# Add id of clicked ROI to selected_set
|
|
1953
|
-
|
|
1954
|
-
self.selected_set.add(ROI_id)
|
|
1955
|
-
logger.info(f"Added ID to selected set: {self.selected_set}")
|
|
1982
|
+
self.selected_set.add(str(properties["id"]))
|
|
1956
1983
|
# remove old selected layer
|
|
1957
1984
|
self.remove_layer_by_name(ROI.SELECTED_LAYER_NAME)
|
|
1958
|
-
|
|
1959
1985
|
selected_layer = GeoJSON(
|
|
1960
|
-
data=self.convert_selected_set_to_geojson(
|
|
1986
|
+
data=self.convert_selected_set_to_geojson(
|
|
1987
|
+
self.selected_set, ROI.LAYER_NAME
|
|
1988
|
+
),
|
|
1961
1989
|
name=ROI.SELECTED_LAYER_NAME,
|
|
1962
1990
|
hover_style={"fillColor": "blue", "fillOpacity": 0.1, "color": "aqua"},
|
|
1963
1991
|
)
|
|
1964
|
-
logger.info(f"selected_layer: {selected_layer}")
|
|
1965
1992
|
self.replace_layer_by_name(
|
|
1966
1993
|
ROI.SELECTED_LAYER_NAME,
|
|
1967
1994
|
selected_layer,
|
|
@@ -1969,6 +1996,77 @@ class CoastSeg_Map:
|
|
|
1969
1996
|
on_hover=self.update_roi_html,
|
|
1970
1997
|
)
|
|
1971
1998
|
|
|
1999
|
+
def shoreline_onclick_handler(
|
|
2000
|
+
self,
|
|
2001
|
+
event: str = None,
|
|
2002
|
+
id: int = None,
|
|
2003
|
+
properties: dict = None,
|
|
2004
|
+
**args,
|
|
2005
|
+
):
|
|
2006
|
+
"""On click handler for when unselected geojson is clicked.
|
|
2007
|
+
|
|
2008
|
+
Adds object's id to selected_objects_set. Replaces current selected layer with a new one that includes
|
|
2009
|
+
recently clicked geojson.
|
|
2010
|
+
|
|
2011
|
+
Args:
|
|
2012
|
+
event (str, optional): event fired ('click'). Defaults to None.
|
|
2013
|
+
id (NoneType, optional): Defaults to None.
|
|
2014
|
+
properties (dict, optional): geojson dict for clicked geojson. Defaults to None.
|
|
2015
|
+
"""
|
|
2016
|
+
if properties is None:
|
|
2017
|
+
return
|
|
2018
|
+
# Add id of clicked shape to selected_set
|
|
2019
|
+
self.selected_shorelines_set.add(str(properties["id"]))
|
|
2020
|
+
# remove old selected layer
|
|
2021
|
+
self.remove_layer_by_name(SELECTED_LAYER_NAME)
|
|
2022
|
+
selected_layer = GeoJSON(
|
|
2023
|
+
data=self.convert_selected_set_to_geojson(
|
|
2024
|
+
self.selected_shorelines_set, Shoreline.LAYER_NAME
|
|
2025
|
+
),
|
|
2026
|
+
name=SELECTED_LAYER_NAME,
|
|
2027
|
+
hover_style={"fillColor": "orange", "fillOpacity": 0.1, "color": "orange"},
|
|
2028
|
+
)
|
|
2029
|
+
self.replace_layer_by_name(
|
|
2030
|
+
SELECTED_LAYER_NAME,
|
|
2031
|
+
selected_layer,
|
|
2032
|
+
on_click=self.selected_shoreline_onclick_handler,
|
|
2033
|
+
on_hover=None,
|
|
2034
|
+
)
|
|
2035
|
+
|
|
2036
|
+
def selected_shoreline_onclick_handler(
|
|
2037
|
+
self, event: str = None, id: "NoneType" = None, properties: dict = None, **args
|
|
2038
|
+
):
|
|
2039
|
+
"""On click handler for selected geojson layer.
|
|
2040
|
+
|
|
2041
|
+
Removes clicked layer's cid from the selected_set and replaces the select layer with a new one with
|
|
2042
|
+
the clicked layer removed from select_layer.
|
|
2043
|
+
|
|
2044
|
+
Args:
|
|
2045
|
+
event (str, optional): event fired ('click'). Defaults to None.
|
|
2046
|
+
id (NoneType, optional): Defaults to None.
|
|
2047
|
+
properties (dict, optional): geojson dict for clicked selected geojson. Defaults to None.
|
|
2048
|
+
"""
|
|
2049
|
+
if properties is None:
|
|
2050
|
+
return
|
|
2051
|
+
|
|
2052
|
+
# Remove the current layers cid from selected set
|
|
2053
|
+
self.selected_shorelines_set.remove(str(properties["id"]))
|
|
2054
|
+
self.remove_layer_by_name(SELECTED_LAYER_NAME)
|
|
2055
|
+
# Recreate selected layers without layer that was removed
|
|
2056
|
+
selected_layer = GeoJSON(
|
|
2057
|
+
data=self.convert_selected_set_to_geojson(
|
|
2058
|
+
self.selected_shorelines_set, Shoreline.LAYER_NAME
|
|
2059
|
+
),
|
|
2060
|
+
name=SELECTED_LAYER_NAME,
|
|
2061
|
+
hover_style={"fillColor": "orange", "fillOpacity": 0.1, "color": "orange"},
|
|
2062
|
+
)
|
|
2063
|
+
self.replace_layer_by_name(
|
|
2064
|
+
SELECTED_LAYER_NAME,
|
|
2065
|
+
selected_layer,
|
|
2066
|
+
on_click=self.selected_shoreline_onclick_handler,
|
|
2067
|
+
on_hover=None,
|
|
2068
|
+
)
|
|
2069
|
+
|
|
1972
2070
|
def selected_onclick_handler(
|
|
1973
2071
|
self, event: str = None, id: "NoneType" = None, properties: dict = None, **args
|
|
1974
2072
|
):
|
|
@@ -1985,16 +2083,13 @@ class CoastSeg_Map:
|
|
|
1985
2083
|
if properties is None:
|
|
1986
2084
|
return
|
|
1987
2085
|
# Remove the current layers cid from selected set
|
|
1988
|
-
|
|
1989
|
-
logger.info(f"selected_onclick_handler: ROI_id to remove : {properties['id']}")
|
|
1990
|
-
cid = properties["id"]
|
|
1991
|
-
self.selected_set.remove(cid)
|
|
1992
|
-
logger.info(f"selected set after ID removal: {self.selected_set}")
|
|
2086
|
+
self.selected_set.remove(properties["id"])
|
|
1993
2087
|
self.remove_layer_by_name(ROI.SELECTED_LAYER_NAME)
|
|
1994
2088
|
# Recreate selected layers without layer that was removed
|
|
1995
|
-
|
|
1996
2089
|
selected_layer = GeoJSON(
|
|
1997
|
-
data=self.convert_selected_set_to_geojson(
|
|
2090
|
+
data=self.convert_selected_set_to_geojson(
|
|
2091
|
+
self.selected_set, ROI.LAYER_NAME
|
|
2092
|
+
),
|
|
1998
2093
|
name=ROI.SELECTED_LAYER_NAME,
|
|
1999
2094
|
hover_style={"fillColor": "blue", "fillOpacity": 0.1, "color": "aqua"},
|
|
2000
2095
|
)
|
|
@@ -2034,32 +2129,46 @@ class CoastSeg_Map:
|
|
|
2034
2129
|
else:
|
|
2035
2130
|
print(f"Empty {feature.LAYER_NAME} cannot be saved to file")
|
|
2036
2131
|
|
|
2037
|
-
def convert_selected_set_to_geojson(
|
|
2132
|
+
def convert_selected_set_to_geojson(
|
|
2133
|
+
self, selected_set: set, layer_name: str, style: Optional[Dict] = None
|
|
2134
|
+
) -> Dict:
|
|
2038
2135
|
"""Returns a geojson dict containing a FeatureCollection for all the geojson objects in the
|
|
2039
2136
|
selected_set
|
|
2040
2137
|
Args:
|
|
2041
2138
|
selected_set (set): ids of selected geojson
|
|
2139
|
+
layer_name (str): name of the layer to get geometries from
|
|
2140
|
+
style (Optional[Dict]): style dictionary to be applied to each selected feature.
|
|
2141
|
+
If no style is provided then a default style is used:
|
|
2142
|
+
style = {
|
|
2143
|
+
"color": "blue",
|
|
2144
|
+
"weight": 2,
|
|
2145
|
+
"fillColor": "blue",
|
|
2146
|
+
"fillOpacity": 0.1,
|
|
2147
|
+
}
|
|
2042
2148
|
Returns:
|
|
2043
|
-
|
|
2149
|
+
Dict: geojson dict containing FeatureCollection for all geojson objects in selected_set
|
|
2044
2150
|
"""
|
|
2045
|
-
# create a new geojson dictionary to hold selected
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
# if ROI layer does not exist throw an error
|
|
2049
|
-
if roi_layer is not None:
|
|
2050
|
-
exception_handler.check_empty_layer(roi_layer, "ROI")
|
|
2051
|
-
# Copy only selected ROIs with id in selected_set
|
|
2052
|
-
selected_rois["features"] = [
|
|
2053
|
-
feature
|
|
2054
|
-
for feature in roi_layer.data["features"]
|
|
2055
|
-
if feature["properties"]["id"] in selected_set
|
|
2056
|
-
]
|
|
2057
|
-
# Each selected ROI will be blue and unselected rois will appear black
|
|
2058
|
-
for feature in selected_rois["features"]:
|
|
2059
|
-
feature["properties"]["style"] = {
|
|
2151
|
+
# create a new geojson dictionary to hold selected shapes
|
|
2152
|
+
if style is None:
|
|
2153
|
+
style = {
|
|
2060
2154
|
"color": "blue",
|
|
2061
2155
|
"weight": 2,
|
|
2062
2156
|
"fillColor": "blue",
|
|
2063
2157
|
"fillOpacity": 0.1,
|
|
2064
2158
|
}
|
|
2065
|
-
|
|
2159
|
+
selected_shapes = {"type": "FeatureCollection", "features": []}
|
|
2160
|
+
layer = self.map.find_layer(layer_name)
|
|
2161
|
+
# if ROI layer does not exist throw an error
|
|
2162
|
+
if layer is not None:
|
|
2163
|
+
exception_handler.check_empty_layer(layer, layer_name)
|
|
2164
|
+
# Copy only selected features with id in selected_set
|
|
2165
|
+
selected_features = [
|
|
2166
|
+
feature
|
|
2167
|
+
for feature in layer.data["features"]
|
|
2168
|
+
if feature["properties"]["id"] in selected_set
|
|
2169
|
+
]
|
|
2170
|
+
selected_shapes["features"] = [
|
|
2171
|
+
{**feature, "properties": {**feature["properties"], "style": style}}
|
|
2172
|
+
for feature in selected_features
|
|
2173
|
+
]
|
|
2174
|
+
return selected_shapes
|