-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
49 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
from .download_tile import * | ||
from .tile_tile import * | ||
from .export_tile import * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import ipyvuetify as v | ||
from traitlets import Int | ||
from sepal_ui import aoi | ||
from sepal_ui import mapping as sm | ||
|
||
from component.message import cm | ||
|
||
|
||
class ExportTile(aoi.AoiTile): | ||
"""adapt the AoiTile object for this specifi usage""" | ||
|
||
ready = Int(0).tag(sync=True) | ||
|
||
def __init__(self, **kwargs): | ||
"""add a download behaviour for admin areas""" | ||
|
||
# set the accepted methods | ||
kwargs["methods"] = ["ADMIN2", "DRAW", "SHAPE", "POINTS"] | ||
|
||
# call the constructor | ||
super().__init__(**kwargs) | ||
|
||
# set the title | ||
self.set_title(cm.to_gee.title) | ||
|
||
# add js behaviour | ||
self.view.observe(self.export_data, "updated") | ||
|
||
def export_data(self, *args): | ||
"""trigger the exportation to Earth Engine""" | ||
|
||
if self.view.model.method == "ADMIN2": | ||
|
||
self.view.model.export_to_asset() | ||
|
||
# update the message | ||
self.view.alert.add_msg("The AOI have been exported to GEE.", "success") | ||
|
||
self.ready += 1 | ||
|
||
return |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
165476b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix #26