118
118
<!--/radix_placeholder_rmarkdown_metadata-->
119
119
120
120
< script type ="text/json " id ="radix-resource-manifest ">
121
- { "type" :"character" , "attributes" :{ } , "value" :[ "rastertemplate_files/anchor-4.2.2/anchor.min.js" , "rastertemplate_files/bowser-1.9.3/bowser.min.js" , "rastertemplate_files/distill-2.2.21/template.v2.js" , "rastertemplate_files/figure-html5/plot-1.png" , "rastertemplate_files/figure-html5/plot template-1.png" , "rastertemplate_files/figure-html5/template-1.png" , "rastertemplate_files/figure-html5/unnamed-chunk-2-1.png" , "rastertemplate_files/figure-html5/unnamed-chunk-3-1.png" , "rastertemplate_files/figure-html5/unnamed-chunk-4-1.png" , "rastertemplate_files/figure-html5/unnamed-chunk-5-1.png" , "rastertemplate_files/figure-html5/unnamed-chunk-6-1.png" , "rastertemplate_files/figure-html5/unnamed-chunk-7-1.png" , "rastertemplate_files/figure-html5/unnamed-chunk-8-1.png" , "rastertemplate_files/figure-html5/unnamed-chunk-9-1.png" , "rastertemplate_files/header-attrs-2.23/header-attrs.js" , "rastertemplate_files/header-attrs-2.24/header-attrs.js" , "rastertemplate_files/jquery-3.6.0/jquery-3.6.0.js" , "rastertemplate_files/jquery-3.6.0/jquery-3.6.0.min.js" , "rastertemplate_files/jquery-3.6.0/jquery-3.6.0.min.map" , "rastertemplate_files/popper-2.6.0/popper.min.js" , "rastertemplate_files/tippy-6.2.7/tippy-bundle.umd.min.js" , "rastertemplate_files/tippy-6.2.7/tippy-light-border.css" , "rastertemplate_files/tippy-6.2.7/tippy.css" , "rastertemplate_files/tippy-6.2.7/tippy.umd.min.js" , "rastertemplate_files/webcomponents-2.0.0/webcomponents.js" ] }
121
+ { "type" :"character" , "attributes" :{ } , "value" :[ "rastertemplate_files/anchor-4.2.2/anchor.min.js" , "rastertemplate_files/bowser-1.9.3/bowser.min.js" , "rastertemplate_files/distill-2.2.21/template.v2.js" , "rastertemplate_files/figure-html5/plot-1.png" , "rastertemplate_files/figure-html5/plot template-1.png" , "rastertemplate_files/figure-html5/template-1.png" , "rastertemplate_files/figure-html5/unnamed-chunk-11-1.png" , "rastertemplate_files/figure-html5/unnamed-chunk-11-2.png" , "rastertemplate_files/figure-html5/unnamed-chunk-2-1.png" , "rastertemplate_files/figure-html5/unnamed-chunk-3-1.png" , "rastertemplate_files/figure-html5/unnamed-chunk-4-1.png" , "rastertemplate_files/figure-html5/unnamed-chunk-5-1.png" , "rastertemplate_files/figure-html5/unnamed-chunk-6-1.png" , "rastertemplate_files/figure-html5/unnamed-chunk-7-1.png" , "rastertemplate_files/figure-html5/unnamed-chunk-8-1.png" , "rastertemplate_files/figure-html5/unnamed-chunk-9-1.png" , "rastertemplate_files/header-attrs-2.23/header-attrs.js" , "rastertemplate_files/header-attrs-2.24/header-attrs.js" , "rastertemplate_files/jquery-3.6.0/jquery-3.6.0.js" , "rastertemplate_files/jquery-3.6.0/jquery-3.6.0.min.js" , "rastertemplate_files/jquery-3.6.0/jquery-3.6.0.min.map" , "rastertemplate_files/popper-2.6.0/popper.min.js" , "rastertemplate_files/tippy-6.2.7/tippy-bundle.umd.min.js" , "rastertemplate_files/tippy-6.2.7/tippy-light-border.css" , "rastertemplate_files/tippy-6.2.7/tippy.css" , "rastertemplate_files/tippy-6.2.7/tippy.umd.min.js" , "rastertemplate_files/webcomponents-2.0.0/webcomponents.js" ] }
122
122
</ script >
123
123
<!--radix_placeholder_navigation_in_header-->
124
124
<!--/radix_placeholder_navigation_in_header-->
230
230
display : none !important ;
231
231
}
232
232
233
+ hr .section-separator {
234
+ border : none;
235
+ border-top : 1px solid rgba (0 , 0 , 0 , 0.1 );
236
+ margin : 0px ;
237
+ }
238
+
239
+
240
+ d-byline {
241
+ border-top : none;
242
+ }
243
+
233
244
d-article {
234
245
padding-top : 2.5rem ;
235
246
padding-bottom : 30px ;
247
+ border-top : none;
236
248
}
237
249
238
250
d-appendix {
329
341
font-size : 14px ;
330
342
}
331
343
344
+ /* tweak for Pandoc numbered line within distill */
345
+ d-article pre .numberSource code > span {
346
+ left : -2em ;
347
+ }
348
+
332
349
d-article pre {
333
350
font-size : 14px ;
334
351
}
1088
1105
// create d-title
1089
1106
$ ( '.d-title' ) . changeElementType ( 'd-title' ) ;
1090
1107
1108
+ // separator
1109
+ var separator = '<hr class="section-separator" style="clear: both"/>' ;
1110
+ // prepend separator above appendix
1111
+ $ ( '.d-byline' ) . before ( separator ) ;
1112
+ $ ( '.d-article' ) . before ( separator ) ;
1113
+
1091
1114
// create d-byline
1092
1115
var byline = $ ( '<d-byline></d-byline>' ) ;
1093
1116
$ ( '.d-byline' ) . replaceWith ( byline ) ;
1165
1188
$ ( '.distill-force-highlighting-css' ) . parent ( ) . remove ( ) ;
1166
1189
1167
1190
// remove empty line numbers inserted by pandoc when using a
1168
- // custom syntax highlighting theme
1169
- $ ( 'code.sourceCode a:empty' ) . remove ( ) ;
1191
+ // custom syntax highlighting theme, except when numbering line
1192
+ // in code chunk
1193
+ $ ( 'pre:not(.numberLines) code.sourceCode a:empty' ) . remove ( ) ;
1170
1194
1171
1195
// load distill framework
1172
1196
load_distill_framework ( ) ;
1192
1216
// add orcid ids
1193
1217
$ ( '.authors-affiliations' ) . find ( '.author' ) . each ( function ( i , el ) {
1194
1218
var orcid_id = front_matter . authors [ i ] . orcidID ;
1219
+ var author_name = front_matter . authors [ i ] . author
1195
1220
if ( orcid_id ) {
1196
1221
var a = $ ( '<a></a>' ) ;
1197
1222
a . attr ( 'href' , 'https://orcid.org/' + orcid_id ) ;
1198
1223
var img = $ ( '<img></img>' ) ;
1199
1224
img . addClass ( 'orcid-id' ) ;
1200
- img . attr ( 'alt' , 'ORCID ID' ) ;
1225
+ img . attr ( 'alt' , author_name ? 'ORCID ID for ' + author_name : 'ORCID ID' ) ;
1201
1226
img . attr ( 'src' , 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA2ZpVFh0WE1MOmNvb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GNkRBODU3Ii8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+84NovQAAAR1JREFUeNpiZEADy85ZJgCpeCB2QJM6AMQLo4yOL0AWZETSqACk1gOxAQN+cAGIA4EGPQBxmJA0nwdpjjQ8xqArmczw5tMHXAaALDgP1QMxAGqzAAPxQACqh4ER6uf5MBlkm0X4EGayMfMw/Pr7Bd2gRBZogMFBrv01hisv5jLsv9nLAPIOMnjy8RDDyYctyAbFM2EJbRQw+aAWw/LzVgx7b+cwCHKqMhjJFCBLOzAR6+lXX84xnHjYyqAo5IUizkRCwIENQQckGSDGY4TVgAPEaraQr2a4/24bSuoExcJCfAEJihXkWDj3ZAKy9EJGaEo8T0QSxkjSwORsCAuDQCD+QILmD1A9kECEZgxDaEZhICIzGcIyEyOl2RkgwAAhkmC+eAm0TAAAAABJRU5ErkJggg==' ) ;
1202
1227
a . append ( img ) ;
1203
1228
$ ( this ) . append ( a ) ;
1475
1500
</ script >
1476
1501
1477
1502
<!--/radix_placeholder_distill-->
1478
- < script src ="rastertemplate_files/header-attrs-2.24 /header-attrs.js "> </ script >
1503
+ < script src ="rastertemplate_files/header-attrs-2.25 /header-attrs.js "> </ script >
1479
1504
< script src ="rastertemplate_files/jquery-3.6.0/jquery-3.6.0.min.js "> </ script >
1480
1505
< script src ="rastertemplate_files/popper-2.6.0/popper.min.js "> </ script >
1481
1506
< link href ="rastertemplate_files/tippy-6.2.7/tippy.css " rel ="stylesheet " />
1507
1532
1508
1533
< div class ="d-title ">
1509
1534
< h1 > Raster Operations</ h1 >
1535
+
1510
1536
<!--radix_placeholder_categories-->
1511
1537
< div class ="dt-tags ">
1512
1538
< div class ="dt-tag "> tutorial</ div >
@@ -1589,7 +1615,7 @@ <h2 id="template">Raster Template</h2>
1589
1615
min value : 1
1590
1616
max value : 1 </ code > </ pre >
1591
1617
</ div >
1592
- < p > We load Berlin borders from the cloud to show the borders</ p >
1618
+ < p > We load Berlin districts data set from our cloud to show the borders of berlin </ p >
1593
1619
< div class ="layout-chunk " data-layout ="l-body ">
1594
1620
< div class ="sourceCode ">
1595
1621
< pre class ="sourceCode r "> < code class ="sourceCode r "> < span > < span class ='va '> berlin</ span > < span class ='op '> <-</ span > < span class ='fu '> d6geodata</ span > < span class ='fu '> ::</ span > < span class ='fu '> < a href ='https://rdrr.io/pkg/d6geodata/man/get_geodata.html '> get_geodata</ a > </ span > < span class ='op '> (</ span > data_name < span class ='op '> =</ span > < span class ='st '> "districs_berlin_2022_poly_03035_gpkg"</ span > ,</ span >
@@ -1745,7 +1771,7 @@ <h3 id="extraction-from-line">Extraction From Line</h3>
1745
1771
< span > < span class ='op '> )</ span > </ span > </ code > </ pre >
1746
1772
</ div >
1747
1773
</ div >
1748
- < p > As you can see, the largest part of the line lays within the purple area and </ p >
1774
+ < p > As you already can see on the plot , the largest part of the line lays within the purple area (1). This function can be used in cases such as </ p >
1749
1775
< div class ="layout-chunk " data-layout ="l-body ">
1750
1776
< div class ="sourceCode ">
1751
1777
< pre class ="sourceCode r "> < code class ="sourceCode r "> < span > < span class ='fu '> < a href ='https://rdrr.io/r/base/table.html '> table</ a > </ span > < span class ='op '> (</ span > < span class ='va '> ext_tab</ span > < span class ='op '> $</ span > < span class ='va '> layer</ span > < span class ='op '> )</ span > </ span > </ code > </ pre >
@@ -1754,6 +1780,22 @@ <h3 id="extraction-from-line">Extraction From Line</h3>
1754
1780
1 2
1755
1781
463 23 </ code > </ pre >
1756
1782
</ div >
1783
+ < p > Additional example: Plotting data with < code > {tidyterra}</ code > </ p >
1784
+ < div class ="layout-chunk " data-layout ="l-body ">
1785
+ < div class ="sourceCode ">
1786
+ < pre class ="sourceCode r "> < code class ="sourceCode r "> < span > < span class ='kw '> < a href ='https://rdrr.io/r/base/library.html '> library</ a > </ span > < span class ='op '> (</ span > < span class ='va '> < a href ='https://dieghernan.github.io/tidyterra/ '> tidyterra</ a > </ span > < span class ='op '> )</ span > </ span >
1787
+ < span > </ span >
1788
+ < span > < span class ='fu '> < a href ='https://ggplot2.tidyverse.org/reference/ggplot.html '> ggplot</ a > </ span > < span class ='op '> (</ span > < span class ='op '> )</ span > < span class ='op '> +</ span > </ span >
1789
+ < span > < span class ='fu '> < a href ='https://dieghernan.github.io/tidyterra/reference/geom_spatraster.html '> geom_spatraster</ a > </ span > < span class ='op '> (</ span > data < span class ='op '> =</ span > < span class ='va '> temp_rast</ span > < span class ='op '> )</ span > </ span > </ code > </ pre >
1790
+ </ div >
1791
+ < img src ="rastertemplate_files/figure-html5/unnamed-chunk-11-1.png " width ="624 " />
1792
+ < div class ="sourceCode ">
1793
+ < pre class ="sourceCode r "> < code class ="sourceCode r "> < span > < span class ='fu '> < a href ='https://ggplot2.tidyverse.org/reference/ggplot.html '> ggplot</ a > </ span > < span class ='op '> (</ span > < span class ='op '> )</ span > < span class ='op '> +</ span > </ span >
1794
+ < span > < span class ='fu '> < a href ='https://dieghernan.github.io/tidyterra/reference/geom_spatraster.html '> geom_spatraster</ a > </ span > < span class ='op '> (</ span > data < span class ='op '> =</ span > < span class ='va '> temp_rast</ span > < span class ='op '> )</ span > < span class ='op '> +</ span > </ span >
1795
+ < span > < span class ='fu '> < a href ='https://dieghernan.github.io/tidyterra/reference/scale_whitebox.html '> scale_fill_whitebox_c</ a > </ span > < span class ='op '> (</ span > palette < span class ='op '> =</ span > < span class ='st '> "purple"</ span > < span class ='op '> )</ span > </ span > </ code > </ pre >
1796
+ </ div >
1797
+ < p > < img src ="rastertemplate_files/figure-html5/unnamed-chunk-11-2.png " width ="624 " /> </ p >
1798
+ </ div >
1757
1799
< h2 id ="summary "> Summary</ h2 >
1758
1800
< p > You learned how to extend a raster and how to extract data from a raster by using < code > {sf}</ code > and < code > {terra}</ code > . Of course there are several ways to do this, but this the most convenient way!!!</ p >
1759
1801
< div class ="sourceCode " id ="cb5 "> < pre class ="sourceCode r distill-force-highlighting-css "> < code class ="sourceCode r "> </ code > </ pre > </ div >
0 commit comments