118118  <!--/radix_placeholder_rmarkdown_metadata--> 
119119
120120  < 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" ] } 
122122  </ script > 
123123  <!--radix_placeholder_navigation_in_header--> 
124124  <!--/radix_placeholder_navigation_in_header--> 
230230    display :  none !important ;
231231  }
232232
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+ 
233244  d-article  {
234245    padding-top :  2.5rem  ;
235246    padding-bottom :  30px  ;
247+     border-top :  none;
236248  }
237249
238250  d-appendix  {
329341    font-size :  14px  ;
330342  }
331343
344+   /* tweak for Pandoc numbered line within distill */ 
345+   d-article  pre .numberSource  code  >  span  {
346+       left :  -2em  ;
347+   }
348+ 
332349  d-article  pre  {
333350    font-size :  14px  ;
334351  }
10881105    // create d-title 
10891106    $ ( '.d-title' ) . changeElementType ( 'd-title' ) ; 
10901107
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+ 
10911114    // create d-byline 
10921115    var  byline  =  $ ( '<d-byline></d-byline>' ) ; 
10931116    $ ( '.d-byline' ) . replaceWith ( byline ) ; 
11651188    $ ( '.distill-force-highlighting-css' ) . parent ( ) . remove ( ) ; 
11661189
11671190    // 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 ( ) ; 
11701194
11711195    // load distill framework 
11721196    load_distill_framework ( ) ; 
11921216      // add orcid ids 
11931217      $ ( '.authors-affiliations' ) . find ( '.author' ) . each ( function ( i ,  el )  { 
11941218        var  orcid_id  =  front_matter . authors [ i ] . orcidID ; 
1219+         var  author_name  =  front_matter . authors [ i ] . author 
11951220        if  ( orcid_id )  { 
11961221          var  a  =  $ ( '<a></a>' ) ; 
11971222          a . attr ( 'href' ,  'https://orcid.org/'  +  orcid_id ) ; 
11981223          var  img  =  $ ( '<img></img>' ) ; 
11991224          img . addClass ( 'orcid-id' ) ; 
1200-           img . attr ( 'alt' ,  'ORCID ID' ) ; 
1225+           img . attr ( 'alt' ,  author_name  ?  'ORCID ID for '   +   author_name  :  'ORCID ID' ) ; 
12011226          img . attr ( 'src' , 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA2Z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TE5OTRDOTM1MTNGNkRBODU3Ii8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+84NovQAAAR1JREFUeNpiZEADy85ZJgCpeCB2QJM6AMQLo4yOL0AWZETSqACk1gOxAQN+cAGIA4EGPQBxmJA0nwdpjjQ8xqArmczw5tMHXAaALDgP1QMxAGqzAAPxQACqh4ER6uf5MBlkm0X4EGayMfMw/Pr7Bd2gRBZogMFBrv01hisv5jLsv9nLAPIOMnjy8RDDyYctyAbFM2EJbRQw+aAWw/LzVgx7b+cwCHKqMhjJFCBLOzAR6+lXX84xnHjYyqAo5IUizkRCwIENQQckGSDGY4TVgAPEaraQr2a4/24bSuoExcJCfAEJihXkWDj3ZAKy9EJGaEo8T0QSxkjSwORsCAuDQCD+QILmD1A9kECEZgxDaEZhICIzGcIyEyOl2RkgwAAhkmC+eAm0TAAAAABJRU5ErkJggg==' ) ; 
12021227          a . append ( img ) ; 
12031228          $ ( this ) . append ( a ) ; 
14751500  </ script > 
14761501
14771502  <!--/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 > 
14791504  < script  src ="rastertemplate_files/jquery-3.6.0/jquery-3.6.0.min.js "> </ script > 
14801505  < script  src ="rastertemplate_files/popper-2.6.0/popper.min.js "> </ script > 
14811506  < link  href ="rastertemplate_files/tippy-6.2.7/tippy.css " rel ="stylesheet " /> 
15071532
15081533< div  class ="d-title "> 
15091534< h1 > Raster Operations</ h1 > 
1535+ 
15101536<!--radix_placeholder_categories--> 
15111537< div  class ="dt-tags "> 
15121538< div  class ="dt-tag "> tutorial</ div > 
@@ -1589,7 +1615,7 @@ <h2 id="template">Raster Template</h2>
15891615min value   :    1 
15901616max value   :    1 </ code > </ pre > 
15911617</ 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 > 
15931619< div  class ="layout-chunk " data-layout ="l-body "> 
15941620< div  class ="sourceCode "> 
15951621< 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>
17451771< span >                < span  class ='op '> )</ span > </ span > </ code > </ pre > 
17461772</ div > 
17471773</ 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 > 
17491775< div  class ="layout-chunk " data-layout ="l-body "> 
17501776< div  class ="sourceCode "> 
17511777< 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>
17541780  1   2 
17551781463  23 </ code > </ pre > 
17561782</ 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 > 
17571799< h2  id ="summary "> Summary</ h2 > 
17581800< 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 > 
17591801< div  class ="sourceCode " id ="cb5 "> < pre  class ="sourceCode r distill-force-highlighting-css "> < code  class ="sourceCode r "> </ code > </ pre > </ div > 
0 commit comments