@@ -7,30 +7,30 @@ if config.get("tiny_files", False):
77 ##
88
99 rule clip_slope :
10- message :
11- "Download slope data covering the bounds of the input shapefile."
12- params :
13- cog_url = internal ["resources" ]["automatic" ]["slope" ],
1410 input :
1511 vector = "resources/user/shapes/{shape}.parquet" ,
1612 output :
1713 path = "resources/automatic/cutout/{shape}/slope.tif" ,
1814 log :
1915 "logs/{shape}/clip_slope.log" ,
16+ params :
17+ cog_url = internal ["resources" ]["automatic" ]["slope" ],
18+ message :
19+ "Download slope data covering the bounds of the input shapefile."
2020 wrapper :
2121 "v7.2.0/geo/rasterio/clip-geotiff"
2222
2323 rule clip_bathymetry :
24- message :
25- "Download bathymetry data covering the bounds of the input shapefile."
26- params :
27- cog_url = internal ["resources" ]["automatic" ]["bathymetry" ],
2824 input :
2925 vector = "resources/user/shapes/{shape}.parquet" ,
3026 output :
3127 path = "resources/automatic/cutout/{shape}/bathymetry.tif" ,
3228 log :
3329 "logs/{shape}/clip_bathymetry.log" ,
30+ params :
31+ cog_url = internal ["resources" ]["automatic" ]["bathymetry" ],
32+ message :
33+ "Download bathymetry data covering the bounds of the input shapefile."
3434 wrapper :
3535 "v7.2.0/geo/rasterio/clip-geotiff"
3636
@@ -41,40 +41,38 @@ else:
4141 ##
4242
4343 rule download_slope :
44- message :
45- "Download global slope data."
46- params :
47- url = internal ["resources" ]["automatic" ]["slope" ],
4844 output :
4945 path = "resources/automatic/global/slope.tif" ,
5046 log :
5147 "logs/download_slope.log" ,
5248 conda :
5349 "../envs/shell.yaml"
50+ params :
51+ url = internal ["resources" ]["automatic" ]["slope" ],
52+ message :
53+ "Download global slope data."
5454 shell :
5555 """
5656 curl -sSLo {output:q} {params.url:q}
5757 """
5858
5959 rule download_bathymetry :
60- message :
61- "Download global bathymetry data."
62- params :
63- url = internal ["resources" ]["automatic" ]["bathymetry" ],
6460 output :
6561 path = "resources/automatic/global/bathymetry.tif" ,
6662 log :
6763 "logs/download_bathymetry.log" ,
6864 conda :
6965 "../envs/shell.yaml"
66+ params :
67+ url = internal ["resources" ]["automatic" ]["bathymetry" ],
68+ message :
69+ "Download global bathymetry data."
7070 shell :
7171 """
7272 curl -sSLo {output:q} {params.url:q}
7373 """
7474
7575 rule clip_slope :
76- message :
77- "Cut slope data to the bounds of the input shapefile."
7876 input :
7977 script = workflow .source_path ("../scripts/clip_raster.py" ),
8078 shapes = "resources/user/shapes/{shape}.parquet" ,
@@ -85,14 +83,14 @@ else:
8583 "logs/{shape}/clip_slope.log" ,
8684 conda :
8785 "../envs/default.yaml"
86+ message :
87+ "Cut slope data to the bounds of the input shapefile."
8888 shell :
8989 """
9090 python {input.script:q} {input.slope:q} {input.shapes:q} {output:q} 2> {log:q}
9191 """
9292
9393 rule clip_bathymetry :
94- message :
95- "Cut bathymetry data to the bounds of the input shapefile."
9694 input :
9795 script = workflow .source_path ("../scripts/clip_raster.py" ),
9896 shapes = "resources/user/shapes/{shape}.parquet" ,
@@ -103,6 +101,8 @@ else:
103101 "logs/{shape}/clip_bathymetry.log" ,
104102 conda :
105103 "../envs/default.yaml"
104+ message :
105+ "Cut bathymetry data to the bounds of the input shapefile."
106106 shell :
107107 """
108108 python {input.script:q} {input.bathymetry:q} {input.shapes:q} {output:q} 2> {log:q}
@@ -115,27 +115,23 @@ else:
115115
116116
117117rule download_globcover :
118- message :
119- "Download the GlobCover land cover data (~380 MB)."
120- params :
121- url = internal ["resources" ]["automatic" ]["globcover" ],
122118 output :
123119 "resources/automatic/global/globcover.zip" ,
124120 log :
125121 "logs/download_globcover.log" ,
126122 conda :
127123 "../envs/shell.yaml"
124+ params :
125+ url = internal ["resources" ]["automatic" ]["globcover" ],
126+ message :
127+ "Download the GlobCover land cover data (~380 MB)."
128128 shell :
129129 """
130130 curl -sSLo {output:q} {params.url:q}
131131 """
132132
133133
134134rule unzip_globcover :
135- message :
136- "Unzip the relevant TIF files from the GlobCover zip file."
137- params :
138- target_file = internal ["resources" ]["automatic" ]["globcover_landcover_tif" ],
139135 input :
140136 script = workflow .source_path ("../scripts/unzip_like.py" ),
141137 zipfile = rules .download_globcover .output ,
@@ -145,15 +141,17 @@ rule unzip_globcover:
145141 "logs/unzip_globcover.log" ,
146142 conda :
147143 "../envs/shell.yaml"
144+ params :
145+ target_file = internal ["resources" ]["automatic" ]["globcover_landcover_tif" ],
146+ message :
147+ "Unzip the relevant TIF files from the GlobCover zip file."
148148 shell :
149149 """
150150 python {input.script:q} {input.zipfile:q} -f {params.target_file:q} -o {output:q} 2> {log:q}
151151 """
152152
153153
154154rule clip_landcover :
155- message :
156- "Cut land cover data to the bounds of the input shapefile."
157155 input :
158156 script = workflow .source_path ("../scripts/clip_raster.py" ),
159157 shapes = "resources/user/shapes/{shape}.parquet" ,
@@ -164,6 +162,8 @@ rule clip_landcover:
164162 "logs/{shape}/clip_landcover.log" ,
165163 conda :
166164 "../envs/default.yaml"
165+ message :
166+ "Cut land cover data to the bounds of the input shapefile."
167167 shell :
168168 """
169169 python {input.script:q} {input.landcover:q} {input.shapes:q} {output:q} 2> {log:q}
@@ -176,27 +176,23 @@ rule clip_landcover:
176176
177177
178178rule download_ghsl :
179- message :
180- "Download the GHSL (Global Human Settlement Layer) built-up surface data."
181- params :
182- url = internal ["resources" ]["automatic" ]["ghsl" ],
183179 output :
184180 "resources/automatic/global/ghsl_built_s.zip" ,
185181 log :
186182 "logs/download_ghsl.log" ,
187183 conda :
188184 "../envs/shell.yaml"
185+ params :
186+ url = internal ["resources" ]["automatic" ]["ghsl" ],
187+ message :
188+ "Download the GHSL (Global Human Settlement Layer) built-up surface data."
189189 shell :
190190 """
191191 curl -sSLo {output:q} {params.url:q}
192192 """
193193
194194
195195rule unzip_ghsl :
196- message :
197- "Unzip the relevant TIF file from the GHSL data."
198- params :
199- target_file = internal ["resources" ]["automatic" ]["ghsl_tif" ],
200196 input :
201197 script = workflow .source_path ("../scripts/unzip_like.py" ),
202198 zipfile = rules .download_ghsl .output ,
@@ -206,15 +202,17 @@ rule unzip_ghsl:
206202 "logs/unzip_ghsl.log" ,
207203 conda :
208204 "../envs/shell.yaml"
205+ params :
206+ target_file = internal ["resources" ]["automatic" ]["ghsl_tif" ],
207+ message :
208+ "Unzip the relevant TIF file from the GHSL data."
209209 shell :
210210 """
211211 python {input.script:q} {input.zipfile:q} -f {params.target_file:q} -o {output:q} 2> {log:q}
212212 """
213213
214214
215215rule clip_settlement :
216- message :
217- "Cut settlement data to the bounds of the input shapefile."
218216 input :
219217 script = workflow .source_path ("../scripts/clip_raster.py" ),
220218 shapes = "resources/user/shapes/{shape}.parquet" ,
@@ -225,6 +223,8 @@ rule clip_settlement:
225223 "logs/{shape}/clip_settlement.log" ,
226224 conda :
227225 "../envs/default.yaml"
226+ message :
227+ "Cut settlement data to the bounds of the input shapefile."
228228 shell :
229229 """
230230 python {input.script:q} {input.settlement:q} {input.shapes:q} {output:q} 2> {log:q}
@@ -237,8 +237,6 @@ rule clip_settlement:
237237
238238
239239rule rasterise_clip_wdpa :
240- message :
241- "Rasterise and cut WDPA data to the bounds of the input shapefile, using the landcover raster as reference for the rasterisation."
242240 input :
243241 script = workflow .source_path ("../scripts/clip_and_rasterise_polys.py" ),
244242 shapes = "resources/user/shapes/{shape}.parquet" ,
@@ -250,6 +248,8 @@ rule rasterise_clip_wdpa:
250248 "logs/{shape}/clip_wdpa.log" ,
251249 conda :
252250 "../envs/default.yaml"
251+ message :
252+ "Rasterise and cut WDPA data to the bounds of the input shapefile, using the landcover raster as reference for the rasterisation."
253253 shell :
254254 """
255255 python {input.script:q} {input.shapes:q} {input.reference_raster:q} {input.protected_areas:q} {output:q} 2> {log:q}
0 commit comments