Skip to content

Commit

Permalink
Merge pull request #13 from IndigoWizard/feature/imagery-analysis
Browse files Browse the repository at this point in the history
Imagery: Elevation Data Source Enhancement (JAXA ALOS DSM 30m)
  • Loading branch information
IndigoWizard authored Jun 10, 2023
2 parents 89a4638 + 56574ae commit 04f56df
Show file tree
Hide file tree
Showing 4 changed files with 284 additions and 268 deletions.
20 changes: 12 additions & 8 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,40 +2,44 @@

All contribution is welcome (_adding features✨, bug fix🔧, bug report🐛, design✒️, documentation📝, fixing typos ...etc_).

## To contribute to this repo, please make sure to follow the rules

### Rules

## To contribute to this repo, please make sure to follow the rules.
### Rules:
- Always check repo's open ***[issues](issues)*** to avoid duplicates, conflict and ambiguous work.
- Open a new issue stating the subject of your upcoming contribution if no already existing open issue is related to the subject.
- If it's a **one-time issue**, ask a maintainer to assign you to the issue before starting to work on it.
- Always make sure your own forked repo is up to date with the original repo.

### NOTE:
I'm using integrated GitFfow for this project, so the setup is:
### NOTE

I'm using integrated Gitflow for this project, so the setup is:
**Branches**

- Master = main
- Develop = develop

**Prefixes**

- Feature = feature/
- Release = release/
- Hotfix = hotfix/
- Version tag = 0.0.0 (using [SemVer](https://semver.org/))


Most existing branches are feature branches and named as such, e.g: "features/UI" or "features/imagery-analysis"...

## Pull Requests

- Do not push your node modules folder.
- Make sure you give your PR a clear discription and **meaningful title** of your contribution are requested.
- Make sure you give your PR a clear description and **meaningful title** of your contribution are requested.
- Create a new branch for you contribution and name it relatively to its theme (e.g: **UI-dark-theme** or if using gitflow use the existing **feature/UI**).
- Document your code, no one has time to figure out the meaning of your ancient rituals codes ...
- Make sure your contribution don't break existing features.
- Link the issue(s) you worked on in your pull request description.
- Use visual displays (screenshots, pictures, videos) to express the new changes you added in your PR if you contributed to an issue that affects the looks, functions of the project.


# Issues
- Issues are labbeled to make it easier for contributors/mantainers identify them.

- Issues are labeled to make it easier for contributors/maintainers identify them.
- Always check the existing issues to avoid conflict and duplicates.
- Request to be assigned to an issue before you start working on it.
18 changes: 13 additions & 5 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,39 +1,47 @@
Please make your PRs to the *develop* branch, not *main*.

# Main PR gist

- A description of what this PR is about.

## Issue ticket

- Link to related open issue.

## Type of change
Please delete options that are not relevant and check relevent one:

Please delete options that are not relevant and check relevant one:

- [ ] Enhancement (maintenance, updating code/ updating structure, cleaning up code... etc)
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] This change requires a documentation update

## Changes description

- What was the bug in question (if this PR is a bug fix)
- What's the feature and it's function (if feature implementation)
- What you changed in the functionality (if feature enhancement)

## Additional info:
## Additional info

- System OS
- Packages list (if added anything new, specify it with it's version)
- Python version (or else)

## Preview

Post here a quick demo:

- Good quality .PNG
- GIF
- Video

You may use a quick comparatif table to show changes if needed:
| Before | Aftere |
You may use a quick comparative table to show changes if needed:
| Before | After |
| ----------- | ----------- |
| PNG/GIF link| PNG/GIF link|
| Text | Text |


> NOTE: Please delete any section or elements of the PR template that you do not need in your PR submission (including this very note) while maintaining the structure of the template.>
482 changes: 241 additions & 241 deletions webmap.html

Large diffs are not rendered by default.

32 changes: 18 additions & 14 deletions webmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,18 +70,22 @@ def add_ee_layer(self, ee_image_object, vis_params, name):

# ########## Elevation

# ##### NASA DEM (Digital Elevation Model) collection: 30m resolution
dem = ee.Image('CGIAR/SRTM90_V4').clip(aoi)
# ##### JAXA ALOS DSM: Global 30m (Digital Surface Model)
dem = ee.Image('JAXA/ALOS/AW3D30/V2_2').clip(aoi)

# visual parameters for the DEM imagery
# masking the DSM to the surface of the earth only
dem = dem.updateMask(dem.gt(0))

# visual parameters for the DSM imagery
dem_params = {
'min': 0,
'max': 905
'max': 905,
'bands': ['AVE_DSM']
}

# ##### Elevation
# deriving elevation from previous DEM
elevation = dem.select('elevation').clip(aoi)
# deriving elevation from previous DSM
elevation = dem.select('AVE_DSM').clip(aoi)

# visual parameters for the elevation imagery
elevation_params = {
Expand All @@ -103,7 +107,7 @@ def add_ee_layer(self, ee_image_object, vis_params, name):
}

# ##### Slopes (30m resolution)
# deriving slopes from previous DEM through Elevation
# deriving slopes from previous DSM through Elevation
slopes = ee.Terrain.slope(elevation).clip(aoi)

# visual parameters for the slopes imagery
Expand All @@ -115,14 +119,14 @@ def add_ee_layer(self, ee_image_object, vis_params, name):
}

# ##### Contour lines
# deriving countour lines from previous DEM through Terrain
contours = geemap.create_contours(dem, 0, 905, 20, region=aoi)
# deriving countour lines from previous DSM through Terrain
contours = geemap.create_contours(elevation, 0, 905, 20, region=aoi)

# visual parameters for the contour lines
contours_params = {
'min': 0,
'max': 1000,
'palette': ['#440044', '#00FFFF', '#00FFFF', '#00FFFF'],
'palette' : ['#053061', '#2166ac', '#4393c3', '#92c5de', '#d1e5f0', '#f7f7f7', '#fddbc7', '#f4a582', '#d6604d', '#b2182b', '#67001f'],
'opacity': 0.3
}

Expand Down Expand Up @@ -696,8 +700,8 @@ def getNDWI(image_2):
TCI = m.add_ee_layer(image_satellite, image_params, 'Sentinel-2 True Colors')

# ##### SRTM elevation & slopes
# adding DEM layer
#m.add_ee_layer(dem, dem_params, 'NASA DEM 30m')
# adding DSM layer
#m.add_ee_layer(dem, dem_params, 'NASA DSM 30m')

# adding Hillshades
HILLSHADE = m.add_ee_layer(hillshade, hillshade_params, "Hillshade")
Expand Down Expand Up @@ -889,8 +893,8 @@ def getNDWI(image_2):
</div>
<div class="index-gradient-container">
<div class='legend-scale' id="DEM">
<h4>DEM</h4>
<div class='legend-scale' id="DSM">
<h4>DSM</h4>
<div class="inside-container">
<div class="gradient-block">
<span id="dem-gradient"></span>
Expand Down

0 comments on commit 04f56df

Please sign in to comment.