-
Notifications
You must be signed in to change notification settings - Fork 26
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
10 changed files
with
156 additions
and
44 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
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
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
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,13 +1,12 @@ | ||
"""Example process file.""" | ||
|
||
|
||
def execute(mp): | ||
def execute(mp, file1): | ||
"""User defined process.""" | ||
# Reading and writing data works like this: | ||
with mp.open("file1") as raster_file: | ||
if raster_file.is_empty(): | ||
return "empty" | ||
# This assures a transparent tile instead of a pink error tile | ||
# is returned when using mapchete serve. | ||
dem = raster_file.read(resampling="bilinear") | ||
if file1.is_empty(): | ||
return "empty" | ||
# This assures a transparent tile instead of a pink error tile | ||
# is returned when using mapchete serve. | ||
dem = file1.read(resampling="bilinear") | ||
return dem |
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
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,40 @@ | ||
# mandatory parameters | ||
###################### | ||
# this is the location of user python code: | ||
process: inputs_as_args.py | ||
|
||
# zoom level range: | ||
zoom_levels: | ||
min: 7 | ||
max: 11 | ||
# or define single zoom level | ||
# zoom_levels: 5 | ||
|
||
# geographical subset: | ||
# bounds: [1.0, 2.0, 3.0, 4.0] | ||
|
||
# output pyramid definition | ||
|
||
pyramid: | ||
grid: geodetic | ||
metatiling: 1 # can be 1, 2, 4, 8, 16 (default 1) | ||
|
||
|
||
input: | ||
file1: | ||
zoom>=10: dummy1.tif | ||
file2: dummy2.tif | ||
output: | ||
path: tmp/example | ||
format: GTiff | ||
dtype: float32 | ||
bands: 1 | ||
|
||
# free parameters | ||
################# | ||
some_integer_parameter: 12 | ||
some_float_parameter: 5.3 | ||
some_string_parameter: | ||
zoom<=7: string1 | ||
zoom>7: string2 | ||
some_bool_parameter: true |
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,8 @@ | ||
"""Example process file.""" | ||
|
||
|
||
def execute(file1, file2, herbert=None): | ||
"""User defined process.""" | ||
assert file1 is None | ||
dem = file2.read() | ||
return dem |