From 19c7e035502aee6ec1e3d2c97d9ee5ec9220eae2 Mon Sep 17 00:00:00 2001 From: Aariq Date: Tue, 7 Jan 2025 17:11:32 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20njtierne?= =?UTF-8?q?y/geotargets@044536bddbdd65a203f38a3c7a0170d8e93382ae=20?= =?UTF-8?q?=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- articles/geotargets.html | 18 +++++++++--------- articles/tar_terra_tiles.html | 20 ++++++++++---------- pkgdown.yml | 2 +- search.json | 2 +- 4 files changed, 21 insertions(+), 21 deletions(-) diff --git a/articles/geotargets.html b/articles/geotargets.html index 7f66c84..83f6902 100644 --- a/articles/geotargets.html +++ b/articles/geotargets.html @@ -131,12 +131,12 @@

#> Error in get(paste0(generic, ".", class), envir = get_method_env()) : #> object 'type_sum.accel' not found #> ▶ dispatched target tif_file -#> ● completed target tif_file [0.009 seconds, 7.994 kilobytes] +#> ● completed target tif_file [0.008 seconds, 7.994 kilobytes] #> ▶ dispatched target r #> ● completed target r [0.003 seconds, 10.433 kilobytes] #> ▶ dispatched target r_agg #> ● completed target r_agg [0.003 seconds, 6.303 kilobytes] -#> ▶ ended pipeline [0.134 seconds] +#> ▶ ended pipeline [0.129 seconds] #> tar_read(r) #> class : SpatRaster @@ -205,7 +205,7 @@

Raster metadata#> ✔ skipped target tif_file #> ▶ dispatched target r #> ● completed target r [0.004 seconds, 10.252 kilobytes] -#> ▶ ended pipeline [0.134 seconds] +#> ▶ ended pipeline [0.127 seconds] #> terra::units(tar_read(r)) #> [1] "" @@ -246,12 +246,12 @@

#> Error in get(paste0(generic, ".", class), envir = get_method_env()) : #> object 'type_sum.accel' not found #> ▶ dispatched target vect_file -#> ● completed target vect_file [0.001 seconds, 64.692 kilobytes] +#> ● completed target vect_file [0 seconds, 64.692 kilobytes] #> ▶ dispatched target v #> ● completed target v [0.009 seconds, 117.629 kilobytes] #> ▶ dispatched target v_proj #> ● completed target v_proj [0.016 seconds, 213.534 kilobytes] -#> ▶ ended pipeline [0.131 seconds] +#> ▶ ended pipeline [0.128 seconds] #> tar_read(v) #> class : SpatVector @@ -328,8 +328,8 @@

#> ▶ dispatched target r #> ● completed target r [0.003 seconds, 959.703 kilobytes] #> ▶ dispatched target raster_elevs -#> ● completed target raster_elevs [0.056 seconds, 37.904 kilobytes] -#> ▶ ended pipeline [1.076 seconds] +#> ● completed target raster_elevs [0.055 seconds, 37.904 kilobytes] +#> ▶ ended pipeline [1.072 seconds] #> tar_read(raster_elevs) #> class : SpatRasterCollection @@ -376,8 +376,8 @@

#> ▶ dispatched target logo_file #> ● completed target logo_file [0.008 seconds, 22.458 kilobytes] #> ▶ dispatched target raster_dataset -#> ● completed target raster_dataset [0.03 seconds, 54.735 kilobytes] -#> ▶ ended pipeline [0.137 seconds] +#> ● completed target raster_dataset [0.031 seconds, 54.735 kilobytes] +#> ▶ ended pipeline [0.136 seconds] #> tar_read(raster_dataset) #> class : SpatRasterDataset diff --git a/articles/tar_terra_tiles.html b/articles/tar_terra_tiles.html index e87430b..fae7ace 100644 --- a/articles/tar_terra_tiles.html +++ b/articles/tar_terra_tiles.html @@ -338,10 +338,10 @@

Example targets pipeline#> ▶ dispatched target raster_file #> ● completed target raster_file [0.001 seconds, 7.994 kilobytes] #> ▶ dispatched target r -#> ● completed target r [0.01 seconds, 822.781 kilobytes] +#> ● completed target r [0.009 seconds, 822.781 kilobytes] #> ▶ dispatched target r_big #> ● completed target r_big [0.024 seconds, 4.055 megabytes] -#> ▶ ended pipeline [0.42 seconds] +#> ▶ ended pipeline [0.416 seconds] #> tar_load(r_big) tile_blocksize(r_big) @@ -448,28 +448,28 @@

Example targets pipeline#> ✔ skipped target r #> ✔ skipped target r_big #> ▶ dispatched target tiles_exts -#> ● completed target tiles_exts [0.006 seconds, 153 bytes] +#> ● completed target tiles_exts [0.005 seconds, 153 bytes] #> ▶ dispatched branch tiles_11882e184aa27102 #> ● completed branch tiles_11882e184aa27102 [0.003 seconds, 982.55 kilobytes] #> ▶ dispatched branch tiles_e39b1bcab4d45ba0 -#> ● completed branch tiles_e39b1bcab4d45ba0 [0.037 seconds, 249.778 kilobytes] +#> ● completed branch tiles_e39b1bcab4d45ba0 [0.036 seconds, 249.778 kilobytes] #> ▶ dispatched branch tiles_b14b762418a51f63 -#> ● completed branch tiles_b14b762418a51f63 [0.002 seconds, 599.615 kilobytes] +#> ● completed branch tiles_b14b762418a51f63 [0.003 seconds, 599.615 kilobytes] #> ▶ dispatched branch tiles_bfb55de5c880456f #> ● completed branch tiles_bfb55de5c880456f [0.003 seconds, 483.702 kilobytes] #> ● completed pattern tiles #> ▶ dispatched branch tiles_mean_1bcefdb80d0879e0 -#> ● completed branch tiles_mean_1bcefdb80d0879e0 [2.166 seconds, 159.194 kilobytes] +#> ● completed branch tiles_mean_1bcefdb80d0879e0 [2.124 seconds, 159.194 kilobytes] #> ▶ dispatched branch tiles_mean_4ff32c943e05dc36 -#> ● completed branch tiles_mean_4ff32c943e05dc36 [1.895 seconds, 49.028 kilobytes] +#> ● completed branch tiles_mean_4ff32c943e05dc36 [1.867 seconds, 49.028 kilobytes] #> ▶ dispatched branch tiles_mean_17723520c935f474 -#> ● completed branch tiles_mean_17723520c935f474 [1.637 seconds, 100.948 kilobytes] +#> ● completed branch tiles_mean_17723520c935f474 [1.585 seconds, 100.948 kilobytes] #> ▶ dispatched branch tiles_mean_984998bf0804c2cf -#> ● completed branch tiles_mean_984998bf0804c2cf [1.449 seconds, 87.272 kilobytes] +#> ● completed branch tiles_mean_984998bf0804c2cf [1.415 seconds, 87.272 kilobytes] #> ● completed pattern tiles_mean #> ▶ dispatched target merged_mean #> ● completed target merged_mean [0.015 seconds, 879.912 kilobytes] -#> ▶ ended pipeline [7.693 seconds] +#> ▶ ended pipeline [7.558 seconds] #>

We can see from tar_make() output above and the plots below that tiles and tiles_mean are both diff --git a/pkgdown.yml b/pkgdown.yml index 3c36756..b3a36ab 100644 --- a/pkgdown.yml +++ b/pkgdown.yml @@ -4,7 +4,7 @@ pkgdown_sha: ~ articles: geotargets: geotargets.html tar_terra_tiles: tar_terra_tiles.html -last_built: 2025-01-06T22:06Z +last_built: 2025-01-07T17:10Z urls: reference: https://njtierney.github.io/geotargets/reference article: https://njtierney.github.io/geotargets/articles diff --git a/search.json b/search.json index a8f3158..863bd47 100644 --- a/search.json +++ b/search.json @@ -1 +1 @@ -[{"path":[]},{"path":"https://njtierney.github.io/geotargets/CODE_OF_CONDUCT.html","id":"our-pledge","dir":"","previous_headings":"","what":"Our Pledge","title":"Contributor Covenant Code of Conduct","text":"members, contributors, leaders pledge make participation community harassment-free experience everyone, regardless age, body size, visible invisible disability, ethnicity, sex characteristics, gender identity expression, level experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, sexual identity orientation. pledge act interact ways contribute open, welcoming, diverse, inclusive, healthy community.","code":""},{"path":"https://njtierney.github.io/geotargets/CODE_OF_CONDUCT.html","id":"our-standards","dir":"","previous_headings":"","what":"Our Standards","title":"Contributor Covenant Code of Conduct","text":"Examples behavior contributes positive environment community include: Demonstrating empathy kindness toward people respectful differing opinions, viewpoints, experiences Giving gracefully accepting constructive feedback Accepting responsibility apologizing affected mistakes, learning experience Focusing best just us individuals, overall community Examples unacceptable behavior include: use sexualized language imagery, sexual attention advances kind Trolling, insulting derogatory comments, personal political attacks Public private harassment Publishing others’ private information, physical email address, without explicit permission conduct reasonably considered inappropriate professional setting","code":""},{"path":"https://njtierney.github.io/geotargets/CODE_OF_CONDUCT.html","id":"enforcement-responsibilities","dir":"","previous_headings":"","what":"Enforcement Responsibilities","title":"Contributor Covenant Code of Conduct","text":"Community leaders responsible clarifying enforcing standards acceptable behavior take appropriate fair corrective action response behavior deem inappropriate, threatening, offensive, harmful. Community leaders right responsibility remove, edit, reject comments, commits, code, wiki edits, issues, contributions aligned Code Conduct, communicate reasons moderation decisions appropriate.","code":""},{"path":"https://njtierney.github.io/geotargets/CODE_OF_CONDUCT.html","id":"scope","dir":"","previous_headings":"","what":"Scope","title":"Contributor Covenant Code of Conduct","text":"Code Conduct applies within community spaces, also applies individual officially representing community public spaces. Examples representing community include using official e-mail address, posting via official social media account, acting appointed representative online offline event.","code":""},{"path":"https://njtierney.github.io/geotargets/CODE_OF_CONDUCT.html","id":"enforcement","dir":"","previous_headings":"","what":"Enforcement","title":"Contributor Covenant Code of Conduct","text":"Instances abusive, harassing, otherwise unacceptable behavior may reported community leaders responsible enforcement nicholas.tierney@gmail.com. complaints reviewed investigated promptly fairly. community leaders obligated respect privacy security reporter incident.","code":""},{"path":"https://njtierney.github.io/geotargets/CODE_OF_CONDUCT.html","id":"enforcement-guidelines","dir":"","previous_headings":"","what":"Enforcement Guidelines","title":"Contributor Covenant Code of Conduct","text":"Community leaders follow Community Impact Guidelines determining consequences action deem violation Code Conduct:","code":""},{"path":"https://njtierney.github.io/geotargets/CODE_OF_CONDUCT.html","id":"id_1-correction","dir":"","previous_headings":"Enforcement Guidelines","what":"1. Correction","title":"Contributor Covenant Code of Conduct","text":"Community Impact: Use inappropriate language behavior deemed unprofessional unwelcome community. Consequence: private, written warning community leaders, providing clarity around nature violation explanation behavior inappropriate. public apology may requested.","code":""},{"path":"https://njtierney.github.io/geotargets/CODE_OF_CONDUCT.html","id":"id_2-warning","dir":"","previous_headings":"Enforcement Guidelines","what":"2. Warning","title":"Contributor Covenant Code of Conduct","text":"Community Impact: violation single incident series actions. Consequence: warning consequences continued behavior. interaction people involved, including unsolicited interaction enforcing Code Conduct, specified period time. includes avoiding interactions community spaces well external channels like social media. Violating terms may lead temporary permanent ban.","code":""},{"path":"https://njtierney.github.io/geotargets/CODE_OF_CONDUCT.html","id":"id_3-temporary-ban","dir":"","previous_headings":"Enforcement Guidelines","what":"3. Temporary Ban","title":"Contributor Covenant Code of Conduct","text":"Community Impact: serious violation community standards, including sustained inappropriate behavior. Consequence: temporary ban sort interaction public communication community specified period time. public private interaction people involved, including unsolicited interaction enforcing Code Conduct, allowed period. Violating terms may lead permanent ban.","code":""},{"path":"https://njtierney.github.io/geotargets/CODE_OF_CONDUCT.html","id":"id_4-permanent-ban","dir":"","previous_headings":"Enforcement Guidelines","what":"4. Permanent Ban","title":"Contributor Covenant Code of Conduct","text":"Community Impact: Demonstrating pattern violation community standards, including sustained inappropriate behavior, harassment individual, aggression toward disparagement classes individuals. Consequence: permanent ban sort public interaction within community.","code":""},{"path":"https://njtierney.github.io/geotargets/CODE_OF_CONDUCT.html","id":"attribution","dir":"","previous_headings":"","what":"Attribution","title":"Contributor Covenant Code of Conduct","text":"Code Conduct adapted Contributor Covenant, version 2.1, available https://www.contributor-covenant.org/version/2/1/code_of_conduct.html. Community Impact Guidelines inspired [Mozilla’s code conduct enforcement ladder][https://github.com/mozilla/inclusion]. answers common questions code conduct, see FAQ https://www.contributor-covenant.org/faq. Translations available https://www.contributor-covenant.org/translations.","code":""},{"path":"https://njtierney.github.io/geotargets/CONTRIBUTING.html","id":null,"dir":"","previous_headings":"","what":"Contributing to geotargets","title":"Contributing to geotargets","text":"outlines propose change geotargets. detailed discussion contributing tidyverse packages, please see development contributing guide code review principles.","code":""},{"path":"https://njtierney.github.io/geotargets/CONTRIBUTING.html","id":"fixing-typos","dir":"","previous_headings":"","what":"Fixing typos","title":"Contributing to geotargets","text":"can fix typos, spelling mistakes, grammatical errors documentation directly using GitHub web interface, long changes made source file. generally means ’ll need edit roxygen2 comments .R, .Rd file. can find .R file generates .Rd reading comment first line.","code":""},{"path":"https://njtierney.github.io/geotargets/CONTRIBUTING.html","id":"bigger-changes","dir":"","previous_headings":"","what":"Bigger changes","title":"Contributing to geotargets","text":"want make bigger change, ’s good idea first file issue make sure someone team agrees ’s needed. ’ve found bug, please file issue illustrates bug minimal reprex (also help write unit test, needed). See guide create great issue advice.","code":""},{"path":"https://njtierney.github.io/geotargets/CONTRIBUTING.html","id":"pull-request-process","dir":"","previous_headings":"Bigger changes","what":"Pull request process","title":"Contributing to geotargets","text":"Fork package clone onto computer. haven’t done , recommend using usethis::create_from_github(\"njtierney/geotargets\", fork = TRUE). Install development dependencies devtools::install_dev_deps(), make sure package passes R CMD check running devtools::check(). R CMD check doesn’t pass cleanly, ’s good idea ask help continuing. Create Git branch pull request (PR). recommend using usethis::pr_init(\"brief-description--change\"). Make changes, commit git, create PR running usethis::pr_push(), following prompts browser. title PR briefly describe change. body PR contain Fixes #issue-number. user-facing changes, add bullet top NEWS.md (.e. just first header). Follow style described https://style.tidyverse.org/news.html.","code":""},{"path":"https://njtierney.github.io/geotargets/CONTRIBUTING.html","id":"code-style","dir":"","previous_headings":"Bigger changes","what":"Code style","title":"Contributing to geotargets","text":"New code follow tidyverse style guide. can use styler package apply styles, please don’t restyle code nothing PR. use roxygen2, Markdown syntax, documentation. use testthat unit tests. Contributions test cases included easier accept.","code":""},{"path":"https://njtierney.github.io/geotargets/CONTRIBUTING.html","id":"code-of-conduct","dir":"","previous_headings":"","what":"Code of Conduct","title":"Contributing to geotargets","text":"Please note geotargets project released Contributor Code Conduct. contributing project agree abide terms.","code":""},{"path":"https://njtierney.github.io/geotargets/LICENSE.html","id":null,"dir":"","previous_headings":"","what":"MIT License","title":"MIT License","text":"Copyright (c) 2024 geotargets authors Permission hereby granted, free charge, person obtaining copy software associated documentation files (“Software”), deal Software without restriction, including without limitation rights use, copy, modify, merge, publish, distribute, sublicense, /sell copies Software, permit persons Software furnished , subject following conditions: copyright notice permission notice shall included copies substantial portions Software. SOFTWARE PROVIDED “”, WITHOUT WARRANTY KIND, EXPRESS IMPLIED, INCLUDING LIMITED WARRANTIES MERCHANTABILITY, FITNESS PARTICULAR PURPOSE NONINFRINGEMENT. EVENT SHALL AUTHORS COPYRIGHT HOLDERS LIABLE CLAIM, DAMAGES LIABILITY, WHETHER ACTION CONTRACT, TORT OTHERWISE, ARISING , CONNECTION SOFTWARE USE DEALINGS SOFTWARE.","code":""},{"path":"https://njtierney.github.io/geotargets/articles/geotargets.html","id":"tar_terra_rast-targets-with-terra-rasters","dir":"Articles","previous_headings":"","what":"tar_terra_rast(): targets with terra rasters","title":"Using `terra` with `geotargets`","text":"basic example showing use tar_terra_rast() targets pipeline. command tar_terra_rast() can function returns SpatRaster object. example, ’ve set output cloud optimized geotiff (“COG”), GDAL driver works terra::writeRaster() also work . can also set option target--target basis filetype argument tar_terra_rast(). Running pipeline:","code":"# contents of _targets.R: library(targets) library(geotargets) tar_option_set(packages = \"terra\") geotargets_option_set(gdal_raster_driver = \"COG\") list( tar_target( tif_file, system.file(\"ex/elev.tif\", package = \"terra\"), format = \"file\" ), tar_terra_rast( r, { rast <- rast(tif_file) units(rast) <- \"m\" rast } ), tar_terra_rast( r_agg, aggregate(r, 2) ) ) tar_make() #> Error in get(paste0(generic, \".\", class), envir = get_method_env()) : #> object 'type_sum.accel' not found #> ▶ dispatched target tif_file #> ● completed target tif_file [0.009 seconds, 7.994 kilobytes] #> ▶ dispatched target r #> ● completed target r [0.003 seconds, 10.433 kilobytes] #> ▶ dispatched target r_agg #> ● completed target r_agg [0.003 seconds, 6.303 kilobytes] #> ▶ ended pipeline [0.134 seconds] #> tar_read(r) #> class : SpatRaster #> dimensions : 90, 95, 1 (nrow, ncol, nlyr) #> resolution : 0.008333333, 0.008333333 (x, y) #> extent : 5.741667, 6.533333, 49.44167, 50.19167 (xmin, xmax, ymin, ymax) #> coord. ref. : lon/lat WGS 84 (EPSG:4326) #> source : r #> name : elevation #> min value : 141 #> max value : 547 tar_read(r_agg) #> class : SpatRaster #> dimensions : 45, 48, 1 (nrow, ncol, nlyr) #> resolution : 0.01666667, 0.01666667 (x, y) #> extent : 5.741667, 6.541667, 49.44167, 50.19167 (xmin, xmax, ymin, ymax) #> coord. ref. : lon/lat WGS 84 (EPSG:4326) #> source : r_agg #> name : elevation #> min value : 166.75 #> max value : 529.50"},{"path":"https://njtierney.github.io/geotargets/articles/geotargets.html","id":"raster-metadata","dir":"Articles","previous_headings":"tar_terra_rast(): targets with terra rasters","what":"Raster metadata","title":"Using `terra` with `geotargets`","text":"may noticed units r target gone missing. due limitations terra targets—terra saves metadata “sidecar” aux.json files targets enforces strict one file per target rule. can get around setting preserve_metadata = \"zip\" tar_terra_rast() save output files, including metadata, minimally compressed zip archive. can also set raster targets geotargets_option_set(terra_preserve_metadata = \"zip\"). Note: likely performance costs associated option. alternative, can encode information layer names setting names(r) <- retained even default preserve_metadata = \"drop\".","code":"# contents of _targets.R: library(targets) library(geotargets) tar_option_set(packages = \"terra\") geotargets_option_set(gdal_raster_driver = \"COG\") list( tar_target( tif_file, system.file(\"ex/elev.tif\", package = \"terra\"), format = \"file\" ), tar_terra_rast( r, { rast <- rast(tif_file) units(rast) <- \"m\" rast }, preserve_metadata = \"zip\" ) ) tar_make() #> Error in get(paste0(generic, \".\", class), envir = get_method_env()) : #> object 'type_sum.accel' not found #> ✔ skipped target tif_file #> ▶ dispatched target r #> ● completed target r [0.004 seconds, 10.252 kilobytes] #> ▶ ended pipeline [0.134 seconds] #> terra::units(tar_read(r)) #> [1] \"\""},{"path":"https://njtierney.github.io/geotargets/articles/geotargets.html","id":"tar_terra_vect-targets-with-terra-vectors","dir":"Articles","previous_headings":"","what":"tar_terra_vect(): targets with terra vectors","title":"Using `terra` with `geotargets`","text":"terra SpatVector objects, use tar_terra_vect() pipeline. can set vector specific options geotargets_option_set() filetype gdal arguments individual tar_terra_vect() calls.","code":"# contents of _targets.R: library(targets) library(geotargets) geotargets_option_set(gdal_vector_driver = \"GeoJSON\") list( tar_target( vect_file, system.file(\"ex\", \"lux.shp\", package = \"terra\"), format = \"file\" ), tar_terra_vect( v, terra::vect(vect_file) ), tar_terra_vect( v_proj, terra::project(v, \"EPSG:2196\") ) ) tar_make() #> Error in get(paste0(generic, \".\", class), envir = get_method_env()) : #> object 'type_sum.accel' not found #> ▶ dispatched target vect_file #> ● completed target vect_file [0.001 seconds, 64.692 kilobytes] #> ▶ dispatched target v #> ● completed target v [0.009 seconds, 117.629 kilobytes] #> ▶ dispatched target v_proj #> ● completed target v_proj [0.016 seconds, 213.534 kilobytes] #> ▶ ended pipeline [0.131 seconds] #> tar_read(v) #> class : SpatVector #> geometry : polygons #> dimensions : 12, 6 (geometries, attributes) #> extent : 5.74414, 6.528252, 49.44781, 50.18162 (xmin, xmax, ymin, ymax) #> source : v #> coord. ref. : lon/lat WGS 84 (EPSG:4326) #> names : ID_1 NAME_1 ID_2 NAME_2 AREA POP #> type : #> values : 1 Diekirch 1 Clervaux 312 1.808e+04 #> 1 Diekirch 2 Diekirch 218 3.254e+04 #> 1 Diekirch 3 Redange 259 1.866e+04 tar_read(v_proj) #> class : SpatVector #> geometry : polygons #> dimensions : 12, 6 (geometries, attributes) #> extent : -69990.51, -13879.85, 5484907, 5566555 (xmin, xmax, ymin, ymax) #> source : v_proj #> coord. ref. : ETRS89 / Kp2000 Jutland (EPSG:2196) #> names : ID_1 NAME_1 ID_2 NAME_2 AREA POP #> type : #> values : 1 Diekirch 1 Clervaux 312 1.808e+04 #> 1 Diekirch 2 Diekirch 218 3.254e+04 #> 1 Diekirch 3 Redange 259 1.866e+04"},{"path":"https://njtierney.github.io/geotargets/articles/geotargets.html","id":"tar_terra_sprc-targets-with-terra-raster-collections","dir":"Articles","previous_headings":"","what":"tar_terra_sprc(): targets with terra raster collections","title":"Using `terra` with `geotargets`","text":"Targets produce SpatRasterCollection can created tar_terra_sprc(). various rasters collection saved subdatasets adhere targets one file per target rule.","code":"# contents of _targets.R: library(targets) library(geotargets) elev_scale <- function(raster, z = 1, projection = \"EPSG:4326\") { terra::project( raster * z, projection ) } tar_option_set(packages = \"terra\") geotargets_option_set(gdal_raster_driver = \"GTiff\") list( tar_target( elev_file, system.file(\"ex\", \"elev.tif\", package = \"terra\"), format = \"file\" ), tar_target( r, rast(elev_file) ), tar_terra_sprc( raster_elevs, # two rasters, one unaltered, one scaled by factor of 2 and # reprojected to interrupted Goode homolosine terra::sprc(list( elev_scale(r, 1), elev_scale(r, 2, \"+proj=igh\") )) ) ) tar_make() #> Error in get(paste0(generic, \".\", class), envir = get_method_env()) : #> object 'type_sum.accel' not found #> ▶ dispatched target elev_file #> ● completed target elev_file [0.009 seconds, 7.994 kilobytes] #> ▶ dispatched target r #> ● completed target r [0.003 seconds, 959.703 kilobytes] #> ▶ dispatched target raster_elevs #> ● completed target raster_elevs [0.056 seconds, 37.904 kilobytes] #> ▶ ended pipeline [1.076 seconds] #> tar_read(raster_elevs) #> class : SpatRasterCollection #> length : 2 #> nrow : 90, 115 #> ncol : 95, 114 #> nlyr : 1, 1 #> extent : 5.741667, 1558890, 49.44167, 5556741 (xmin, xmax, ymin, ymax) #> crs (first) : lon/lat WGS 84 (EPSG:4326) #> names : raster_elevs, raster_elevs"},{"path":"https://njtierney.github.io/geotargets/articles/geotargets.html","id":"tar_terra_sds-targets-with-terra-raster-datasets","dir":"Articles","previous_headings":"","what":"tar_terra_sds(): targets with terra raster datasets","title":"Using `terra` with `geotargets`","text":"terra SpatRasterDataset similar SpatRasterCollection except sub-datasets must projection extent","code":"# contents of _targets.R: library(targets) library(geotargets) tar_option_set(packages = \"terra\") list( tar_target( logo_file, system.file(\"ex/logo.tif\", package = \"terra\"), format = \"file\" ), tar_terra_sds( raster_dataset, { x <- sds(rast(logo_file), rast(logo_file) / 2) names(x) <- c(\"first\", \"second\") x } ) ) tar_make() #> Error in get(paste0(generic, \".\", class), envir = get_method_env()) : #> object 'type_sum.accel' not found #> ▶ dispatched target logo_file #> ● completed target logo_file [0.008 seconds, 22.458 kilobytes] #> ▶ dispatched target raster_dataset #> ● completed target raster_dataset [0.03 seconds, 54.735 kilobytes] #> ▶ ended pipeline [0.137 seconds] #> tar_read(raster_dataset) #> class : SpatRasterDataset #> subdatasets : 2 #> dimensions : 77, 101 (nrow, ncol) #> nlyr : 3, 3 #> resolution : 1, 1 (x, y) #> extent : 0, 101, 0, 77 (xmin, xmax, ymin, ymax) #> coord. ref. : Cartesian (Meter) #> source(s) : raster_dataset #> names : raster_dataset, raster_dataset"},{"path":"https://njtierney.github.io/geotargets/articles/tar_terra_tiles.html","id":"what-is-an-extent","dir":"Articles","previous_headings":"","what":"What is an extent?","title":"Dynamic branching with raster tiles","text":"extent describes four points cover area raster. extent raster, r, printed summary: can get extent ext (extent): maps onto four corners raster : geo-computational operations can done independently one another—want take advantage , can facilitate breaking raster smaller pieces, creating new extents describe new subsets raster. can use extent information downstream analysis describe break raster. similar might want chunk data frame groups distribute different CPU cores. help , ’ve got helper functions.","code":"# example SpatRaster f <- system.file(\"ex/elev.tif\", package = \"terra\") r <- rast(f) r #> class : SpatRaster #> dimensions : 90, 95, 1 (nrow, ncol, nlyr) #> resolution : 0.008333333, 0.008333333 (x, y) #> extent : 5.741667, 6.533333, 49.44167, 50.19167 (xmin, xmax, ymin, ymax) #> coord. ref. : lon/lat WGS 84 (EPSG:4326) #> source : elev.tif #> name : elevation #> min value : 141 #> max value : 547 r_ext <- ext(r) r_ext #> SpatExtent : 5.74166666666667, 6.53333333333333, 49.4416666666667, 50.1916666666667 (xmin, xmax, ymin, ymax) # some plot helpers rect_extent <- function(x, ...) { rect(x[1], x[3], x[2], x[4], ...) } plot_extents <- function(x, ...) { invisible(lapply(x, rect_extent, border = \"hotpink\", lwd = 2)) } extend(r, 5) |> plot() lines(r_ext, col = \"hotpink\", lty = 2) points(r_ext, col = \"hotpink\", pch = 16)"},{"path":"https://njtierney.github.io/geotargets/articles/tar_terra_tiles.html","id":"helper-functions-to-create-multiple-extents-of-a-raster","dir":"Articles","previous_headings":"","what":"Helper functions to create multiple extents of a raster","title":"Dynamic branching with raster tiles","text":"geotargets provides three helper functions take SpatRaster output extents tiles: tile_n(), tile_grid(), tile_blocksize() demonstrate now.","code":""},{"path":"https://njtierney.github.io/geotargets/articles/tar_terra_tiles.html","id":"tile_n","dir":"Articles","previous_headings":"Helper functions to create multiple extents of a raster","what":"tile_n()","title":"Dynamic branching with raster tiles","text":"can use tile_n(), simplest three. produces n tiles grid.","code":"r_tile_4 <- tile_n(r, 4) #> creating 2 * 2 = 4 tile extents r_tile_4 #> [[1]] #> xmin xmax ymin ymax #> 5.741667 6.141667 49.816667 50.191667 #> #> [[2]] #> xmin xmax ymin ymax #> 6.141667 6.533333 49.816667 50.191667 #> #> [[3]] #> xmin xmax ymin ymax #> 5.741667 6.141667 49.441667 49.816667 #> #> [[4]] #> xmin xmax ymin ymax #> 6.141667 6.533333 49.441667 49.816667 plot(r) plot_extents(r_tile_4) plot(r) tile_n(r, 6) |> plot_extents() #> creating 2 * 3 = 6 tile extents"},{"path":"https://njtierney.github.io/geotargets/articles/tar_terra_tiles.html","id":"tile_grid","dir":"Articles","previous_headings":"Helper functions to create multiple extents of a raster","what":"tile_grid()","title":"Dynamic branching with raster tiles","text":"control, use tile_grid(), allows specification number rows columns split raster . specify want three columns 1 row:","code":"r_grid_3x1 <- tile_grid(r, ncol = 3, nrow = 1) r_grid_3x1 #> [[1]] #> xmin xmax ymin ymax #> 5.741667 6.008333 49.441667 50.191667 #> #> [[2]] #> xmin xmax ymin ymax #> 6.008333 6.266667 49.441667 50.191667 #> #> [[3]] #> xmin xmax ymin ymax #> 6.266667 6.533333 49.441667 50.191667 plot(r) plot_extents(r_grid_3x1) plot(r) tile_grid(r, ncol = 2, nrow = 3) |> plot_extents()"},{"path":"https://njtierney.github.io/geotargets/articles/tar_terra_tiles.html","id":"tile_blocksize","dir":"Articles","previous_headings":"Helper functions to create multiple extents of a raster","what":"tile_blocksize()","title":"Dynamic branching with raster tiles","text":"third included helper tile_blocksize(), tiles file block size. block size property raster files, number pixels (x y direction) read memory time. Tiling multiples block size may therefore efficient one block need loaded create tile target. can find blocksize fileBlocksize: tells us reads raster 43x95 pixel sizes. tile_blocksize function similar tile_grid, except instead saying many rows columns, specify units blocksize. just run tile_blocksize() r get extents specified blocksize: specifying blocksize row column unit 1: block size size first two blocks, much narrow block. different two tile methods. column block size full width raster. instead blocksize extent written 2 blocks row, 1 block size columns: works SpatRaster points file—-memory rasters inherent block size.","code":"fileBlocksize(r) #> rows cols #> [1,] 43 95 tile_blocksize(r) #> [[1]] #> xmin xmax ymin ymax #> 5.741667 6.533333 49.833333 50.191667 #> #> [[2]] #> xmin xmax ymin ymax #> 5.741667 6.533333 49.475000 49.833333 #> #> [[3]] #> xmin xmax ymin ymax #> 5.741667 6.533333 49.441667 49.475000 r_block_size_1x1 <- tile_blocksize(r, n_blocks_row = 1, n_blocks_col = 1) r_block_size_1x1 #> [[1]] #> xmin xmax ymin ymax #> 5.741667 6.533333 49.833333 50.191667 #> #> [[2]] #> xmin xmax ymin ymax #> 5.741667 6.533333 49.475000 49.833333 #> #> [[3]] #> xmin xmax ymin ymax #> 5.741667 6.533333 49.441667 49.475000 plot(r) plot_extents(r_block_size_1x1) r_block_size_2x1 <- tile_blocksize(r, n_blocks_row = 2, n_blocks_col = 1) r_block_size_2x1 #> [[1]] #> xmin xmax ymin ymax #> 5.741667 6.533333 49.475000 50.191667 #> #> [[2]] #> xmin xmax ymin ymax #> 5.741667 6.533333 49.441667 49.475000 plot(r) plot_extents(r_block_size_2x1) sources(r) #> [1] \"/home/runner/work/_temp/Library/terra/ex/elev.tif\" # force into memory r2 <- r + 0 sources(r2) #> [1] \"\" # this now errors tile_blocksize(r2) #> Error: [aggregate] values in argument 'fact' should be > 0"},{"path":"https://njtierney.github.io/geotargets/articles/tar_terra_tiles.html","id":"example-targets-pipeline","dir":"Articles","previous_headings":"","what":"Example targets pipeline","title":"Dynamic branching with raster tiles","text":"developing targets pipeline using tar_terra_tiles() tile_blocksize(), ’s good idea figure many tiles tile_blocksize() create implementing tar_terra_tiles(). ’ll start making bigger raster experiment using terra::disagg(), (makes higher resolution raster breaking pixels smaller pixels), making multiple layers. Four tiles reasonable, ’ll go . Note ensure r_big target -memory tar_terra_tiles(), set targets option memory = \"transient\". See targets documentation memory details. process happens can thought split-apply-combine. returns tiles whose extents created one tile functions described (tile_n(), tile_grid(), tile_blocksize()), supplying tile_fun. can function work raster, case use app function terra, applies function cells raster. use tar_terra_rast() supply pattern = map(tiles), tiles name target created tar_terra_tiles(). can think pattern = map(tiles) saying: “task tiles specified return list” case use tar_terra_rast() use merge() tiles. can see tar_make() output plots tiles tiles_mean patterns four branches . combined, make full plot .","code":"# contents of _targets.R library(targets) library(geotargets) library(terra) geotargets_option_set(gdal_raster_driver = \"COG\") list( tar_target( raster_file, system.file(\"ex/elev.tif\", package = \"terra\"), format = \"file\" ), tar_terra_rast( r, disagg(rast(raster_file), fact = 10) ), # add more layers tar_terra_rast( r_big, c(r, r + 100, r * 10, r / 2), memory = \"transient\" ) ) tar_make() #> Error in get(paste0(generic, \".\", class), envir = get_method_env()) : #> object 'type_sum.accel' not found #> terra 1.8.5 #> ▶ dispatched target raster_file #> ● completed target raster_file [0.001 seconds, 7.994 kilobytes] #> ▶ dispatched target r #> ● completed target r [0.01 seconds, 822.781 kilobytes] #> ▶ dispatched target r_big #> ● completed target r_big [0.024 seconds, 4.055 megabytes] #> ▶ ended pipeline [0.42 seconds] #> tar_load(r_big) tile_blocksize(r_big) #> [[1]] #> xmin xmax ymin ymax #> 5.741667 6.168333 49.765000 50.191667 #> #> [[2]] #> xmin xmax ymin ymax #> 6.168333 6.533333 49.765000 50.191667 #> #> [[3]] #> xmin xmax ymin ymax #> 5.741667 6.168333 49.441667 49.765000 #> #> [[4]] #> xmin xmax ymin ymax #> 6.168333 6.533333 49.441667 49.765000 # contents of _targets.R library(targets) library(geotargets) library(terra) geotargets_option_set(gdal_raster_driver = \"COG\") tar_option_set(memory = \"transient\") list( tar_target( raster_file, system.file(\"ex/elev.tif\", package = \"terra\"), format = \"file\" ), tar_terra_rast( r, disagg(rast(raster_file), fact = 10) ), tar_terra_rast( r_big, c(r, r + 100, r * 10, r / 2), memory = \"transient\" ), tar_terra_tiles( tiles, raster = r_big, tile_fun = tile_blocksize, description = \"split raster into tiles\" ), tar_terra_rast( tiles_mean, app(tiles, \\(x) mean(x, na.rm = TRUE)), pattern = map(tiles), description = \"some computationaly intensive task performed on each tile\" ), tar_terra_rast( merged_mean, merge(sprc(tiles_mean)), description = \"merge tiles into a single SpatRaster\" ) ) tar_make() #> Error in get(paste0(generic, \".\", class), envir = get_method_env()) : #> object 'type_sum.accel' not found #> terra 1.8.5 #> ✔ skipped target raster_file #> ✔ skipped target r #> ✔ skipped target r_big #> ▶ dispatched target tiles_exts #> ● completed target tiles_exts [0.006 seconds, 153 bytes] #> ▶ dispatched branch tiles_11882e184aa27102 #> ● completed branch tiles_11882e184aa27102 [0.003 seconds, 982.55 kilobytes] #> ▶ dispatched branch tiles_e39b1bcab4d45ba0 #> ● completed branch tiles_e39b1bcab4d45ba0 [0.037 seconds, 249.778 kilobytes] #> ▶ dispatched branch tiles_b14b762418a51f63 #> ● completed branch tiles_b14b762418a51f63 [0.002 seconds, 599.615 kilobytes] #> ▶ dispatched branch tiles_bfb55de5c880456f #> ● completed branch tiles_bfb55de5c880456f [0.003 seconds, 483.702 kilobytes] #> ● completed pattern tiles #> ▶ dispatched branch tiles_mean_1bcefdb80d0879e0 #> ● completed branch tiles_mean_1bcefdb80d0879e0 [2.166 seconds, 159.194 kilobytes] #> ▶ dispatched branch tiles_mean_4ff32c943e05dc36 #> ● completed branch tiles_mean_4ff32c943e05dc36 [1.895 seconds, 49.028 kilobytes] #> ▶ dispatched branch tiles_mean_17723520c935f474 #> ● completed branch tiles_mean_17723520c935f474 [1.637 seconds, 100.948 kilobytes] #> ▶ dispatched branch tiles_mean_984998bf0804c2cf #> ● completed branch tiles_mean_984998bf0804c2cf [1.449 seconds, 87.272 kilobytes] #> ● completed pattern tiles_mean #> ▶ dispatched target merged_mean #> ● completed target merged_mean [0.015 seconds, 879.912 kilobytes] #> ▶ ended pipeline [7.693 seconds] #> library(terra) tar_load(tiles_mean) op <- par(mfrow = c(2, 2)) for (i in seq_along(tiles_mean)) { plot(tiles_mean[[i]]) } par(op) plot(tar_read(merged_mean))"},{"path":"https://njtierney.github.io/geotargets/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Nicholas Tierney. Author, maintainer. Eric Scott. Author. Andrew Brown. Author.","code":""},{"path":"https://njtierney.github.io/geotargets/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Tierney N, Scott E, Brown (2025). geotargets: 'Targets' Extensions Geospatial Formats. R package version 0.2.0.9000, http://geotargets.njtierney.com, https://github.com/njtierney/geotargets.","code":"@Manual{, title = {geotargets: 'Targets' Extensions for Geospatial Formats}, author = {Nicholas Tierney and Eric Scott and Andrew Brown}, year = {2025}, note = {R package version 0.2.0.9000, http://geotargets.njtierney.com}, url = {https://github.com/njtierney/geotargets}, }"},{"path":"https://njtierney.github.io/geotargets/index.html","id":"geotargets-","dir":"","previous_headings":"","what":"Targets Extensions for Geospatial Formats","title":"Targets Extensions for Geospatial Formats","text":"geotargets extends targets work geospatial data formats, rasters vectors (e.g., shapefiles). Currently support raster vector formats terra package","code":""},{"path":"https://njtierney.github.io/geotargets/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Targets Extensions for Geospatial Formats","text":"can install development version geotargets like :","code":"install.packages(\"geotargets\", repos = c(\"https://njtierney.r-universe.dev\", \"https://cran.r-project.org\"))"},{"path":"https://njtierney.github.io/geotargets/index.html","id":"why-geotargets","dir":"","previous_headings":"","what":"Why geotargets","title":"Targets Extensions for Geospatial Formats","text":"want use geospatial data formats (terra) targets package build analytic reproducible pipelines, involves writing lot custom targets wrappers. wrote geotargets can use geospatial data formats targets. provide detail , common problem using popular libraries like terra targets running errors read write. Due limitations come underlying C++ implementation terra library, specific ways write read objects. See ?terra details. geotargets helps handle write read steps, don’t worry can use targets used . essence, ’ve ever come across error: trying read geospatial raster vector targets, geotargets :)","code":"Error in .External(list(name = \"CppMethod__invoke_notvoid\", address = , : NULL value passed as symbol address Error: external pointer is not valid"},{"path":"https://njtierney.github.io/geotargets/index.html","id":"examples","dir":"","previous_headings":"","what":"Examples","title":"Targets Extensions for Geospatial Formats","text":"currently provide support terra package targets. show three examples target factories: tar_terra_rast() tar_terra_vect() tar_terra_sprc() tar_terra_sds() tar_tera_tiles() tar_stars() use place tar_target() targets pipeline, e.g., work terra raster, vector, raster collection data. like see download working examples , see repos: demo-geotargets icebreaker","code":""},{"path":"https://njtierney.github.io/geotargets/index.html","id":"tar_terra_rast-targets-with-terra-rasters","dir":"","previous_headings":"","what":"tar_terra_rast(): targets with terra rasters","title":"Targets Extensions for Geospatial Formats","text":"","code":"library(targets) tar_dir({ # tar_dir() runs code from a temporary directory. tar_script({ library(geotargets) get_elev <- function() { terra::rast(system.file(\"ex\", \"elev.tif\", package = \"terra\")) } list( tar_terra_rast( terra_rast_example, get_elev() ) ) }) tar_make() x <- tar_read(terra_rast_example) x }) #> ▶ dispatched target terra_rast_example #> ● completed target terra_rast_example [0.074 seconds, 7.992 kilobytes] #> ▶ ended pipeline [0.316 seconds] #> class : SpatRaster #> dimensions : 90, 95, 1 (nrow, ncol, nlyr) #> resolution : 0.008333333, 0.008333333 (x, y) #> extent : 5.741667, 6.533333, 49.44167, 50.19167 (xmin, xmax, ymin, ymax) #> coord. ref. : lon/lat WGS 84 (EPSG:4326) #> source : terra_rast_example #> name : elevation #> min value : 141 #> max value : 547"},{"path":"https://njtierney.github.io/geotargets/index.html","id":"tar_terra_vect-targets-with-terra-vectors","dir":"","previous_headings":"","what":"tar_terra_vect(): targets with terra vectors","title":"Targets Extensions for Geospatial Formats","text":"","code":"tar_dir({ # tar_dir() runs code from a temporary directory. tar_script({ library(geotargets) lux_area <- function(projection = \"EPSG:4326\") { terra::project( terra::vect(system.file(\"ex\", \"lux.shp\", package = \"terra\" )), projection ) } list( tar_terra_vect( terra_vect_example, lux_area() ) ) }) tar_make() x <- tar_read(terra_vect_example) x }) #> ▶ dispatched target terra_vect_example #> ● completed target terra_vect_example [0.078 seconds, 117.646 kilobytes] #> ▶ ended pipeline [0.259 seconds] #> class : SpatVector #> geometry : polygons #> dimensions : 12, 6 (geometries, attributes) #> extent : 5.74414, 6.528252, 49.44781, 50.18162 (xmin, xmax, ymin, ymax) #> source : terra_vect_example #> coord. ref. : lon/lat WGS 84 (EPSG:4326) #> names : ID_1 NAME_1 ID_2 NAME_2 AREA POP #> type : #> values : 1 Diekirch 1 Clervaux 312 1.808e+04 #> 1 Diekirch 2 Diekirch 218 3.254e+04 #> 1 Diekirch 3 Redange 259 1.866e+04"},{"path":"https://njtierney.github.io/geotargets/index.html","id":"tar_terra_sprc-targets-with-terra-raster-collections","dir":"","previous_headings":"","what":"tar_terra_sprc(): targets with terra raster collections","title":"Targets Extensions for Geospatial Formats","text":"","code":"tar_dir({ # tar_dir() runs code from a temporary directory. tar_script({ library(geotargets) elev_scale <- function(z = 1, projection = \"EPSG:4326\") { terra::project( terra::rast(system.file(\"ex\", \"elev.tif\", package = \"terra\")) * z, projection ) } list( tar_terra_sprc( raster_elevs, # two rasters, one unaltered, one scaled by factor of 2 and # reprojected to interrupted goode homolosine command = terra::sprc(list( elev_scale(1), elev_scale(2, \"+proj=igh\") )) ) ) }) tar_make() x <- tar_read(raster_elevs) x }) #> ▶ dispatched target raster_elevs #> ● completed target raster_elevs [0.14 seconds, 36.423 kilobytes] #> ▶ ended pipeline [0.33 seconds] #> class : SpatRasterCollection #> length : 2 #> nrow : 90, 115 #> ncol : 95, 114 #> nlyr : 1, 1 #> extent : 5.741667, 1558890, 49.44167, 5556741 (xmin, xmax, ymin, ymax) #> crs (first) : lon/lat WGS 84 (EPSG:4326) #> names : raster_elevs, raster_elevs"},{"path":"https://njtierney.github.io/geotargets/index.html","id":"tar_stars-targets-with-stars-objects","dir":"","previous_headings":"","what":"tar_stars(): targets with stars objects","title":"Targets Extensions for Geospatial Formats","text":"","code":"tar_dir({ # tar_dir() runs code from a temporary directory. tar_script({ library(geotargets) list( tar_stars( test_stars, stars::read_stars(system.file(\"tif\", \"olinda_dem_utm25s.tif\", package = \"stars\")) ) ) }) tar_make() x <- tar_read(test_stars) x }) #> ▶ dispatched target test_stars #> ● completed target test_stars [0.053 seconds, 49.9 kilobytes] #> ▶ ended pipeline [0.192 seconds] #> stars object with 2 dimensions and 1 attribute #> attribute(s): #> Min. 1st Qu. Median Mean 3rd Qu. Max. #> test_stars -1 6 12 21.66521 35 88 #> dimension(s): #> from to offset delta refsys point x/y #> x 1 111 288776 89.99 UTM Zone 25, Southern Hem... FALSE [x] #> y 1 111 9120761 -89.99 UTM Zone 25, Southern Hem... FALSE [y]"},{"path":"https://njtierney.github.io/geotargets/index.html","id":"code-of-conduct","dir":"","previous_headings":"","what":"Code of Conduct","title":"Targets Extensions for Geospatial Formats","text":"Please note geotargets project released Contributor Code Conduct. contributing project, agree abide terms.","code":""},{"path":"https://njtierney.github.io/geotargets/index.html","id":"acknowledgements","dir":"","previous_headings":"","what":"Acknowledgements","title":"Targets Extensions for Geospatial Formats","text":"Logo design Hubert Hałun Appsilon.","code":""},{"path":"https://njtierney.github.io/geotargets/reference/geotargets-options.html","id":null,"dir":"Reference","previous_headings":"","what":"Get or Set geotargets Options — geotargets_option_set","title":"Get or Set geotargets Options — geotargets_option_set","text":"Get set behavior geospatial data target stores using geotargets-specific global options.","code":""},{"path":"https://njtierney.github.io/geotargets/reference/geotargets-options.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get or Set geotargets Options — geotargets_option_set","text":"","code":"geotargets_option_set( gdal_raster_driver = NULL, gdal_raster_creation_options = NULL, gdal_vector_driver = NULL, gdal_vector_creation_options = NULL, terra_preserve_metadata = NULL ) geotargets_option_get(name)"},{"path":"https://njtierney.github.io/geotargets/reference/geotargets-options.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get or Set geotargets Options — geotargets_option_set","text":"gdal_raster_driver character, length 1; set driver used raster data target store (default: \"GTiff\"). Options driver names can found : https://gdal.org/drivers/raster/index.html. gdal_raster_creation_options character; set GDAL creation options used writing raster files target store (default: \"\"). may specify multiple values e.g. c(\"COMPRESS=DEFLATE\", \"TFW=YES\"). GDAL driver supports unique set creation options. example, default \"GTiff\" driver: https://gdal.org/drivers/raster/gtiff.html#creation-options. gdal_vector_driver character, length 1; set file type used vector data target store (default: \"GeoJSON\"). gdal_vector_creation_options character; set GDAL layer creation options used writing vector files target store (default: \"ENCODING=UTF-8\"). may specify multiple values e.g. c(\"WRITE_BBOX=YES\", \"COORDINATE_PRECISION=10\"). GDAL driver supports unique set creation options. example, default \"GeoJSON\" driver: https://gdal.org/drivers/vector/geojson.html#layer-creation-options terra_preserve_metadata character. \"drop\" (default), auxiliary files written terra::writeRaster() containing raster metadata units datetimes lost (note include layer names set names() <-). \"zip\", metadata retained archiving written files zip file upon writing unzipping upon reading. adds extra overhead slow pipelines. name character; option name get.","code":""},{"path":"https://njtierney.github.io/geotargets/reference/geotargets-options.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get or Set geotargets Options — geotargets_option_set","text":"Specific options, \"gdal.raster.driver\". See \"Details\" information.","code":""},{"path":"https://njtierney.github.io/geotargets/reference/geotargets-options.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Get or Set geotargets Options — geotargets_option_set","text":"options can also set using options(). example, geotargets_options_set(gdal_raster_driver = \"GTiff\") equivalent options(\"geotargets.gdal.raster.driver\" = \"GTiff\").","code":""},{"path":"https://njtierney.github.io/geotargets/reference/geotargets-options.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get or Set geotargets Options — geotargets_option_set","text":"","code":"if (Sys.getenv(\"TAR_LONG_EXAMPLES\") == \"true\") { targets::tar_dir({ # tar_dir() runs code from a temporary directory. library(geotargets) op <- getOption(\"geotargets.gdal.raster.driver\") withr::defer(options(\"geotargets.gdal.raster.driver\" = op)) geotargets_option_set(gdal_raster_driver = \"COG\") targets::tar_script({ list( geotargets::tar_terra_rast( terra_rast_example, system.file(\"ex/elev.tif\", package = \"terra\") |> terra::rast() ) ) }) targets::tar_make() x <- targets::tar_read(terra_rast_example) }) } geotargets_option_get(\"gdal.raster.driver\") #> NULL geotargets_option_get(\"gdal.raster.creation.options\") #> NULL"},{"path":"https://njtierney.github.io/geotargets/reference/geotargets-package.html","id":null,"dir":"Reference","previous_headings":"","what":"geotargets: 'Targets' Extensions for Geospatial Formats — geotargets-package","title":"geotargets: 'Targets' Extensions for Geospatial Formats — geotargets-package","text":"Provides extensions various geospatial file formats, shapefiles rasters. Currently provides support 'terra' geospatial formats. See vignettes worked examples, demonstrations, explanations use various package extensions.","code":""},{"path":[]},{"path":"https://njtierney.github.io/geotargets/reference/geotargets-package.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"geotargets: 'Targets' Extensions for Geospatial Formats — geotargets-package","text":"Maintainer: Nicholas Tierney nicholas.tierney@gmail.com (ORCID) Authors: Eric Scott (ORCID) Andrew Brown (ORCID)","code":""},{"path":"https://njtierney.github.io/geotargets/reference/set_window.html","id":null,"dir":"Reference","previous_headings":"","what":"Copy a raster within a window — set_window","title":"Copy a raster within a window — set_window","text":"Create new SpatRaster object specified window (area interest) original SpatRaster. wrapper around terra::window() , rather modifying SpatRaster place, returns new SpatRaster leaving original unchanged.","code":""},{"path":"https://njtierney.github.io/geotargets/reference/set_window.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Copy a raster within a window — set_window","text":"","code":"set_window(raster, window)"},{"path":"https://njtierney.github.io/geotargets/reference/set_window.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Copy a raster within a window — set_window","text":"raster SpatRaster object. window SpatExtent object defining area interest.","code":""},{"path":"https://njtierney.github.io/geotargets/reference/set_window.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Copy a raster within a window — set_window","text":"SpatRaster","code":""},{"path":"https://njtierney.github.io/geotargets/reference/set_window.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Copy a raster within a window — set_window","text":"may general use, created primarily use within tar_terra_tiles().","code":""},{"path":"https://njtierney.github.io/geotargets/reference/set_window.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Copy a raster within a window — set_window","text":"Eric Scott","code":""},{"path":"https://njtierney.github.io/geotargets/reference/set_window.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Copy a raster within a window — set_window","text":"","code":"f <- system.file(\"ex/elev.tif\", package=\"terra\") r <- terra::rast(f) e <- terra::ext(c(5.9, 6,49.95, 50)) r2 <- set_window(r, e) terra::ext(r) #> SpatExtent : 5.74166666666667, 6.53333333333333, 49.4416666666667, 50.1916666666667 (xmin, xmax, ymin, ymax) terra::ext(r2) #> SpatExtent : 5.9, 6, 49.95, 50 (xmin, xmax, ymin, ymax)"},{"path":"https://njtierney.github.io/geotargets/reference/tar_stars.html","id":null,"dir":"Reference","previous_headings":"","what":"Create a stars stars Target — tar_stars","title":"Create a stars stars Target — tar_stars","text":"Provides target format stars objects. Note stars objects work ordinary tar_target() necessarily need geotargets target factories way terra objects . Currently tar_stars() limitations stars::write_stars(), use caution.","code":""},{"path":"https://njtierney.github.io/geotargets/reference/tar_stars.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create a stars stars Target — tar_stars","text":"","code":"tar_stars( name, command, pattern = NULL, proxy = FALSE, mdim = FALSE, ncdf = FALSE, driver = geotargets_option_get(\"gdal.raster.driver\"), options = geotargets_option_get(\"gdal.raster.creation.options\"), ..., tidy_eval = targets::tar_option_get(\"tidy_eval\"), packages = targets::tar_option_get(\"packages\"), library = targets::tar_option_get(\"library\"), repository = targets::tar_option_get(\"repository\"), error = targets::tar_option_get(\"error\"), memory = targets::tar_option_get(\"memory\"), garbage_collection = targets::tar_option_get(\"garbage_collection\"), deployment = targets::tar_option_get(\"deployment\"), priority = targets::tar_option_get(\"priority\"), resources = targets::tar_option_get(\"resources\"), storage = targets::tar_option_get(\"storage\"), retrieval = targets::tar_option_get(\"retrieval\"), cue = targets::tar_option_get(\"cue\"), description = targets::tar_option_get(\"description\") ) tar_stars_proxy( name, command, pattern = NULL, mdim = FALSE, ncdf = FALSE, driver = geotargets_option_get(\"gdal.raster.driver\"), options = geotargets_option_get(\"gdal.raster.creation.options\"), ..., tidy_eval = targets::tar_option_get(\"tidy_eval\"), packages = targets::tar_option_get(\"packages\"), library = targets::tar_option_get(\"library\"), repository = targets::tar_option_get(\"repository\"), error = targets::tar_option_get(\"error\"), memory = targets::tar_option_get(\"memory\"), garbage_collection = targets::tar_option_get(\"garbage_collection\"), deployment = targets::tar_option_get(\"deployment\"), priority = targets::tar_option_get(\"priority\"), resources = targets::tar_option_get(\"resources\"), storage = targets::tar_option_get(\"storage\"), retrieval = targets::tar_option_get(\"retrieval\"), cue = targets::tar_option_get(\"cue\"), description = targets::tar_option_get(\"description\") )"},{"path":"https://njtierney.github.io/geotargets/reference/tar_stars.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create a stars stars Target — tar_stars","text":"name Symbol, name target. target name must valid name symbol R, must start dot. See targets::tar_target() information. command R code run target. pattern Code define dynamic branching pattern target. See targets::tar_target() information. proxy logical. Passed stars::read_stars(). TRUE target read object class stars_proxy. Otherwise, object class stars. mdim logical. Use Multidimensional Raster Data Model via stars::write_mdim()? Default: FALSE. supported drivers, e.g. \"netCDF\" \"Zarr\". ncdf logical. Use NetCDF library directly read data via stars::read_ncdf()? Default: FALSE. supported driver=\"netCDF\". driver character. File format expressed GDAL driver names passed stars::write_stars(). See sf::st_drivers(). options character. GDAL driver specific datasource creation options passed stars::write_stars(). ... Additional arguments yet used. tidy_eval Logical, whether enable tidy evaluation interpreting command pattern. TRUE, can use \"bang-bang\" operator !! programmatically insert values global objects. packages Character vector packages load right target runs output data reloaded downstream targets. Use tar_option_set() set packages globally subsequent targets define. library Character vector library paths try loading packages. repository Character length 1, remote repository target storage. Choices: \"local\": file system local machine. \"aws\": Amazon Web Services (AWS) S3 bucket. Can configured non-AWS S3 bucket using endpoint argument tar_resources_aws(), versioning capabilities may lost . See cloud storage section https://books.ropensci.org/targets/data.html details instructions. \"gcp\": Google Cloud Platform storage bucket. See cloud storage section https://books.ropensci.org/targets/data.html details instructions. character string tar_repository_cas() content-addressable storage. Note: repository \"local\" format \"file\" target create single output file. output file uploaded cloud tracked changes exists cloud. local file deleted target runs. error Character length 1, target stops throws error. Options: \"stop\": whole pipeline stops throws error. \"continue\": whole pipeline keeps going. \"null\": errored target continues returns NULL. data hash deliberately wrong target date next run pipeline. \"abridge\": currently running targets keep running, new targets launch . \"trim\": currently running targets stay running. queued target allowed start : downstream error, sibling branch tar_target() call (error happened dynamic branch). idea avoid starting new work immediate error impacts. error = \"trim\" just like error = \"abridge\", allows potentially healthy regions dependency graph begin running. (Visit https://books.ropensci.org/targets/debugging.html learn debug targets using saved workspaces.) memory Character length 1, memory strategy. \"persistent\", target stays memory end pipeline (unless storage \"worker\", case targets unloads value memory right storing order avoid sending copious data network). \"transient\", target gets unloaded every new target completes. Either way, target gets automatically loaded memory whenever another target needs value. cloud-based dynamic files (e.g. format = \"file\" repository = \"aws\"), memory strategy applies temporary local copy file: \"persistent\" means remains end pipeline deleted, \"transient\" means gets deleted soon possible. former conserves bandwidth, latter conserves local storage. garbage_collection Logical, whether run base::gc() just target runs. deployment Character length 1. deployment \"main\", target run central controlling R process. Otherwise, deployment \"worker\" set pipeline distributed/parallel computing, target runs parallel worker. distributed/parallel computing targets, please visit https://books.ropensci.org/targets/crew.html. priority Numeric length 1 0 1. Controls targets get deployed first multiple competing targets ready simultaneously. Targets priorities closer 1 get dispatched earlier (polled earlier tar_make_future()). resources Object returned tar_resources() optional settings high-performance computing functionality, alternative data storage formats, optional capabilities targets. See tar_resources() details. storage Character length 1, relevant tar_make_clustermq() tar_make_future(). Must one following values: \"main\": target's return value sent back host machine saved/uploaded locally. \"worker\": worker saves/uploads value. \"none\": almost never recommended. niche situations, e.g. data needs loaded explicitly another language. use , return value target totally ignored target ends, downstream target still attempts load data file (except retrieval = \"none\"). select storage = \"none\", return value target's command ignored, data saved automatically. dynamic files (format = \"file\") responsibility user write data store inside target. distinguishing feature storage = \"none\" (opposed format = \"file\") general case, downstream targets automatically try load data data store dependency. corollary, storage = \"none\" completely unnecessary format \"file\". retrieval Character length 1, relevant tar_make_clustermq() tar_make_future(). Must one following values: \"main\": target's dependencies loaded host machine sent worker target runs. \"worker\": worker loads targets dependencies. \"none\": dependencies loaded . choice almost never recommended. niche situations, e.g. data needs loaded explicitly another language. cue optional object tar_cue() customize rules decide whether target date. description Character length 1, custom free-form human-readable text description target. Descriptions appear target labels functions like tar_manifest() tar_visnetwork(), let select subsets targets names argument functions like tar_make(). example, tar_manifest(names = tar_described_as(starts_with(\"survival model\"))) lists targets whose descriptions start character string \"survival model\".","code":""},{"path":"https://njtierney.github.io/geotargets/reference/tar_stars.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create a stars stars Target — tar_stars","text":"target class \"tar_stem\" use target pipeline","code":""},{"path":"https://njtierney.github.io/geotargets/reference/tar_stars.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Create a stars stars Target — tar_stars","text":"iteration argument unavailable hard-coded \"list\", option works currently.","code":""},{"path":[]},{"path":"https://njtierney.github.io/geotargets/reference/tar_stars.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create a stars stars Target — tar_stars","text":"","code":"if (Sys.getenv(\"TAR_LONG_EXAMPLES\") == \"true\") { targets::tar_dir({ # tar_dir() runs code from a temporary directory. library(geotargets) targets::tar_script({ list( geotargets::tar_stars( stars_example, stars::read_stars(system.file(\"tif\", \"olinda_dem_utm25s.tif\", package = \"stars\")) ) ) }) targets::tar_make() x <- targets::tar_read(stars_example) }) }"},{"path":"https://njtierney.github.io/geotargets/reference/tar_terra_rast.html","id":null,"dir":"Reference","previous_headings":"","what":"Create a terra SpatRaster target — tar_terra_rast","title":"Create a terra SpatRaster target — tar_terra_rast","text":"Provides target format terra::SpatRaster objects.","code":""},{"path":"https://njtierney.github.io/geotargets/reference/tar_terra_rast.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create a terra SpatRaster target — tar_terra_rast","text":"","code":"tar_terra_rast( name, command, pattern = NULL, filetype = geotargets_option_get(\"gdal.raster.driver\"), gdal = geotargets_option_get(\"gdal.raster.creation.options\"), preserve_metadata = geotargets_option_get(\"terra.preserve.metadata\"), ..., tidy_eval = targets::tar_option_get(\"tidy_eval\"), packages = targets::tar_option_get(\"packages\"), library = targets::tar_option_get(\"library\"), repository = targets::tar_option_get(\"repository\"), error = targets::tar_option_get(\"error\"), memory = targets::tar_option_get(\"memory\"), garbage_collection = targets::tar_option_get(\"garbage_collection\"), deployment = targets::tar_option_get(\"deployment\"), priority = targets::tar_option_get(\"priority\"), resources = targets::tar_option_get(\"resources\"), storage = targets::tar_option_get(\"storage\"), retrieval = targets::tar_option_get(\"retrieval\"), cue = targets::tar_option_get(\"cue\"), description = targets::tar_option_get(\"description\") )"},{"path":"https://njtierney.github.io/geotargets/reference/tar_terra_rast.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create a terra SpatRaster target — tar_terra_rast","text":"name Symbol, name target. target name must valid name symbol R, must start dot. See targets::tar_target() information. command R code run target. pattern Code define dynamic branching pattern target. See targets::tar_target() information. filetype character. File format expressed GDAL driver names passed terra::writeRaster() gdal character. GDAL driver specific datasource creation options passed terra::writeRaster() preserve_metadata character. \"drop\" (default), auxiliary files written terra::writeRaster() containing raster metadata units datetimes lost (note include layer names set names() <-). \"zip\", metadata retained archiving written files zip file upon writing unzipping upon reading. adds extra overhead slow pipelines. ... Additional arguments yet used tidy_eval Logical, whether enable tidy evaluation interpreting command pattern. TRUE, can use \"bang-bang\" operator !! programmatically insert values global objects. packages Character vector packages load right target runs output data reloaded downstream targets. Use tar_option_set() set packages globally subsequent targets define. library Character vector library paths try loading packages. repository Character length 1, remote repository target storage. Choices: \"local\": file system local machine. \"aws\": Amazon Web Services (AWS) S3 bucket. Can configured non-AWS S3 bucket using endpoint argument tar_resources_aws(), versioning capabilities may lost . See cloud storage section https://books.ropensci.org/targets/data.html details instructions. \"gcp\": Google Cloud Platform storage bucket. See cloud storage section https://books.ropensci.org/targets/data.html details instructions. character string tar_repository_cas() content-addressable storage. Note: repository \"local\" format \"file\" target create single output file. output file uploaded cloud tracked changes exists cloud. local file deleted target runs. error Character length 1, target stops throws error. Options: \"stop\": whole pipeline stops throws error. \"continue\": whole pipeline keeps going. \"null\": errored target continues returns NULL. data hash deliberately wrong target date next run pipeline. \"abridge\": currently running targets keep running, new targets launch . \"trim\": currently running targets stay running. queued target allowed start : downstream error, sibling branch tar_target() call (error happened dynamic branch). idea avoid starting new work immediate error impacts. error = \"trim\" just like error = \"abridge\", allows potentially healthy regions dependency graph begin running. (Visit https://books.ropensci.org/targets/debugging.html learn debug targets using saved workspaces.) memory Character length 1, memory strategy. \"persistent\", target stays memory end pipeline (unless storage \"worker\", case targets unloads value memory right storing order avoid sending copious data network). \"transient\", target gets unloaded every new target completes. Either way, target gets automatically loaded memory whenever another target needs value. cloud-based dynamic files (e.g. format = \"file\" repository = \"aws\"), memory strategy applies temporary local copy file: \"persistent\" means remains end pipeline deleted, \"transient\" means gets deleted soon possible. former conserves bandwidth, latter conserves local storage. garbage_collection Logical, whether run base::gc() just target runs. deployment Character length 1. deployment \"main\", target run central controlling R process. Otherwise, deployment \"worker\" set pipeline distributed/parallel computing, target runs parallel worker. distributed/parallel computing targets, please visit https://books.ropensci.org/targets/crew.html. priority Numeric length 1 0 1. Controls targets get deployed first multiple competing targets ready simultaneously. Targets priorities closer 1 get dispatched earlier (polled earlier tar_make_future()). resources Object returned tar_resources() optional settings high-performance computing functionality, alternative data storage formats, optional capabilities targets. See tar_resources() details. storage Character length 1, relevant tar_make_clustermq() tar_make_future(). Must one following values: \"main\": target's return value sent back host machine saved/uploaded locally. \"worker\": worker saves/uploads value. \"none\": almost never recommended. niche situations, e.g. data needs loaded explicitly another language. use , return value target totally ignored target ends, downstream target still attempts load data file (except retrieval = \"none\"). select storage = \"none\", return value target's command ignored, data saved automatically. dynamic files (format = \"file\") responsibility user write data store inside target. distinguishing feature storage = \"none\" (opposed format = \"file\") general case, downstream targets automatically try load data data store dependency. corollary, storage = \"none\" completely unnecessary format \"file\". retrieval Character length 1, relevant tar_make_clustermq() tar_make_future(). Must one following values: \"main\": target's dependencies loaded host machine sent worker target runs. \"worker\": worker loads targets dependencies. \"none\": dependencies loaded . choice almost never recommended. niche situations, e.g. data needs loaded explicitly another language. cue optional object tar_cue() customize rules decide whether target date. description Character length 1, custom free-form human-readable text description target. Descriptions appear target labels functions like tar_manifest() tar_visnetwork(), let select subsets targets names argument functions like tar_make(). example, tar_manifest(names = tar_described_as(starts_with(\"survival model\"))) lists targets whose descriptions start character string \"survival model\".","code":""},{"path":"https://njtierney.github.io/geotargets/reference/tar_terra_rast.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create a terra SpatRaster target — tar_terra_rast","text":"target class \"tar_stem\" use target pipeline","code":""},{"path":"https://njtierney.github.io/geotargets/reference/tar_terra_rast.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Create a terra SpatRaster target — tar_terra_rast","text":"terra::SpatRaster objects contain raster data directly—contain C++ pointer memory data stored. result, objects portable R sessions without special handling, causes problems including targets pipelines tar_target(). tar_terra_rast() handles issue writing reading target geospatial file (specified filetype) rather saving SpatRaster object .","code":""},{"path":"https://njtierney.github.io/geotargets/reference/tar_terra_rast.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Create a terra SpatRaster target — tar_terra_rast","text":"iteration argument unavailable hard-coded \"list\", option works currently.","code":""},{"path":[]},{"path":"https://njtierney.github.io/geotargets/reference/tar_terra_rast.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create a terra SpatRaster target — tar_terra_rast","text":"","code":"if (Sys.getenv(\"TAR_LONG_EXAMPLES\") == \"true\") { targets::tar_dir({ # tar_dir() runs code from a temporary directory. library(geotargets) targets::tar_script({ list( geotargets::tar_terra_rast( terra_rast_example, system.file(\"ex/elev.tif\", package = \"terra\") |> terra::rast() ) ) }) targets::tar_make() x <- targets::tar_read(terra_rast_example) }) }"},{"path":"https://njtierney.github.io/geotargets/reference/tar_terra_sds.html","id":null,"dir":"Reference","previous_headings":"","what":"Create a terra SpatRasterDataset target — tar_terra_sds","title":"Create a terra SpatRasterDataset target — tar_terra_sds","text":"Provides target format terra::SpatRasterDataset objects, hold sub-datasets, SpatRaster can multiple layers.","code":""},{"path":"https://njtierney.github.io/geotargets/reference/tar_terra_sds.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create a terra SpatRasterDataset target — tar_terra_sds","text":"","code":"tar_terra_sds( name, command, pattern = NULL, filetype = geotargets_option_get(\"gdal.raster.driver\"), gdal = geotargets_option_get(\"gdal.raster.creation.options\"), ..., tidy_eval = targets::tar_option_get(\"tidy_eval\"), packages = targets::tar_option_get(\"packages\"), library = targets::tar_option_get(\"library\"), repository = targets::tar_option_get(\"repository\"), error = targets::tar_option_get(\"error\"), memory = targets::tar_option_get(\"memory\"), garbage_collection = targets::tar_option_get(\"garbage_collection\"), deployment = targets::tar_option_get(\"deployment\"), priority = targets::tar_option_get(\"priority\"), resources = targets::tar_option_get(\"resources\"), storage = targets::tar_option_get(\"storage\"), retrieval = targets::tar_option_get(\"retrieval\"), cue = targets::tar_option_get(\"cue\"), description = targets::tar_option_get(\"description\") )"},{"path":"https://njtierney.github.io/geotargets/reference/tar_terra_sds.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create a terra SpatRasterDataset target — tar_terra_sds","text":"name Symbol, name target. target name must valid name symbol R, must start dot. See targets::tar_target() information. command R code run target. pattern Code define dynamic branching pattern target. See targets::tar_target() information. filetype character. File format expressed GDAL driver names passed terra::writeRaster(). gdal character. GDAL driver specific datasource creation options. passed terra::writeRaster() ... Additional arguments yet used. tidy_eval Logical, whether enable tidy evaluation interpreting command pattern. TRUE, can use \"bang-bang\" operator !! programmatically insert values global objects. packages Character vector packages load right target runs output data reloaded downstream targets. Use tar_option_set() set packages globally subsequent targets define. library Character vector library paths try loading packages. repository Character length 1, remote repository target storage. Choices: \"local\": file system local machine. \"aws\": Amazon Web Services (AWS) S3 bucket. Can configured non-AWS S3 bucket using endpoint argument tar_resources_aws(), versioning capabilities may lost . See cloud storage section https://books.ropensci.org/targets/data.html details instructions. \"gcp\": Google Cloud Platform storage bucket. See cloud storage section https://books.ropensci.org/targets/data.html details instructions. character string tar_repository_cas() content-addressable storage. Note: repository \"local\" format \"file\" target create single output file. output file uploaded cloud tracked changes exists cloud. local file deleted target runs. error Character length 1, target stops throws error. Options: \"stop\": whole pipeline stops throws error. \"continue\": whole pipeline keeps going. \"null\": errored target continues returns NULL. data hash deliberately wrong target date next run pipeline. \"abridge\": currently running targets keep running, new targets launch . \"trim\": currently running targets stay running. queued target allowed start : downstream error, sibling branch tar_target() call (error happened dynamic branch). idea avoid starting new work immediate error impacts. error = \"trim\" just like error = \"abridge\", allows potentially healthy regions dependency graph begin running. (Visit https://books.ropensci.org/targets/debugging.html learn debug targets using saved workspaces.) memory Character length 1, memory strategy. \"persistent\", target stays memory end pipeline (unless storage \"worker\", case targets unloads value memory right storing order avoid sending copious data network). \"transient\", target gets unloaded every new target completes. Either way, target gets automatically loaded memory whenever another target needs value. cloud-based dynamic files (e.g. format = \"file\" repository = \"aws\"), memory strategy applies temporary local copy file: \"persistent\" means remains end pipeline deleted, \"transient\" means gets deleted soon possible. former conserves bandwidth, latter conserves local storage. garbage_collection Logical, whether run base::gc() just target runs. deployment Character length 1. deployment \"main\", target run central controlling R process. Otherwise, deployment \"worker\" set pipeline distributed/parallel computing, target runs parallel worker. distributed/parallel computing targets, please visit https://books.ropensci.org/targets/crew.html. priority Numeric length 1 0 1. Controls targets get deployed first multiple competing targets ready simultaneously. Targets priorities closer 1 get dispatched earlier (polled earlier tar_make_future()). resources Object returned tar_resources() optional settings high-performance computing functionality, alternative data storage formats, optional capabilities targets. See tar_resources() details. storage Character length 1, relevant tar_make_clustermq() tar_make_future(). Must one following values: \"main\": target's return value sent back host machine saved/uploaded locally. \"worker\": worker saves/uploads value. \"none\": almost never recommended. niche situations, e.g. data needs loaded explicitly another language. use , return value target totally ignored target ends, downstream target still attempts load data file (except retrieval = \"none\"). select storage = \"none\", return value target's command ignored, data saved automatically. dynamic files (format = \"file\") responsibility user write data store inside target. distinguishing feature storage = \"none\" (opposed format = \"file\") general case, downstream targets automatically try load data data store dependency. corollary, storage = \"none\" completely unnecessary format \"file\". retrieval Character length 1, relevant tar_make_clustermq() tar_make_future(). Must one following values: \"main\": target's dependencies loaded host machine sent worker target runs. \"worker\": worker loads targets dependencies. \"none\": dependencies loaded . choice almost never recommended. niche situations, e.g. data needs loaded explicitly another language. cue optional object tar_cue() customize rules decide whether target date. description Character length 1, custom free-form human-readable text description target. Descriptions appear target labels functions like tar_manifest() tar_visnetwork(), let select subsets targets names argument functions like tar_make(). example, tar_manifest(names = tar_described_as(starts_with(\"survival model\"))) lists targets whose descriptions start character string \"survival model\".","code":""},{"path":"https://njtierney.github.io/geotargets/reference/tar_terra_sds.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create a terra SpatRasterDataset target — tar_terra_sds","text":"target class \"tar_stem\" use target pipeline","code":""},{"path":"https://njtierney.github.io/geotargets/reference/tar_terra_sds.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Create a terra SpatRasterDataset target — tar_terra_sds","text":"iteration argument unavailable hard-coded \"list\", option works currently.","code":""},{"path":[]},{"path":"https://njtierney.github.io/geotargets/reference/tar_terra_sds.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Create a terra SpatRasterDataset target — tar_terra_sds","text":"Andrew Gene Brown Nicholas Tierney Eric R. Scott","code":""},{"path":"https://njtierney.github.io/geotargets/reference/tar_terra_sds.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create a terra SpatRasterDataset target — tar_terra_sds","text":"","code":"if (Sys.getenv(\"TAR_LONG_EXAMPLES\") == \"true\") { targets::tar_dir({ # tar_dir() runs code from a temporary directory. library(geotargets) targets::tar_script({ elev_scale <- function(z = 1) { terra::rast(system.file(\"ex\", \"elev.tif\", package = \"terra\")) * z } list( tar_terra_sds( raster_elevs, # two rasters, one unaltered, one scaled by factor of 2 command = terra::sds(list( elev_scale(1), elev_scale(2) )) ) ) }) targets::tar_make() targets::tar_read(raster_elevs) }) }"},{"path":"https://njtierney.github.io/geotargets/reference/tar_terra_sprc.html","id":null,"dir":"Reference","previous_headings":"","what":"Create a terra SpatRasterCollection target — tar_terra_sprc","title":"Create a terra SpatRasterCollection target — tar_terra_sprc","text":"Provides target format terra::SpatRasterCollection objects, restriction extent geometric parameters.","code":""},{"path":"https://njtierney.github.io/geotargets/reference/tar_terra_sprc.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create a terra SpatRasterCollection target — tar_terra_sprc","text":"","code":"tar_terra_sprc( name, command, pattern = NULL, filetype = geotargets_option_get(\"gdal.raster.driver\"), gdal = geotargets_option_get(\"gdal.raster.creation.options\"), ..., tidy_eval = targets::tar_option_get(\"tidy_eval\"), packages = targets::tar_option_get(\"packages\"), library = targets::tar_option_get(\"library\"), repository = targets::tar_option_get(\"repository\"), error = targets::tar_option_get(\"error\"), memory = targets::tar_option_get(\"memory\"), garbage_collection = targets::tar_option_get(\"garbage_collection\"), deployment = targets::tar_option_get(\"deployment\"), priority = targets::tar_option_get(\"priority\"), resources = targets::tar_option_get(\"resources\"), storage = targets::tar_option_get(\"storage\"), retrieval = targets::tar_option_get(\"retrieval\"), cue = targets::tar_option_get(\"cue\"), description = targets::tar_option_get(\"description\") )"},{"path":"https://njtierney.github.io/geotargets/reference/tar_terra_sprc.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create a terra SpatRasterCollection target — tar_terra_sprc","text":"name Symbol, name target. target name must valid name symbol R, must start dot. See targets::tar_target() information. command R code run target. pattern Code define dynamic branching pattern target. See targets::tar_target() information. filetype character. File format expressed GDAL driver names passed terra::writeRaster(). gdal character. GDAL driver specific datasource creation options. passed terra::writeRaster() ... Additional arguments yet used. tidy_eval Logical, whether enable tidy evaluation interpreting command pattern. TRUE, can use \"bang-bang\" operator !! programmatically insert values global objects. packages Character vector packages load right target runs output data reloaded downstream targets. Use tar_option_set() set packages globally subsequent targets define. library Character vector library paths try loading packages. repository Character length 1, remote repository target storage. Choices: \"local\": file system local machine. \"aws\": Amazon Web Services (AWS) S3 bucket. Can configured non-AWS S3 bucket using endpoint argument tar_resources_aws(), versioning capabilities may lost . See cloud storage section https://books.ropensci.org/targets/data.html details instructions. \"gcp\": Google Cloud Platform storage bucket. See cloud storage section https://books.ropensci.org/targets/data.html details instructions. character string tar_repository_cas() content-addressable storage. Note: repository \"local\" format \"file\" target create single output file. output file uploaded cloud tracked changes exists cloud. local file deleted target runs. error Character length 1, target stops throws error. Options: \"stop\": whole pipeline stops throws error. \"continue\": whole pipeline keeps going. \"null\": errored target continues returns NULL. data hash deliberately wrong target date next run pipeline. \"abridge\": currently running targets keep running, new targets launch . \"trim\": currently running targets stay running. queued target allowed start : downstream error, sibling branch tar_target() call (error happened dynamic branch). idea avoid starting new work immediate error impacts. error = \"trim\" just like error = \"abridge\", allows potentially healthy regions dependency graph begin running. (Visit https://books.ropensci.org/targets/debugging.html learn debug targets using saved workspaces.) memory Character length 1, memory strategy. \"persistent\", target stays memory end pipeline (unless storage \"worker\", case targets unloads value memory right storing order avoid sending copious data network). \"transient\", target gets unloaded every new target completes. Either way, target gets automatically loaded memory whenever another target needs value. cloud-based dynamic files (e.g. format = \"file\" repository = \"aws\"), memory strategy applies temporary local copy file: \"persistent\" means remains end pipeline deleted, \"transient\" means gets deleted soon possible. former conserves bandwidth, latter conserves local storage. garbage_collection Logical, whether run base::gc() just target runs. deployment Character length 1. deployment \"main\", target run central controlling R process. Otherwise, deployment \"worker\" set pipeline distributed/parallel computing, target runs parallel worker. distributed/parallel computing targets, please visit https://books.ropensci.org/targets/crew.html. priority Numeric length 1 0 1. Controls targets get deployed first multiple competing targets ready simultaneously. Targets priorities closer 1 get dispatched earlier (polled earlier tar_make_future()). resources Object returned tar_resources() optional settings high-performance computing functionality, alternative data storage formats, optional capabilities targets. See tar_resources() details. storage Character length 1, relevant tar_make_clustermq() tar_make_future(). Must one following values: \"main\": target's return value sent back host machine saved/uploaded locally. \"worker\": worker saves/uploads value. \"none\": almost never recommended. niche situations, e.g. data needs loaded explicitly another language. use , return value target totally ignored target ends, downstream target still attempts load data file (except retrieval = \"none\"). select storage = \"none\", return value target's command ignored, data saved automatically. dynamic files (format = \"file\") responsibility user write data store inside target. distinguishing feature storage = \"none\" (opposed format = \"file\") general case, downstream targets automatically try load data data store dependency. corollary, storage = \"none\" completely unnecessary format \"file\". retrieval Character length 1, relevant tar_make_clustermq() tar_make_future(). Must one following values: \"main\": target's dependencies loaded host machine sent worker target runs. \"worker\": worker loads targets dependencies. \"none\": dependencies loaded . choice almost never recommended. niche situations, e.g. data needs loaded explicitly another language. cue optional object tar_cue() customize rules decide whether target date. description Character length 1, custom free-form human-readable text description target. Descriptions appear target labels functions like tar_manifest() tar_visnetwork(), let select subsets targets names argument functions like tar_make(). example, tar_manifest(names = tar_described_as(starts_with(\"survival model\"))) lists targets whose descriptions start character string \"survival model\".","code":""},{"path":"https://njtierney.github.io/geotargets/reference/tar_terra_sprc.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create a terra SpatRasterCollection target — tar_terra_sprc","text":"target class \"tar_stem\" use target pipeline","code":""},{"path":"https://njtierney.github.io/geotargets/reference/tar_terra_sprc.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Create a terra SpatRasterCollection target — tar_terra_sprc","text":"iteration argument unavailable hard-coded \"list\", option works currently.","code":""},{"path":[]},{"path":"https://njtierney.github.io/geotargets/reference/tar_terra_sprc.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Create a terra SpatRasterCollection target — tar_terra_sprc","text":"Andrew Gene Brown Nicholas Tierney","code":""},{"path":"https://njtierney.github.io/geotargets/reference/tar_terra_sprc.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create a terra SpatRasterCollection target — tar_terra_sprc","text":"","code":"if (Sys.getenv(\"TAR_LONG_EXAMPLES\") == \"true\") { targets::tar_dir({ # tar_dir() runs code from a temporary directory. library(geotargets) targets::tar_script({ elev_scale <- function(z = 1, projection = \"EPSG:4326\") { terra::project( terra::rast(system.file(\"ex\", \"elev.tif\", package = \"terra\")) * z, projection ) } list( tar_terra_sprc( raster_elevs, # two rasters, one unaltered, one scaled by factor of 2 and # reprojected to interrupted good homolosine command = terra::sprc(list( elev_scale(1), elev_scale(2, \"+proj=igh\") )) ) ) }) targets::tar_make() x <- targets::tar_read(raster_elevs) }) }"},{"path":"https://njtierney.github.io/geotargets/reference/tar_terra_tiles.html","id":null,"dir":"Reference","previous_headings":"","what":"Split a raster into tiles that can be iterated over with dynamic branching — tar_terra_tiles","title":"Split a raster into tiles that can be iterated over with dynamic branching — tar_terra_tiles","text":"target factory useful raster large high resolution work -memory. can instead split tiles can iterated using dynamic branching.","code":""},{"path":"https://njtierney.github.io/geotargets/reference/tar_terra_tiles.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Split a raster into tiles that can be iterated over with dynamic branching — tar_terra_tiles","text":"","code":"tar_terra_tiles( name, raster, tile_fun, filetype = geotargets_option_get(\"gdal.raster.driver\"), gdal = geotargets_option_get(\"gdal.raster.creation.options\"), ..., packages = targets::tar_option_get(\"packages\"), library = targets::tar_option_get(\"library\"), repository = targets::tar_option_get(\"repository\"), error = targets::tar_option_get(\"error\"), memory = targets::tar_option_get(\"memory\"), garbage_collection = targets::tar_option_get(\"garbage_collection\"), deployment = targets::tar_option_get(\"deployment\"), priority = targets::tar_option_get(\"priority\"), resources = targets::tar_option_get(\"resources\"), storage = targets::tar_option_get(\"storage\"), retrieval = targets::tar_option_get(\"retrieval\"), cue = targets::tar_option_get(\"cue\"), description = targets::tar_option_get(\"description\") )"},{"path":"https://njtierney.github.io/geotargets/reference/tar_terra_tiles.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Split a raster into tiles that can be iterated over with dynamic branching — tar_terra_tiles","text":"name Symbol, name target. target name must valid name symbol R, must start dot. See targets::tar_target() information. raster SpatRaster object split tiles. tile_fun helper function returns list numeric vectors tile_grid(), tile_n() tile_blocksize specified one following ways: named function, e.g. tile_blocksize \"tile_blocksize\". anonymous function, e.g. \\(x) tile_grid(x, nrow = 2, ncol = 2). filetype character. File format expressed GDAL driver names passed terra::makeTiles(). gdal character. GDAL driver specific datasource creation options passed terra::makeTiles(). ... additional arguments yet used. packages Character vector packages load right target runs output data reloaded downstream targets. Use tar_option_set() set packages globally subsequent targets define. library Character vector library paths try loading packages. repository Character length 1, remote repository target storage. Choices: \"local\": file system local machine. \"aws\": Amazon Web Services (AWS) S3 bucket. Can configured non-AWS S3 bucket using endpoint argument tar_resources_aws(), versioning capabilities may lost . See cloud storage section https://books.ropensci.org/targets/data.html details instructions. \"gcp\": Google Cloud Platform storage bucket. See cloud storage section https://books.ropensci.org/targets/data.html details instructions. character string tar_repository_cas() content-addressable storage. Note: repository \"local\" format \"file\" target create single output file. output file uploaded cloud tracked changes exists cloud. local file deleted target runs. error Character length 1, target stops throws error. Options: \"stop\": whole pipeline stops throws error. \"continue\": whole pipeline keeps going. \"null\": errored target continues returns NULL. data hash deliberately wrong target date next run pipeline. \"abridge\": currently running targets keep running, new targets launch . \"trim\": currently running targets stay running. queued target allowed start : downstream error, sibling branch tar_target() call (error happened dynamic branch). idea avoid starting new work immediate error impacts. error = \"trim\" just like error = \"abridge\", allows potentially healthy regions dependency graph begin running. (Visit https://books.ropensci.org/targets/debugging.html learn debug targets using saved workspaces.) memory Character length 1, memory strategy. \"persistent\", target stays memory end pipeline (unless storage \"worker\", case targets unloads value memory right storing order avoid sending copious data network). \"transient\", target gets unloaded every new target completes. Either way, target gets automatically loaded memory whenever another target needs value. cloud-based dynamic files (e.g. format = \"file\" repository = \"aws\"), memory strategy applies temporary local copy file: \"persistent\" means remains end pipeline deleted, \"transient\" means gets deleted soon possible. former conserves bandwidth, latter conserves local storage. garbage_collection Logical, whether run base::gc() just target runs. deployment Character length 1. deployment \"main\", target run central controlling R process. Otherwise, deployment \"worker\" set pipeline distributed/parallel computing, target runs parallel worker. distributed/parallel computing targets, please visit https://books.ropensci.org/targets/crew.html. priority Numeric length 1 0 1. Controls targets get deployed first multiple competing targets ready simultaneously. Targets priorities closer 1 get dispatched earlier (polled earlier tar_make_future()). resources Object returned tar_resources() optional settings high-performance computing functionality, alternative data storage formats, optional capabilities targets. See tar_resources() details. storage Character length 1, relevant tar_make_clustermq() tar_make_future(). Must one following values: \"main\": target's return value sent back host machine saved/uploaded locally. \"worker\": worker saves/uploads value. \"none\": almost never recommended. niche situations, e.g. data needs loaded explicitly another language. use , return value target totally ignored target ends, downstream target still attempts load data file (except retrieval = \"none\"). select storage = \"none\", return value target's command ignored, data saved automatically. dynamic files (format = \"file\") responsibility user write data store inside target. distinguishing feature storage = \"none\" (opposed format = \"file\") general case, downstream targets automatically try load data data store dependency. corollary, storage = \"none\" completely unnecessary format \"file\". retrieval Character length 1, relevant tar_make_clustermq() tar_make_future(). Must one following values: \"main\": target's dependencies loaded host machine sent worker target runs. \"worker\": worker loads targets dependencies. \"none\": dependencies loaded . choice almost never recommended. niche situations, e.g. data needs loaded explicitly another language. cue optional object tar_cue() customize rules decide whether target date. description Character length 1, custom free-form human-readable text description target. Descriptions appear target labels functions like tar_manifest() tar_visnetwork(), let select subsets targets names argument functions like tar_make(). example, tar_manifest(names = tar_described_as(starts_with(\"survival model\"))) lists targets whose descriptions start character string \"survival model\".","code":""},{"path":"https://njtierney.github.io/geotargets/reference/tar_terra_tiles.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Split a raster into tiles that can be iterated over with dynamic branching — tar_terra_tiles","text":"list two targets: upstream target creates list extents downstream pattern maps extents create list SpatRaster objects.","code":""},{"path":"https://njtierney.github.io/geotargets/reference/tar_terra_tiles.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Split a raster into tiles that can be iterated over with dynamic branching — tar_terra_tiles","text":"iteration argument unavailable hard-coded \"list\", option works currently. using tile_blocksize() helper function, may need set memory = \"transient\" upstream target provided raster argument tar_terra_tiles(). details help file tile_blocksize().","code":""},{"path":[]},{"path":"https://njtierney.github.io/geotargets/reference/tar_terra_tiles.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Split a raster into tiles that can be iterated over with dynamic branching — tar_terra_tiles","text":"Eric Scott","code":""},{"path":"https://njtierney.github.io/geotargets/reference/tar_terra_tiles.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Split a raster into tiles that can be iterated over with dynamic branching — tar_terra_tiles","text":"","code":"if (Sys.getenv(\"TAR_LONG_EXAMPLES\") == \"true\") { targets::tar_dir({ targets::tar_script({ library(targets) library(geotargets) library(terra) list( tar_target( my_file, system.file(\"ex/elev.tif\", package=\"terra\"), format = \"file\" ), tar_terra_rast( my_map, terra::rast(my_file) ), tar_terra_tiles( name = rast_split, raster = my_map, ncol = 2, nrow = 2 ) ) }) targets::tar_manifest() }) }"},{"path":"https://njtierney.github.io/geotargets/reference/tar_terra_vect.html","id":null,"dir":"Reference","previous_headings":"","what":"Create a terra SpatVector target — tar_terra_vect","title":"Create a terra SpatVector target — tar_terra_vect","text":"Provides target format terra::SpatVector objects.","code":""},{"path":"https://njtierney.github.io/geotargets/reference/tar_terra_vect.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create a terra SpatVector target — tar_terra_vect","text":"","code":"tar_terra_vect( name, command, pattern = NULL, filetype = geotargets_option_get(\"gdal.vector.driver\"), gdal = geotargets_option_get(\"gdal.vector.creation.options\"), ..., packages = targets::tar_option_get(\"packages\"), tidy_eval = targets::tar_option_get(\"tidy_eval\"), library = targets::tar_option_get(\"library\"), repository = targets::tar_option_get(\"repository\"), error = targets::tar_option_get(\"error\"), memory = targets::tar_option_get(\"memory\"), garbage_collection = targets::tar_option_get(\"garbage_collection\"), deployment = targets::tar_option_get(\"deployment\"), priority = targets::tar_option_get(\"priority\"), resources = targets::tar_option_get(\"resources\"), storage = targets::tar_option_get(\"storage\"), retrieval = targets::tar_option_get(\"retrieval\"), cue = targets::tar_option_get(\"cue\"), description = targets::tar_option_get(\"description\") )"},{"path":"https://njtierney.github.io/geotargets/reference/tar_terra_vect.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create a terra SpatVector target — tar_terra_vect","text":"name Symbol, name target. target name must valid name symbol R, must start dot. See targets::tar_target() information. command R code run target. pattern Code define dynamic branching pattern target. See targets::tar_target() information. filetype character. File format expressed GDAL driver names passed terra::writeVector(). See 'Note' details. gdal character. GDAL driver specific datasource creation options passed terra::writeVector(). ... Additional arguments yet used. packages Character vector packages load right target runs output data reloaded downstream targets. Use tar_option_set() set packages globally subsequent targets define. tidy_eval Logical, whether enable tidy evaluation interpreting command pattern. TRUE, can use \"bang-bang\" operator !! programmatically insert values global objects. library Character vector library paths try loading packages. repository Character length 1, remote repository target storage. Choices: \"local\": file system local machine. \"aws\": Amazon Web Services (AWS) S3 bucket. Can configured non-AWS S3 bucket using endpoint argument tar_resources_aws(), versioning capabilities may lost . See cloud storage section https://books.ropensci.org/targets/data.html details instructions. \"gcp\": Google Cloud Platform storage bucket. See cloud storage section https://books.ropensci.org/targets/data.html details instructions. character string tar_repository_cas() content-addressable storage. Note: repository \"local\" format \"file\" target create single output file. output file uploaded cloud tracked changes exists cloud. local file deleted target runs. error Character length 1, target stops throws error. Options: \"stop\": whole pipeline stops throws error. \"continue\": whole pipeline keeps going. \"null\": errored target continues returns NULL. data hash deliberately wrong target date next run pipeline. \"abridge\": currently running targets keep running, new targets launch . \"trim\": currently running targets stay running. queued target allowed start : downstream error, sibling branch tar_target() call (error happened dynamic branch). idea avoid starting new work immediate error impacts. error = \"trim\" just like error = \"abridge\", allows potentially healthy regions dependency graph begin running. (Visit https://books.ropensci.org/targets/debugging.html learn debug targets using saved workspaces.) memory Character length 1, memory strategy. \"persistent\", target stays memory end pipeline (unless storage \"worker\", case targets unloads value memory right storing order avoid sending copious data network). \"transient\", target gets unloaded every new target completes. Either way, target gets automatically loaded memory whenever another target needs value. cloud-based dynamic files (e.g. format = \"file\" repository = \"aws\"), memory strategy applies temporary local copy file: \"persistent\" means remains end pipeline deleted, \"transient\" means gets deleted soon possible. former conserves bandwidth, latter conserves local storage. garbage_collection Logical, whether run base::gc() just target runs. deployment Character length 1. deployment \"main\", target run central controlling R process. Otherwise, deployment \"worker\" set pipeline distributed/parallel computing, target runs parallel worker. distributed/parallel computing targets, please visit https://books.ropensci.org/targets/crew.html. priority Numeric length 1 0 1. Controls targets get deployed first multiple competing targets ready simultaneously. Targets priorities closer 1 get dispatched earlier (polled earlier tar_make_future()). resources Object returned tar_resources() optional settings high-performance computing functionality, alternative data storage formats, optional capabilities targets. See tar_resources() details. storage Character length 1, relevant tar_make_clustermq() tar_make_future(). Must one following values: \"main\": target's return value sent back host machine saved/uploaded locally. \"worker\": worker saves/uploads value. \"none\": almost never recommended. niche situations, e.g. data needs loaded explicitly another language. use , return value target totally ignored target ends, downstream target still attempts load data file (except retrieval = \"none\"). select storage = \"none\", return value target's command ignored, data saved automatically. dynamic files (format = \"file\") responsibility user write data store inside target. distinguishing feature storage = \"none\" (opposed format = \"file\") general case, downstream targets automatically try load data data store dependency. corollary, storage = \"none\" completely unnecessary format \"file\". retrieval Character length 1, relevant tar_make_clustermq() tar_make_future(). Must one following values: \"main\": target's dependencies loaded host machine sent worker target runs. \"worker\": worker loads targets dependencies. \"none\": dependencies loaded . choice almost never recommended. niche situations, e.g. data needs loaded explicitly another language. cue optional object tar_cue() customize rules decide whether target date. description Character length 1, custom free-form human-readable text description target. Descriptions appear target labels functions like tar_manifest() tar_visnetwork(), let select subsets targets names argument functions like tar_make(). example, tar_manifest(names = tar_described_as(starts_with(\"survival model\"))) lists targets whose descriptions start character string \"survival model\".","code":""},{"path":"https://njtierney.github.io/geotargets/reference/tar_terra_vect.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create a terra SpatVector target — tar_terra_vect","text":"target class \"tar_stem\" use target pipeline","code":""},{"path":"https://njtierney.github.io/geotargets/reference/tar_terra_vect.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Create a terra SpatVector target — tar_terra_vect","text":"terra::SpatVector objects contain vector data directly—contain C++ pointer memory data stored. result, objects portable R sessions without special handling, causes problems including targets pipelines tar_target(). tar_terra_rast() handles issue writing reading target geospatial file (specified filetype) rather saving SpatVector object .","code":""},{"path":"https://njtierney.github.io/geotargets/reference/tar_terra_vect.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Create a terra SpatVector target — tar_terra_vect","text":"iteration argument unavailable hard-coded \"list\", option works currently. Although may pass supported GDAL vector driver filetype argument, formats guaranteed work geotargets. moment, tested GeoJSON ESRI Shapefile appear work generally.","code":""},{"path":"https://njtierney.github.io/geotargets/reference/tar_terra_vect.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create a terra SpatVector target — tar_terra_vect","text":"","code":"if (Sys.getenv(\"TAR_LONG_EXAMPLES\") == \"true\") { targets::tar_dir({ # tar_dir() runs code from a temporary directory. targets::tar_script({ lux_area <- function(projection = \"EPSG:4326\") { terra::project( terra::vect(system.file(\"ex\", \"lux.shp\", package = \"terra\" )), projection ) } list( geotargets::tar_terra_vect( terra_vect_example, lux_area() ) ) }) targets::tar_make() x <- targets::tar_read(terra_vect_example) }) }"},{"path":"https://njtierney.github.io/geotargets/reference/tile_helpers.html","id":null,"dir":"Reference","previous_headings":"","what":"Helper functions to create tiles — tile_grid","title":"Helper functions to create tiles — tile_grid","text":"Wrappers around terra::getTileExtents() return list named numeric vectors describing extents tiles rather SpatExtent objects. may general use, intended primarily supplying tile_fun argument tar_terra_tiles().","code":""},{"path":"https://njtierney.github.io/geotargets/reference/tile_helpers.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Helper functions to create tiles — tile_grid","text":"","code":"tile_grid(raster, ncol, nrow) tile_blocksize(raster, n_blocks_row = 1, n_blocks_col = 1) tile_n(raster, n)"},{"path":"https://njtierney.github.io/geotargets/reference/tile_helpers.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Helper functions to create tiles — tile_grid","text":"raster SpatRaster object. ncol integer; number columns split SpatRaster . nrow integer; number rows split SpatRaster . n_blocks_row integer; multiple blocksize include tile vertically. n_blocks_col integer; multiple blocksize include tile horizontally. n integer; total number tiles split SpatRaster .","code":""},{"path":"https://njtierney.github.io/geotargets/reference/tile_helpers.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Helper functions to create tiles — tile_grid","text":"list named numeric vectors xmin, xmax, ymin, ymax values can coerced SpatExtent objects terra::ext().","code":""},{"path":"https://njtierney.github.io/geotargets/reference/tile_helpers.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Helper functions to create tiles — tile_grid","text":"tile_blocksize() creates extents using raster's native block size (see terra::fileBlocksize()), memory efficient. Create tiles multiples raster's blocksize n_blocks_row n_blocks_col. strongly suggest user explore many tiles created tile_blocksize() creating dynamically branched target using helper. Note block size property files apply -memory SpatRasters. Therefore, want use helper tar_terra_tiles() may need ensure upstream target provided raster argument memory setting memory = \"transient\". tile_grid() allows specification number rows columns split raster . E.g. nrow = 2 ncol = 2 create 4 tiles (specifies 2x2 matrix, 4 elements). tile_n() creates () n tiles prints number rows, columns, total tiles created.","code":""},{"path":"https://njtierney.github.io/geotargets/reference/tile_helpers.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Helper functions to create tiles — tile_grid","text":"Eric Scott","code":""},{"path":[]},{"path":"https://njtierney.github.io/geotargets/news/index.html","id":"geotargets-development-version","dir":"Changelog","previous_headings":"","what":"geotargets (development version)","title":"geotargets (development version)","text":"bugfix @brownag fixes use file.rename() tar_terra_rast(..., preserve_metadata = \"zip\"), work temporary directory different partition. (#121, PR #122).","code":""},{"path":"https://njtierney.github.io/geotargets/news/index.html","id":"geotargets-020-29-november-2024","dir":"Changelog","previous_headings":"","what":"geotargets 0.2.0 (29 November 2024)","title":"geotargets 0.2.0 (29 November 2024)","text":"Created tar_stars() tar_stars_proxy() create stars stars_proxy objects, respectively. Created tar_terra_tiles(), “target factory” splitting raster multiple tiles dynamic branching (#69). Created two helper functions use tar_terra_tiles(): tile_grid(), tile_n(), tile_blocksize() (#69, #86, #87, #89). Created utility function set_window() mostly internal use within tar_terra_tiles(). Removes iteration argument tar_*() functions. iteration now hard-coded \"list\" since option works (now least). Added description argument tar_*() functions passed tar_target(). Suppressed warning “[rast] skipped sub-datasets” tar_terra_sprc(), misleading context (#92, #104). Requires GDAL 3.1 greater use “ESRI Shapefile” driver tar_terra_vect() (#71, #97) geotargets now requires targets version 1.8.0 higher tar_terra_rast() gains preserve_metadata option set \"zip\" reads/writes targets zip archives include aux.json “sidecar” files sometimes written terra (#58) terra (>= 1.7.71), withr (>= 3.0.0), zip now required dependencies geotargets (moved Suggests Imports)","code":""},{"path":"https://njtierney.github.io/geotargets/news/index.html","id":"geotargets-010-14-may-2024","dir":"Changelog","previous_headings":"","what":"geotargets 0.1.0 (14 May 2024)","title":"geotargets 0.1.0 (14 May 2024)","text":"Created tar_terra_rast() tar_terra_vect() targets create SpatRaster SpatVector objects, respectively Created tar_terra_sprc() creates SpatRasterCollection object. geotargets_options_get() geotargets_options_set() can used set get options specific geotargets. geotargets now requires targets version 1.7.0 higher fixed bug resources supplied tar_terra_*() ignored (#66)","code":""}] +[{"path":[]},{"path":"https://njtierney.github.io/geotargets/CODE_OF_CONDUCT.html","id":"our-pledge","dir":"","previous_headings":"","what":"Our Pledge","title":"Contributor Covenant Code of Conduct","text":"members, contributors, leaders pledge make participation community harassment-free experience everyone, regardless age, body size, visible invisible disability, ethnicity, sex characteristics, gender identity expression, level experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, sexual identity orientation. pledge act interact ways contribute open, welcoming, diverse, inclusive, healthy community.","code":""},{"path":"https://njtierney.github.io/geotargets/CODE_OF_CONDUCT.html","id":"our-standards","dir":"","previous_headings":"","what":"Our Standards","title":"Contributor Covenant Code of Conduct","text":"Examples behavior contributes positive environment community include: Demonstrating empathy kindness toward people respectful differing opinions, viewpoints, experiences Giving gracefully accepting constructive feedback Accepting responsibility apologizing affected mistakes, learning experience Focusing best just us individuals, overall community Examples unacceptable behavior include: use sexualized language imagery, sexual attention advances kind Trolling, insulting derogatory comments, personal political attacks Public private harassment Publishing others’ private information, physical email address, without explicit permission conduct reasonably considered inappropriate professional setting","code":""},{"path":"https://njtierney.github.io/geotargets/CODE_OF_CONDUCT.html","id":"enforcement-responsibilities","dir":"","previous_headings":"","what":"Enforcement Responsibilities","title":"Contributor Covenant Code of Conduct","text":"Community leaders responsible clarifying enforcing standards acceptable behavior take appropriate fair corrective action response behavior deem inappropriate, threatening, offensive, harmful. Community leaders right responsibility remove, edit, reject comments, commits, code, wiki edits, issues, contributions aligned Code Conduct, communicate reasons moderation decisions appropriate.","code":""},{"path":"https://njtierney.github.io/geotargets/CODE_OF_CONDUCT.html","id":"scope","dir":"","previous_headings":"","what":"Scope","title":"Contributor Covenant Code of Conduct","text":"Code Conduct applies within community spaces, also applies individual officially representing community public spaces. Examples representing community include using official e-mail address, posting via official social media account, acting appointed representative online offline event.","code":""},{"path":"https://njtierney.github.io/geotargets/CODE_OF_CONDUCT.html","id":"enforcement","dir":"","previous_headings":"","what":"Enforcement","title":"Contributor Covenant Code of Conduct","text":"Instances abusive, harassing, otherwise unacceptable behavior may reported community leaders responsible enforcement nicholas.tierney@gmail.com. complaints reviewed investigated promptly fairly. community leaders obligated respect privacy security reporter incident.","code":""},{"path":"https://njtierney.github.io/geotargets/CODE_OF_CONDUCT.html","id":"enforcement-guidelines","dir":"","previous_headings":"","what":"Enforcement Guidelines","title":"Contributor Covenant Code of Conduct","text":"Community leaders follow Community Impact Guidelines determining consequences action deem violation Code Conduct:","code":""},{"path":"https://njtierney.github.io/geotargets/CODE_OF_CONDUCT.html","id":"id_1-correction","dir":"","previous_headings":"Enforcement Guidelines","what":"1. Correction","title":"Contributor Covenant Code of Conduct","text":"Community Impact: Use inappropriate language behavior deemed unprofessional unwelcome community. Consequence: private, written warning community leaders, providing clarity around nature violation explanation behavior inappropriate. public apology may requested.","code":""},{"path":"https://njtierney.github.io/geotargets/CODE_OF_CONDUCT.html","id":"id_2-warning","dir":"","previous_headings":"Enforcement Guidelines","what":"2. Warning","title":"Contributor Covenant Code of Conduct","text":"Community Impact: violation single incident series actions. Consequence: warning consequences continued behavior. interaction people involved, including unsolicited interaction enforcing Code Conduct, specified period time. includes avoiding interactions community spaces well external channels like social media. Violating terms may lead temporary permanent ban.","code":""},{"path":"https://njtierney.github.io/geotargets/CODE_OF_CONDUCT.html","id":"id_3-temporary-ban","dir":"","previous_headings":"Enforcement Guidelines","what":"3. Temporary Ban","title":"Contributor Covenant Code of Conduct","text":"Community Impact: serious violation community standards, including sustained inappropriate behavior. Consequence: temporary ban sort interaction public communication community specified period time. public private interaction people involved, including unsolicited interaction enforcing Code Conduct, allowed period. Violating terms may lead permanent ban.","code":""},{"path":"https://njtierney.github.io/geotargets/CODE_OF_CONDUCT.html","id":"id_4-permanent-ban","dir":"","previous_headings":"Enforcement Guidelines","what":"4. Permanent Ban","title":"Contributor Covenant Code of Conduct","text":"Community Impact: Demonstrating pattern violation community standards, including sustained inappropriate behavior, harassment individual, aggression toward disparagement classes individuals. Consequence: permanent ban sort public interaction within community.","code":""},{"path":"https://njtierney.github.io/geotargets/CODE_OF_CONDUCT.html","id":"attribution","dir":"","previous_headings":"","what":"Attribution","title":"Contributor Covenant Code of Conduct","text":"Code Conduct adapted Contributor Covenant, version 2.1, available https://www.contributor-covenant.org/version/2/1/code_of_conduct.html. Community Impact Guidelines inspired [Mozilla’s code conduct enforcement ladder][https://github.com/mozilla/inclusion]. answers common questions code conduct, see FAQ https://www.contributor-covenant.org/faq. Translations available https://www.contributor-covenant.org/translations.","code":""},{"path":"https://njtierney.github.io/geotargets/CONTRIBUTING.html","id":null,"dir":"","previous_headings":"","what":"Contributing to geotargets","title":"Contributing to geotargets","text":"outlines propose change geotargets. detailed discussion contributing tidyverse packages, please see development contributing guide code review principles.","code":""},{"path":"https://njtierney.github.io/geotargets/CONTRIBUTING.html","id":"fixing-typos","dir":"","previous_headings":"","what":"Fixing typos","title":"Contributing to geotargets","text":"can fix typos, spelling mistakes, grammatical errors documentation directly using GitHub web interface, long changes made source file. generally means ’ll need edit roxygen2 comments .R, .Rd file. can find .R file generates .Rd reading comment first line.","code":""},{"path":"https://njtierney.github.io/geotargets/CONTRIBUTING.html","id":"bigger-changes","dir":"","previous_headings":"","what":"Bigger changes","title":"Contributing to geotargets","text":"want make bigger change, ’s good idea first file issue make sure someone team agrees ’s needed. ’ve found bug, please file issue illustrates bug minimal reprex (also help write unit test, needed). See guide create great issue advice.","code":""},{"path":"https://njtierney.github.io/geotargets/CONTRIBUTING.html","id":"pull-request-process","dir":"","previous_headings":"Bigger changes","what":"Pull request process","title":"Contributing to geotargets","text":"Fork package clone onto computer. haven’t done , recommend using usethis::create_from_github(\"njtierney/geotargets\", fork = TRUE). Install development dependencies devtools::install_dev_deps(), make sure package passes R CMD check running devtools::check(). R CMD check doesn’t pass cleanly, ’s good idea ask help continuing. Create Git branch pull request (PR). recommend using usethis::pr_init(\"brief-description--change\"). Make changes, commit git, create PR running usethis::pr_push(), following prompts browser. title PR briefly describe change. body PR contain Fixes #issue-number. user-facing changes, add bullet top NEWS.md (.e. just first header). Follow style described https://style.tidyverse.org/news.html.","code":""},{"path":"https://njtierney.github.io/geotargets/CONTRIBUTING.html","id":"code-style","dir":"","previous_headings":"Bigger changes","what":"Code style","title":"Contributing to geotargets","text":"New code follow tidyverse style guide. can use styler package apply styles, please don’t restyle code nothing PR. use roxygen2, Markdown syntax, documentation. use testthat unit tests. Contributions test cases included easier accept.","code":""},{"path":"https://njtierney.github.io/geotargets/CONTRIBUTING.html","id":"code-of-conduct","dir":"","previous_headings":"","what":"Code of Conduct","title":"Contributing to geotargets","text":"Please note geotargets project released Contributor Code Conduct. contributing project agree abide terms.","code":""},{"path":"https://njtierney.github.io/geotargets/LICENSE.html","id":null,"dir":"","previous_headings":"","what":"MIT License","title":"MIT License","text":"Copyright (c) 2024 geotargets authors Permission hereby granted, free charge, person obtaining copy software associated documentation files (“Software”), deal Software without restriction, including without limitation rights use, copy, modify, merge, publish, distribute, sublicense, /sell copies Software, permit persons Software furnished , subject following conditions: copyright notice permission notice shall included copies substantial portions Software. SOFTWARE PROVIDED “”, WITHOUT WARRANTY KIND, EXPRESS IMPLIED, INCLUDING LIMITED WARRANTIES MERCHANTABILITY, FITNESS PARTICULAR PURPOSE NONINFRINGEMENT. EVENT SHALL AUTHORS COPYRIGHT HOLDERS LIABLE CLAIM, DAMAGES LIABILITY, WHETHER ACTION CONTRACT, TORT OTHERWISE, ARISING , CONNECTION SOFTWARE USE DEALINGS SOFTWARE.","code":""},{"path":"https://njtierney.github.io/geotargets/articles/geotargets.html","id":"tar_terra_rast-targets-with-terra-rasters","dir":"Articles","previous_headings":"","what":"tar_terra_rast(): targets with terra rasters","title":"Using `terra` with `geotargets`","text":"basic example showing use tar_terra_rast() targets pipeline. command tar_terra_rast() can function returns SpatRaster object. example, ’ve set output cloud optimized geotiff (“COG”), GDAL driver works terra::writeRaster() also work . can also set option target--target basis filetype argument tar_terra_rast(). Running pipeline:","code":"# contents of _targets.R: library(targets) library(geotargets) tar_option_set(packages = \"terra\") geotargets_option_set(gdal_raster_driver = \"COG\") list( tar_target( tif_file, system.file(\"ex/elev.tif\", package = \"terra\"), format = \"file\" ), tar_terra_rast( r, { rast <- rast(tif_file) units(rast) <- \"m\" rast } ), tar_terra_rast( r_agg, aggregate(r, 2) ) ) tar_make() #> Error in get(paste0(generic, \".\", class), envir = get_method_env()) : #> object 'type_sum.accel' not found #> ▶ dispatched target tif_file #> ● completed target tif_file [0.008 seconds, 7.994 kilobytes] #> ▶ dispatched target r #> ● completed target r [0.003 seconds, 10.433 kilobytes] #> ▶ dispatched target r_agg #> ● completed target r_agg [0.003 seconds, 6.303 kilobytes] #> ▶ ended pipeline [0.129 seconds] #> tar_read(r) #> class : SpatRaster #> dimensions : 90, 95, 1 (nrow, ncol, nlyr) #> resolution : 0.008333333, 0.008333333 (x, y) #> extent : 5.741667, 6.533333, 49.44167, 50.19167 (xmin, xmax, ymin, ymax) #> coord. ref. : lon/lat WGS 84 (EPSG:4326) #> source : r #> name : elevation #> min value : 141 #> max value : 547 tar_read(r_agg) #> class : SpatRaster #> dimensions : 45, 48, 1 (nrow, ncol, nlyr) #> resolution : 0.01666667, 0.01666667 (x, y) #> extent : 5.741667, 6.541667, 49.44167, 50.19167 (xmin, xmax, ymin, ymax) #> coord. ref. : lon/lat WGS 84 (EPSG:4326) #> source : r_agg #> name : elevation #> min value : 166.75 #> max value : 529.50"},{"path":"https://njtierney.github.io/geotargets/articles/geotargets.html","id":"raster-metadata","dir":"Articles","previous_headings":"tar_terra_rast(): targets with terra rasters","what":"Raster metadata","title":"Using `terra` with `geotargets`","text":"may noticed units r target gone missing. due limitations terra targets—terra saves metadata “sidecar” aux.json files targets enforces strict one file per target rule. can get around setting preserve_metadata = \"zip\" tar_terra_rast() save output files, including metadata, minimally compressed zip archive. can also set raster targets geotargets_option_set(terra_preserve_metadata = \"zip\"). Note: likely performance costs associated option. alternative, can encode information layer names setting names(r) <- retained even default preserve_metadata = \"drop\".","code":"# contents of _targets.R: library(targets) library(geotargets) tar_option_set(packages = \"terra\") geotargets_option_set(gdal_raster_driver = \"COG\") list( tar_target( tif_file, system.file(\"ex/elev.tif\", package = \"terra\"), format = \"file\" ), tar_terra_rast( r, { rast <- rast(tif_file) units(rast) <- \"m\" rast }, preserve_metadata = \"zip\" ) ) tar_make() #> Error in get(paste0(generic, \".\", class), envir = get_method_env()) : #> object 'type_sum.accel' not found #> ✔ skipped target tif_file #> ▶ dispatched target r #> ● completed target r [0.004 seconds, 10.252 kilobytes] #> ▶ ended pipeline [0.127 seconds] #> terra::units(tar_read(r)) #> [1] \"\""},{"path":"https://njtierney.github.io/geotargets/articles/geotargets.html","id":"tar_terra_vect-targets-with-terra-vectors","dir":"Articles","previous_headings":"","what":"tar_terra_vect(): targets with terra vectors","title":"Using `terra` with `geotargets`","text":"terra SpatVector objects, use tar_terra_vect() pipeline. can set vector specific options geotargets_option_set() filetype gdal arguments individual tar_terra_vect() calls.","code":"# contents of _targets.R: library(targets) library(geotargets) geotargets_option_set(gdal_vector_driver = \"GeoJSON\") list( tar_target( vect_file, system.file(\"ex\", \"lux.shp\", package = \"terra\"), format = \"file\" ), tar_terra_vect( v, terra::vect(vect_file) ), tar_terra_vect( v_proj, terra::project(v, \"EPSG:2196\") ) ) tar_make() #> Error in get(paste0(generic, \".\", class), envir = get_method_env()) : #> object 'type_sum.accel' not found #> ▶ dispatched target vect_file #> ● completed target vect_file [0 seconds, 64.692 kilobytes] #> ▶ dispatched target v #> ● completed target v [0.009 seconds, 117.629 kilobytes] #> ▶ dispatched target v_proj #> ● completed target v_proj [0.016 seconds, 213.534 kilobytes] #> ▶ ended pipeline [0.128 seconds] #> tar_read(v) #> class : SpatVector #> geometry : polygons #> dimensions : 12, 6 (geometries, attributes) #> extent : 5.74414, 6.528252, 49.44781, 50.18162 (xmin, xmax, ymin, ymax) #> source : v #> coord. ref. : lon/lat WGS 84 (EPSG:4326) #> names : ID_1 NAME_1 ID_2 NAME_2 AREA POP #> type : #> values : 1 Diekirch 1 Clervaux 312 1.808e+04 #> 1 Diekirch 2 Diekirch 218 3.254e+04 #> 1 Diekirch 3 Redange 259 1.866e+04 tar_read(v_proj) #> class : SpatVector #> geometry : polygons #> dimensions : 12, 6 (geometries, attributes) #> extent : -69990.51, -13879.85, 5484907, 5566555 (xmin, xmax, ymin, ymax) #> source : v_proj #> coord. ref. : ETRS89 / Kp2000 Jutland (EPSG:2196) #> names : ID_1 NAME_1 ID_2 NAME_2 AREA POP #> type : #> values : 1 Diekirch 1 Clervaux 312 1.808e+04 #> 1 Diekirch 2 Diekirch 218 3.254e+04 #> 1 Diekirch 3 Redange 259 1.866e+04"},{"path":"https://njtierney.github.io/geotargets/articles/geotargets.html","id":"tar_terra_sprc-targets-with-terra-raster-collections","dir":"Articles","previous_headings":"","what":"tar_terra_sprc(): targets with terra raster collections","title":"Using `terra` with `geotargets`","text":"Targets produce SpatRasterCollection can created tar_terra_sprc(). various rasters collection saved subdatasets adhere targets one file per target rule.","code":"# contents of _targets.R: library(targets) library(geotargets) elev_scale <- function(raster, z = 1, projection = \"EPSG:4326\") { terra::project( raster * z, projection ) } tar_option_set(packages = \"terra\") geotargets_option_set(gdal_raster_driver = \"GTiff\") list( tar_target( elev_file, system.file(\"ex\", \"elev.tif\", package = \"terra\"), format = \"file\" ), tar_target( r, rast(elev_file) ), tar_terra_sprc( raster_elevs, # two rasters, one unaltered, one scaled by factor of 2 and # reprojected to interrupted Goode homolosine terra::sprc(list( elev_scale(r, 1), elev_scale(r, 2, \"+proj=igh\") )) ) ) tar_make() #> Error in get(paste0(generic, \".\", class), envir = get_method_env()) : #> object 'type_sum.accel' not found #> ▶ dispatched target elev_file #> ● completed target elev_file [0.009 seconds, 7.994 kilobytes] #> ▶ dispatched target r #> ● completed target r [0.003 seconds, 959.703 kilobytes] #> ▶ dispatched target raster_elevs #> ● completed target raster_elevs [0.055 seconds, 37.904 kilobytes] #> ▶ ended pipeline [1.072 seconds] #> tar_read(raster_elevs) #> class : SpatRasterCollection #> length : 2 #> nrow : 90, 115 #> ncol : 95, 114 #> nlyr : 1, 1 #> extent : 5.741667, 1558890, 49.44167, 5556741 (xmin, xmax, ymin, ymax) #> crs (first) : lon/lat WGS 84 (EPSG:4326) #> names : raster_elevs, raster_elevs"},{"path":"https://njtierney.github.io/geotargets/articles/geotargets.html","id":"tar_terra_sds-targets-with-terra-raster-datasets","dir":"Articles","previous_headings":"","what":"tar_terra_sds(): targets with terra raster datasets","title":"Using `terra` with `geotargets`","text":"terra SpatRasterDataset similar SpatRasterCollection except sub-datasets must projection extent","code":"# contents of _targets.R: library(targets) library(geotargets) tar_option_set(packages = \"terra\") list( tar_target( logo_file, system.file(\"ex/logo.tif\", package = \"terra\"), format = \"file\" ), tar_terra_sds( raster_dataset, { x <- sds(rast(logo_file), rast(logo_file) / 2) names(x) <- c(\"first\", \"second\") x } ) ) tar_make() #> Error in get(paste0(generic, \".\", class), envir = get_method_env()) : #> object 'type_sum.accel' not found #> ▶ dispatched target logo_file #> ● completed target logo_file [0.008 seconds, 22.458 kilobytes] #> ▶ dispatched target raster_dataset #> ● completed target raster_dataset [0.031 seconds, 54.735 kilobytes] #> ▶ ended pipeline [0.136 seconds] #> tar_read(raster_dataset) #> class : SpatRasterDataset #> subdatasets : 2 #> dimensions : 77, 101 (nrow, ncol) #> nlyr : 3, 3 #> resolution : 1, 1 (x, y) #> extent : 0, 101, 0, 77 (xmin, xmax, ymin, ymax) #> coord. ref. : Cartesian (Meter) #> source(s) : raster_dataset #> names : raster_dataset, raster_dataset"},{"path":"https://njtierney.github.io/geotargets/articles/tar_terra_tiles.html","id":"what-is-an-extent","dir":"Articles","previous_headings":"","what":"What is an extent?","title":"Dynamic branching with raster tiles","text":"extent describes four points cover area raster. extent raster, r, printed summary: can get extent ext (extent): maps onto four corners raster : geo-computational operations can done independently one another—want take advantage , can facilitate breaking raster smaller pieces, creating new extents describe new subsets raster. can use extent information downstream analysis describe break raster. similar might want chunk data frame groups distribute different CPU cores. help , ’ve got helper functions.","code":"# example SpatRaster f <- system.file(\"ex/elev.tif\", package = \"terra\") r <- rast(f) r #> class : SpatRaster #> dimensions : 90, 95, 1 (nrow, ncol, nlyr) #> resolution : 0.008333333, 0.008333333 (x, y) #> extent : 5.741667, 6.533333, 49.44167, 50.19167 (xmin, xmax, ymin, ymax) #> coord. ref. : lon/lat WGS 84 (EPSG:4326) #> source : elev.tif #> name : elevation #> min value : 141 #> max value : 547 r_ext <- ext(r) r_ext #> SpatExtent : 5.74166666666667, 6.53333333333333, 49.4416666666667, 50.1916666666667 (xmin, xmax, ymin, ymax) # some plot helpers rect_extent <- function(x, ...) { rect(x[1], x[3], x[2], x[4], ...) } plot_extents <- function(x, ...) { invisible(lapply(x, rect_extent, border = \"hotpink\", lwd = 2)) } extend(r, 5) |> plot() lines(r_ext, col = \"hotpink\", lty = 2) points(r_ext, col = \"hotpink\", pch = 16)"},{"path":"https://njtierney.github.io/geotargets/articles/tar_terra_tiles.html","id":"helper-functions-to-create-multiple-extents-of-a-raster","dir":"Articles","previous_headings":"","what":"Helper functions to create multiple extents of a raster","title":"Dynamic branching with raster tiles","text":"geotargets provides three helper functions take SpatRaster output extents tiles: tile_n(), tile_grid(), tile_blocksize() demonstrate now.","code":""},{"path":"https://njtierney.github.io/geotargets/articles/tar_terra_tiles.html","id":"tile_n","dir":"Articles","previous_headings":"Helper functions to create multiple extents of a raster","what":"tile_n()","title":"Dynamic branching with raster tiles","text":"can use tile_n(), simplest three. produces n tiles grid.","code":"r_tile_4 <- tile_n(r, 4) #> creating 2 * 2 = 4 tile extents r_tile_4 #> [[1]] #> xmin xmax ymin ymax #> 5.741667 6.141667 49.816667 50.191667 #> #> [[2]] #> xmin xmax ymin ymax #> 6.141667 6.533333 49.816667 50.191667 #> #> [[3]] #> xmin xmax ymin ymax #> 5.741667 6.141667 49.441667 49.816667 #> #> [[4]] #> xmin xmax ymin ymax #> 6.141667 6.533333 49.441667 49.816667 plot(r) plot_extents(r_tile_4) plot(r) tile_n(r, 6) |> plot_extents() #> creating 2 * 3 = 6 tile extents"},{"path":"https://njtierney.github.io/geotargets/articles/tar_terra_tiles.html","id":"tile_grid","dir":"Articles","previous_headings":"Helper functions to create multiple extents of a raster","what":"tile_grid()","title":"Dynamic branching with raster tiles","text":"control, use tile_grid(), allows specification number rows columns split raster . specify want three columns 1 row:","code":"r_grid_3x1 <- tile_grid(r, ncol = 3, nrow = 1) r_grid_3x1 #> [[1]] #> xmin xmax ymin ymax #> 5.741667 6.008333 49.441667 50.191667 #> #> [[2]] #> xmin xmax ymin ymax #> 6.008333 6.266667 49.441667 50.191667 #> #> [[3]] #> xmin xmax ymin ymax #> 6.266667 6.533333 49.441667 50.191667 plot(r) plot_extents(r_grid_3x1) plot(r) tile_grid(r, ncol = 2, nrow = 3) |> plot_extents()"},{"path":"https://njtierney.github.io/geotargets/articles/tar_terra_tiles.html","id":"tile_blocksize","dir":"Articles","previous_headings":"Helper functions to create multiple extents of a raster","what":"tile_blocksize()","title":"Dynamic branching with raster tiles","text":"third included helper tile_blocksize(), tiles file block size. block size property raster files, number pixels (x y direction) read memory time. Tiling multiples block size may therefore efficient one block need loaded create tile target. can find blocksize fileBlocksize: tells us reads raster 43x95 pixel sizes. tile_blocksize function similar tile_grid, except instead saying many rows columns, specify units blocksize. just run tile_blocksize() r get extents specified blocksize: specifying blocksize row column unit 1: block size size first two blocks, much narrow block. different two tile methods. column block size full width raster. instead blocksize extent written 2 blocks row, 1 block size columns: works SpatRaster points file—-memory rasters inherent block size.","code":"fileBlocksize(r) #> rows cols #> [1,] 43 95 tile_blocksize(r) #> [[1]] #> xmin xmax ymin ymax #> 5.741667 6.533333 49.833333 50.191667 #> #> [[2]] #> xmin xmax ymin ymax #> 5.741667 6.533333 49.475000 49.833333 #> #> [[3]] #> xmin xmax ymin ymax #> 5.741667 6.533333 49.441667 49.475000 r_block_size_1x1 <- tile_blocksize(r, n_blocks_row = 1, n_blocks_col = 1) r_block_size_1x1 #> [[1]] #> xmin xmax ymin ymax #> 5.741667 6.533333 49.833333 50.191667 #> #> [[2]] #> xmin xmax ymin ymax #> 5.741667 6.533333 49.475000 49.833333 #> #> [[3]] #> xmin xmax ymin ymax #> 5.741667 6.533333 49.441667 49.475000 plot(r) plot_extents(r_block_size_1x1) r_block_size_2x1 <- tile_blocksize(r, n_blocks_row = 2, n_blocks_col = 1) r_block_size_2x1 #> [[1]] #> xmin xmax ymin ymax #> 5.741667 6.533333 49.475000 50.191667 #> #> [[2]] #> xmin xmax ymin ymax #> 5.741667 6.533333 49.441667 49.475000 plot(r) plot_extents(r_block_size_2x1) sources(r) #> [1] \"/home/runner/work/_temp/Library/terra/ex/elev.tif\" # force into memory r2 <- r + 0 sources(r2) #> [1] \"\" # this now errors tile_blocksize(r2) #> Error: [aggregate] values in argument 'fact' should be > 0"},{"path":"https://njtierney.github.io/geotargets/articles/tar_terra_tiles.html","id":"example-targets-pipeline","dir":"Articles","previous_headings":"","what":"Example targets pipeline","title":"Dynamic branching with raster tiles","text":"developing targets pipeline using tar_terra_tiles() tile_blocksize(), ’s good idea figure many tiles tile_blocksize() create implementing tar_terra_tiles(). ’ll start making bigger raster experiment using terra::disagg(), (makes higher resolution raster breaking pixels smaller pixels), making multiple layers. Four tiles reasonable, ’ll go . Note ensure r_big target -memory tar_terra_tiles(), set targets option memory = \"transient\". See targets documentation memory details. process happens can thought split-apply-combine. returns tiles whose extents created one tile functions described (tile_n(), tile_grid(), tile_blocksize()), supplying tile_fun. can function work raster, case use app function terra, applies function cells raster. use tar_terra_rast() supply pattern = map(tiles), tiles name target created tar_terra_tiles(). can think pattern = map(tiles) saying: “task tiles specified return list” case use tar_terra_rast() use merge() tiles. can see tar_make() output plots tiles tiles_mean patterns four branches . combined, make full plot .","code":"# contents of _targets.R library(targets) library(geotargets) library(terra) geotargets_option_set(gdal_raster_driver = \"COG\") list( tar_target( raster_file, system.file(\"ex/elev.tif\", package = \"terra\"), format = \"file\" ), tar_terra_rast( r, disagg(rast(raster_file), fact = 10) ), # add more layers tar_terra_rast( r_big, c(r, r + 100, r * 10, r / 2), memory = \"transient\" ) ) tar_make() #> Error in get(paste0(generic, \".\", class), envir = get_method_env()) : #> object 'type_sum.accel' not found #> terra 1.8.5 #> ▶ dispatched target raster_file #> ● completed target raster_file [0.001 seconds, 7.994 kilobytes] #> ▶ dispatched target r #> ● completed target r [0.009 seconds, 822.781 kilobytes] #> ▶ dispatched target r_big #> ● completed target r_big [0.024 seconds, 4.055 megabytes] #> ▶ ended pipeline [0.416 seconds] #> tar_load(r_big) tile_blocksize(r_big) #> [[1]] #> xmin xmax ymin ymax #> 5.741667 6.168333 49.765000 50.191667 #> #> [[2]] #> xmin xmax ymin ymax #> 6.168333 6.533333 49.765000 50.191667 #> #> [[3]] #> xmin xmax ymin ymax #> 5.741667 6.168333 49.441667 49.765000 #> #> [[4]] #> xmin xmax ymin ymax #> 6.168333 6.533333 49.441667 49.765000 # contents of _targets.R library(targets) library(geotargets) library(terra) geotargets_option_set(gdal_raster_driver = \"COG\") tar_option_set(memory = \"transient\") list( tar_target( raster_file, system.file(\"ex/elev.tif\", package = \"terra\"), format = \"file\" ), tar_terra_rast( r, disagg(rast(raster_file), fact = 10) ), tar_terra_rast( r_big, c(r, r + 100, r * 10, r / 2), memory = \"transient\" ), tar_terra_tiles( tiles, raster = r_big, tile_fun = tile_blocksize, description = \"split raster into tiles\" ), tar_terra_rast( tiles_mean, app(tiles, \\(x) mean(x, na.rm = TRUE)), pattern = map(tiles), description = \"some computationaly intensive task performed on each tile\" ), tar_terra_rast( merged_mean, merge(sprc(tiles_mean)), description = \"merge tiles into a single SpatRaster\" ) ) tar_make() #> Error in get(paste0(generic, \".\", class), envir = get_method_env()) : #> object 'type_sum.accel' not found #> terra 1.8.5 #> ✔ skipped target raster_file #> ✔ skipped target r #> ✔ skipped target r_big #> ▶ dispatched target tiles_exts #> ● completed target tiles_exts [0.005 seconds, 153 bytes] #> ▶ dispatched branch tiles_11882e184aa27102 #> ● completed branch tiles_11882e184aa27102 [0.003 seconds, 982.55 kilobytes] #> ▶ dispatched branch tiles_e39b1bcab4d45ba0 #> ● completed branch tiles_e39b1bcab4d45ba0 [0.036 seconds, 249.778 kilobytes] #> ▶ dispatched branch tiles_b14b762418a51f63 #> ● completed branch tiles_b14b762418a51f63 [0.003 seconds, 599.615 kilobytes] #> ▶ dispatched branch tiles_bfb55de5c880456f #> ● completed branch tiles_bfb55de5c880456f [0.003 seconds, 483.702 kilobytes] #> ● completed pattern tiles #> ▶ dispatched branch tiles_mean_1bcefdb80d0879e0 #> ● completed branch tiles_mean_1bcefdb80d0879e0 [2.124 seconds, 159.194 kilobytes] #> ▶ dispatched branch tiles_mean_4ff32c943e05dc36 #> ● completed branch tiles_mean_4ff32c943e05dc36 [1.867 seconds, 49.028 kilobytes] #> ▶ dispatched branch tiles_mean_17723520c935f474 #> ● completed branch tiles_mean_17723520c935f474 [1.585 seconds, 100.948 kilobytes] #> ▶ dispatched branch tiles_mean_984998bf0804c2cf #> ● completed branch tiles_mean_984998bf0804c2cf [1.415 seconds, 87.272 kilobytes] #> ● completed pattern tiles_mean #> ▶ dispatched target merged_mean #> ● completed target merged_mean [0.015 seconds, 879.912 kilobytes] #> ▶ ended pipeline [7.558 seconds] #> library(terra) tar_load(tiles_mean) op <- par(mfrow = c(2, 2)) for (i in seq_along(tiles_mean)) { plot(tiles_mean[[i]]) } par(op) plot(tar_read(merged_mean))"},{"path":"https://njtierney.github.io/geotargets/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Nicholas Tierney. Author, maintainer. Eric Scott. Author. Andrew Brown. Author.","code":""},{"path":"https://njtierney.github.io/geotargets/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Tierney N, Scott E, Brown (2025). geotargets: 'Targets' Extensions Geospatial Formats. R package version 0.2.0.9000, http://geotargets.njtierney.com, https://github.com/njtierney/geotargets.","code":"@Manual{, title = {geotargets: 'Targets' Extensions for Geospatial Formats}, author = {Nicholas Tierney and Eric Scott and Andrew Brown}, year = {2025}, note = {R package version 0.2.0.9000, http://geotargets.njtierney.com}, url = {https://github.com/njtierney/geotargets}, }"},{"path":"https://njtierney.github.io/geotargets/index.html","id":"geotargets-","dir":"","previous_headings":"","what":"Targets Extensions for Geospatial Formats","title":"Targets Extensions for Geospatial Formats","text":"geotargets extends targets work geospatial data formats, rasters vectors (e.g., shapefiles). Currently support raster vector formats terra package","code":""},{"path":"https://njtierney.github.io/geotargets/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Targets Extensions for Geospatial Formats","text":"can install development version geotargets like :","code":"install.packages(\"geotargets\", repos = c(\"https://njtierney.r-universe.dev\", \"https://cran.r-project.org\"))"},{"path":"https://njtierney.github.io/geotargets/index.html","id":"why-geotargets","dir":"","previous_headings":"","what":"Why geotargets","title":"Targets Extensions for Geospatial Formats","text":"want use geospatial data formats (terra) targets package build analytic reproducible pipelines, involves writing lot custom targets wrappers. wrote geotargets can use geospatial data formats targets. provide detail , common problem using popular libraries like terra targets running errors read write. Due limitations come underlying C++ implementation terra library, specific ways write read objects. See ?terra details. geotargets helps handle write read steps, don’t worry can use targets used . essence, ’ve ever come across error: trying read geospatial raster vector targets, geotargets :)","code":"Error in .External(list(name = \"CppMethod__invoke_notvoid\", address = , : NULL value passed as symbol address Error: external pointer is not valid"},{"path":"https://njtierney.github.io/geotargets/index.html","id":"examples","dir":"","previous_headings":"","what":"Examples","title":"Targets Extensions for Geospatial Formats","text":"currently provide support terra package targets. show three examples target factories: tar_terra_rast() tar_terra_vect() tar_terra_sprc() tar_terra_sds() tar_tera_tiles() tar_stars() use place tar_target() targets pipeline, e.g., work terra raster, vector, raster collection data. like see download working examples , see repos: demo-geotargets icebreaker","code":""},{"path":"https://njtierney.github.io/geotargets/index.html","id":"tar_terra_rast-targets-with-terra-rasters","dir":"","previous_headings":"","what":"tar_terra_rast(): targets with terra rasters","title":"Targets Extensions for Geospatial Formats","text":"","code":"library(targets) tar_dir({ # tar_dir() runs code from a temporary directory. tar_script({ library(geotargets) get_elev <- function() { terra::rast(system.file(\"ex\", \"elev.tif\", package = \"terra\")) } list( tar_terra_rast( terra_rast_example, get_elev() ) ) }) tar_make() x <- tar_read(terra_rast_example) x }) #> ▶ dispatched target terra_rast_example #> ● completed target terra_rast_example [0.074 seconds, 7.992 kilobytes] #> ▶ ended pipeline [0.316 seconds] #> class : SpatRaster #> dimensions : 90, 95, 1 (nrow, ncol, nlyr) #> resolution : 0.008333333, 0.008333333 (x, y) #> extent : 5.741667, 6.533333, 49.44167, 50.19167 (xmin, xmax, ymin, ymax) #> coord. ref. : lon/lat WGS 84 (EPSG:4326) #> source : terra_rast_example #> name : elevation #> min value : 141 #> max value : 547"},{"path":"https://njtierney.github.io/geotargets/index.html","id":"tar_terra_vect-targets-with-terra-vectors","dir":"","previous_headings":"","what":"tar_terra_vect(): targets with terra vectors","title":"Targets Extensions for Geospatial Formats","text":"","code":"tar_dir({ # tar_dir() runs code from a temporary directory. tar_script({ library(geotargets) lux_area <- function(projection = \"EPSG:4326\") { terra::project( terra::vect(system.file(\"ex\", \"lux.shp\", package = \"terra\" )), projection ) } list( tar_terra_vect( terra_vect_example, lux_area() ) ) }) tar_make() x <- tar_read(terra_vect_example) x }) #> ▶ dispatched target terra_vect_example #> ● completed target terra_vect_example [0.078 seconds, 117.646 kilobytes] #> ▶ ended pipeline [0.259 seconds] #> class : SpatVector #> geometry : polygons #> dimensions : 12, 6 (geometries, attributes) #> extent : 5.74414, 6.528252, 49.44781, 50.18162 (xmin, xmax, ymin, ymax) #> source : terra_vect_example #> coord. ref. : lon/lat WGS 84 (EPSG:4326) #> names : ID_1 NAME_1 ID_2 NAME_2 AREA POP #> type : #> values : 1 Diekirch 1 Clervaux 312 1.808e+04 #> 1 Diekirch 2 Diekirch 218 3.254e+04 #> 1 Diekirch 3 Redange 259 1.866e+04"},{"path":"https://njtierney.github.io/geotargets/index.html","id":"tar_terra_sprc-targets-with-terra-raster-collections","dir":"","previous_headings":"","what":"tar_terra_sprc(): targets with terra raster collections","title":"Targets Extensions for Geospatial Formats","text":"","code":"tar_dir({ # tar_dir() runs code from a temporary directory. tar_script({ library(geotargets) elev_scale <- function(z = 1, projection = \"EPSG:4326\") { terra::project( terra::rast(system.file(\"ex\", \"elev.tif\", package = \"terra\")) * z, projection ) } list( tar_terra_sprc( raster_elevs, # two rasters, one unaltered, one scaled by factor of 2 and # reprojected to interrupted goode homolosine command = terra::sprc(list( elev_scale(1), elev_scale(2, \"+proj=igh\") )) ) ) }) tar_make() x <- tar_read(raster_elevs) x }) #> ▶ dispatched target raster_elevs #> ● completed target raster_elevs [0.14 seconds, 36.423 kilobytes] #> ▶ ended pipeline [0.33 seconds] #> class : SpatRasterCollection #> length : 2 #> nrow : 90, 115 #> ncol : 95, 114 #> nlyr : 1, 1 #> extent : 5.741667, 1558890, 49.44167, 5556741 (xmin, xmax, ymin, ymax) #> crs (first) : lon/lat WGS 84 (EPSG:4326) #> names : raster_elevs, raster_elevs"},{"path":"https://njtierney.github.io/geotargets/index.html","id":"tar_stars-targets-with-stars-objects","dir":"","previous_headings":"","what":"tar_stars(): targets with stars objects","title":"Targets Extensions for Geospatial Formats","text":"","code":"tar_dir({ # tar_dir() runs code from a temporary directory. tar_script({ library(geotargets) list( tar_stars( test_stars, stars::read_stars(system.file(\"tif\", \"olinda_dem_utm25s.tif\", package = \"stars\")) ) ) }) tar_make() x <- tar_read(test_stars) x }) #> ▶ dispatched target test_stars #> ● completed target test_stars [0.053 seconds, 49.9 kilobytes] #> ▶ ended pipeline [0.192 seconds] #> stars object with 2 dimensions and 1 attribute #> attribute(s): #> Min. 1st Qu. Median Mean 3rd Qu. Max. #> test_stars -1 6 12 21.66521 35 88 #> dimension(s): #> from to offset delta refsys point x/y #> x 1 111 288776 89.99 UTM Zone 25, Southern Hem... FALSE [x] #> y 1 111 9120761 -89.99 UTM Zone 25, Southern Hem... FALSE [y]"},{"path":"https://njtierney.github.io/geotargets/index.html","id":"code-of-conduct","dir":"","previous_headings":"","what":"Code of Conduct","title":"Targets Extensions for Geospatial Formats","text":"Please note geotargets project released Contributor Code Conduct. contributing project, agree abide terms.","code":""},{"path":"https://njtierney.github.io/geotargets/index.html","id":"acknowledgements","dir":"","previous_headings":"","what":"Acknowledgements","title":"Targets Extensions for Geospatial Formats","text":"Logo design Hubert Hałun Appsilon.","code":""},{"path":"https://njtierney.github.io/geotargets/reference/geotargets-options.html","id":null,"dir":"Reference","previous_headings":"","what":"Get or Set geotargets Options — geotargets_option_set","title":"Get or Set geotargets Options — geotargets_option_set","text":"Get set behavior geospatial data target stores using geotargets-specific global options.","code":""},{"path":"https://njtierney.github.io/geotargets/reference/geotargets-options.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get or Set geotargets Options — geotargets_option_set","text":"","code":"geotargets_option_set( gdal_raster_driver = NULL, gdal_raster_creation_options = NULL, gdal_vector_driver = NULL, gdal_vector_creation_options = NULL, terra_preserve_metadata = NULL ) geotargets_option_get(name)"},{"path":"https://njtierney.github.io/geotargets/reference/geotargets-options.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get or Set geotargets Options — geotargets_option_set","text":"gdal_raster_driver character, length 1; set driver used raster data target store (default: \"GTiff\"). Options driver names can found : https://gdal.org/drivers/raster/index.html. gdal_raster_creation_options character; set GDAL creation options used writing raster files target store (default: \"\"). may specify multiple values e.g. c(\"COMPRESS=DEFLATE\", \"TFW=YES\"). GDAL driver supports unique set creation options. example, default \"GTiff\" driver: https://gdal.org/drivers/raster/gtiff.html#creation-options. gdal_vector_driver character, length 1; set file type used vector data target store (default: \"GeoJSON\"). gdal_vector_creation_options character; set GDAL layer creation options used writing vector files target store (default: \"ENCODING=UTF-8\"). may specify multiple values e.g. c(\"WRITE_BBOX=YES\", \"COORDINATE_PRECISION=10\"). GDAL driver supports unique set creation options. example, default \"GeoJSON\" driver: https://gdal.org/drivers/vector/geojson.html#layer-creation-options terra_preserve_metadata character. \"drop\" (default), auxiliary files written terra::writeRaster() containing raster metadata units datetimes lost (note include layer names set names() <-). \"zip\", metadata retained archiving written files zip file upon writing unzipping upon reading. adds extra overhead slow pipelines. name character; option name get.","code":""},{"path":"https://njtierney.github.io/geotargets/reference/geotargets-options.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get or Set geotargets Options — geotargets_option_set","text":"Specific options, \"gdal.raster.driver\". See \"Details\" information.","code":""},{"path":"https://njtierney.github.io/geotargets/reference/geotargets-options.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Get or Set geotargets Options — geotargets_option_set","text":"options can also set using options(). example, geotargets_options_set(gdal_raster_driver = \"GTiff\") equivalent options(\"geotargets.gdal.raster.driver\" = \"GTiff\").","code":""},{"path":"https://njtierney.github.io/geotargets/reference/geotargets-options.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get or Set geotargets Options — geotargets_option_set","text":"","code":"if (Sys.getenv(\"TAR_LONG_EXAMPLES\") == \"true\") { targets::tar_dir({ # tar_dir() runs code from a temporary directory. library(geotargets) op <- getOption(\"geotargets.gdal.raster.driver\") withr::defer(options(\"geotargets.gdal.raster.driver\" = op)) geotargets_option_set(gdal_raster_driver = \"COG\") targets::tar_script({ list( geotargets::tar_terra_rast( terra_rast_example, system.file(\"ex/elev.tif\", package = \"terra\") |> terra::rast() ) ) }) targets::tar_make() x <- targets::tar_read(terra_rast_example) }) } geotargets_option_get(\"gdal.raster.driver\") #> NULL geotargets_option_get(\"gdal.raster.creation.options\") #> NULL"},{"path":"https://njtierney.github.io/geotargets/reference/geotargets-package.html","id":null,"dir":"Reference","previous_headings":"","what":"geotargets: 'Targets' Extensions for Geospatial Formats — geotargets-package","title":"geotargets: 'Targets' Extensions for Geospatial Formats — geotargets-package","text":"Provides extensions various geospatial file formats, shapefiles rasters. Currently provides support 'terra' geospatial formats. See vignettes worked examples, demonstrations, explanations use various package extensions.","code":""},{"path":[]},{"path":"https://njtierney.github.io/geotargets/reference/geotargets-package.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"geotargets: 'Targets' Extensions for Geospatial Formats — geotargets-package","text":"Maintainer: Nicholas Tierney nicholas.tierney@gmail.com (ORCID) Authors: Eric Scott (ORCID) Andrew Brown (ORCID)","code":""},{"path":"https://njtierney.github.io/geotargets/reference/set_window.html","id":null,"dir":"Reference","previous_headings":"","what":"Copy a raster within a window — set_window","title":"Copy a raster within a window — set_window","text":"Create new SpatRaster object specified window (area interest) original SpatRaster. wrapper around terra::window() , rather modifying SpatRaster place, returns new SpatRaster leaving original unchanged.","code":""},{"path":"https://njtierney.github.io/geotargets/reference/set_window.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Copy a raster within a window — set_window","text":"","code":"set_window(raster, window)"},{"path":"https://njtierney.github.io/geotargets/reference/set_window.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Copy a raster within a window — set_window","text":"raster SpatRaster object. window SpatExtent object defining area interest.","code":""},{"path":"https://njtierney.github.io/geotargets/reference/set_window.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Copy a raster within a window — set_window","text":"SpatRaster","code":""},{"path":"https://njtierney.github.io/geotargets/reference/set_window.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Copy a raster within a window — set_window","text":"may general use, created primarily use within tar_terra_tiles().","code":""},{"path":"https://njtierney.github.io/geotargets/reference/set_window.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Copy a raster within a window — set_window","text":"Eric Scott","code":""},{"path":"https://njtierney.github.io/geotargets/reference/set_window.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Copy a raster within a window — set_window","text":"","code":"f <- system.file(\"ex/elev.tif\", package=\"terra\") r <- terra::rast(f) e <- terra::ext(c(5.9, 6,49.95, 50)) r2 <- set_window(r, e) terra::ext(r) #> SpatExtent : 5.74166666666667, 6.53333333333333, 49.4416666666667, 50.1916666666667 (xmin, xmax, ymin, ymax) terra::ext(r2) #> SpatExtent : 5.9, 6, 49.95, 50 (xmin, xmax, ymin, ymax)"},{"path":"https://njtierney.github.io/geotargets/reference/tar_stars.html","id":null,"dir":"Reference","previous_headings":"","what":"Create a stars stars Target — tar_stars","title":"Create a stars stars Target — tar_stars","text":"Provides target format stars objects. Note stars objects work ordinary tar_target() necessarily need geotargets target factories way terra objects . Currently tar_stars() limitations stars::write_stars(), use caution.","code":""},{"path":"https://njtierney.github.io/geotargets/reference/tar_stars.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create a stars stars Target — tar_stars","text":"","code":"tar_stars( name, command, pattern = NULL, proxy = FALSE, mdim = FALSE, ncdf = FALSE, driver = geotargets_option_get(\"gdal.raster.driver\"), options = geotargets_option_get(\"gdal.raster.creation.options\"), ..., tidy_eval = targets::tar_option_get(\"tidy_eval\"), packages = targets::tar_option_get(\"packages\"), library = targets::tar_option_get(\"library\"), repository = targets::tar_option_get(\"repository\"), error = targets::tar_option_get(\"error\"), memory = targets::tar_option_get(\"memory\"), garbage_collection = targets::tar_option_get(\"garbage_collection\"), deployment = targets::tar_option_get(\"deployment\"), priority = targets::tar_option_get(\"priority\"), resources = targets::tar_option_get(\"resources\"), storage = targets::tar_option_get(\"storage\"), retrieval = targets::tar_option_get(\"retrieval\"), cue = targets::tar_option_get(\"cue\"), description = targets::tar_option_get(\"description\") ) tar_stars_proxy( name, command, pattern = NULL, mdim = FALSE, ncdf = FALSE, driver = geotargets_option_get(\"gdal.raster.driver\"), options = geotargets_option_get(\"gdal.raster.creation.options\"), ..., tidy_eval = targets::tar_option_get(\"tidy_eval\"), packages = targets::tar_option_get(\"packages\"), library = targets::tar_option_get(\"library\"), repository = targets::tar_option_get(\"repository\"), error = targets::tar_option_get(\"error\"), memory = targets::tar_option_get(\"memory\"), garbage_collection = targets::tar_option_get(\"garbage_collection\"), deployment = targets::tar_option_get(\"deployment\"), priority = targets::tar_option_get(\"priority\"), resources = targets::tar_option_get(\"resources\"), storage = targets::tar_option_get(\"storage\"), retrieval = targets::tar_option_get(\"retrieval\"), cue = targets::tar_option_get(\"cue\"), description = targets::tar_option_get(\"description\") )"},{"path":"https://njtierney.github.io/geotargets/reference/tar_stars.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create a stars stars Target — tar_stars","text":"name Symbol, name target. target name must valid name symbol R, must start dot. See targets::tar_target() information. command R code run target. pattern Code define dynamic branching pattern target. See targets::tar_target() information. proxy logical. Passed stars::read_stars(). TRUE target read object class stars_proxy. Otherwise, object class stars. mdim logical. Use Multidimensional Raster Data Model via stars::write_mdim()? Default: FALSE. supported drivers, e.g. \"netCDF\" \"Zarr\". ncdf logical. Use NetCDF library directly read data via stars::read_ncdf()? Default: FALSE. supported driver=\"netCDF\". driver character. File format expressed GDAL driver names passed stars::write_stars(). See sf::st_drivers(). options character. GDAL driver specific datasource creation options passed stars::write_stars(). ... Additional arguments yet used. tidy_eval Logical, whether enable tidy evaluation interpreting command pattern. TRUE, can use \"bang-bang\" operator !! programmatically insert values global objects. packages Character vector packages load right target runs output data reloaded downstream targets. Use tar_option_set() set packages globally subsequent targets define. library Character vector library paths try loading packages. repository Character length 1, remote repository target storage. Choices: \"local\": file system local machine. \"aws\": Amazon Web Services (AWS) S3 bucket. Can configured non-AWS S3 bucket using endpoint argument tar_resources_aws(), versioning capabilities may lost . See cloud storage section https://books.ropensci.org/targets/data.html details instructions. \"gcp\": Google Cloud Platform storage bucket. See cloud storage section https://books.ropensci.org/targets/data.html details instructions. character string tar_repository_cas() content-addressable storage. Note: repository \"local\" format \"file\" target create single output file. output file uploaded cloud tracked changes exists cloud. local file deleted target runs. error Character length 1, target stops throws error. Options: \"stop\": whole pipeline stops throws error. \"continue\": whole pipeline keeps going. \"null\": errored target continues returns NULL. data hash deliberately wrong target date next run pipeline. \"abridge\": currently running targets keep running, new targets launch . \"trim\": currently running targets stay running. queued target allowed start : downstream error, sibling branch tar_target() call (error happened dynamic branch). idea avoid starting new work immediate error impacts. error = \"trim\" just like error = \"abridge\", allows potentially healthy regions dependency graph begin running. (Visit https://books.ropensci.org/targets/debugging.html learn debug targets using saved workspaces.) memory Character length 1, memory strategy. \"persistent\", target stays memory end pipeline (unless storage \"worker\", case targets unloads value memory right storing order avoid sending copious data network). \"transient\", target gets unloaded every new target completes. Either way, target gets automatically loaded memory whenever another target needs value. cloud-based dynamic files (e.g. format = \"file\" repository = \"aws\"), memory strategy applies temporary local copy file: \"persistent\" means remains end pipeline deleted, \"transient\" means gets deleted soon possible. former conserves bandwidth, latter conserves local storage. garbage_collection Logical, whether run base::gc() just target runs. deployment Character length 1. deployment \"main\", target run central controlling R process. Otherwise, deployment \"worker\" set pipeline distributed/parallel computing, target runs parallel worker. distributed/parallel computing targets, please visit https://books.ropensci.org/targets/crew.html. priority Numeric length 1 0 1. Controls targets get deployed first multiple competing targets ready simultaneously. Targets priorities closer 1 get dispatched earlier (polled earlier tar_make_future()). resources Object returned tar_resources() optional settings high-performance computing functionality, alternative data storage formats, optional capabilities targets. See tar_resources() details. storage Character length 1, relevant tar_make_clustermq() tar_make_future(). Must one following values: \"main\": target's return value sent back host machine saved/uploaded locally. \"worker\": worker saves/uploads value. \"none\": almost never recommended. niche situations, e.g. data needs loaded explicitly another language. use , return value target totally ignored target ends, downstream target still attempts load data file (except retrieval = \"none\"). select storage = \"none\", return value target's command ignored, data saved automatically. dynamic files (format = \"file\") responsibility user write data store inside target. distinguishing feature storage = \"none\" (opposed format = \"file\") general case, downstream targets automatically try load data data store dependency. corollary, storage = \"none\" completely unnecessary format \"file\". retrieval Character length 1, relevant tar_make_clustermq() tar_make_future(). Must one following values: \"main\": target's dependencies loaded host machine sent worker target runs. \"worker\": worker loads targets dependencies. \"none\": dependencies loaded . choice almost never recommended. niche situations, e.g. data needs loaded explicitly another language. cue optional object tar_cue() customize rules decide whether target date. description Character length 1, custom free-form human-readable text description target. Descriptions appear target labels functions like tar_manifest() tar_visnetwork(), let select subsets targets names argument functions like tar_make(). example, tar_manifest(names = tar_described_as(starts_with(\"survival model\"))) lists targets whose descriptions start character string \"survival model\".","code":""},{"path":"https://njtierney.github.io/geotargets/reference/tar_stars.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create a stars stars Target — tar_stars","text":"target class \"tar_stem\" use target pipeline","code":""},{"path":"https://njtierney.github.io/geotargets/reference/tar_stars.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Create a stars stars Target — tar_stars","text":"iteration argument unavailable hard-coded \"list\", option works currently.","code":""},{"path":[]},{"path":"https://njtierney.github.io/geotargets/reference/tar_stars.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create a stars stars Target — tar_stars","text":"","code":"if (Sys.getenv(\"TAR_LONG_EXAMPLES\") == \"true\") { targets::tar_dir({ # tar_dir() runs code from a temporary directory. library(geotargets) targets::tar_script({ list( geotargets::tar_stars( stars_example, stars::read_stars(system.file(\"tif\", \"olinda_dem_utm25s.tif\", package = \"stars\")) ) ) }) targets::tar_make() x <- targets::tar_read(stars_example) }) }"},{"path":"https://njtierney.github.io/geotargets/reference/tar_terra_rast.html","id":null,"dir":"Reference","previous_headings":"","what":"Create a terra SpatRaster target — tar_terra_rast","title":"Create a terra SpatRaster target — tar_terra_rast","text":"Provides target format terra::SpatRaster objects.","code":""},{"path":"https://njtierney.github.io/geotargets/reference/tar_terra_rast.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create a terra SpatRaster target — tar_terra_rast","text":"","code":"tar_terra_rast( name, command, pattern = NULL, filetype = geotargets_option_get(\"gdal.raster.driver\"), gdal = geotargets_option_get(\"gdal.raster.creation.options\"), preserve_metadata = geotargets_option_get(\"terra.preserve.metadata\"), ..., tidy_eval = targets::tar_option_get(\"tidy_eval\"), packages = targets::tar_option_get(\"packages\"), library = targets::tar_option_get(\"library\"), repository = targets::tar_option_get(\"repository\"), error = targets::tar_option_get(\"error\"), memory = targets::tar_option_get(\"memory\"), garbage_collection = targets::tar_option_get(\"garbage_collection\"), deployment = targets::tar_option_get(\"deployment\"), priority = targets::tar_option_get(\"priority\"), resources = targets::tar_option_get(\"resources\"), storage = targets::tar_option_get(\"storage\"), retrieval = targets::tar_option_get(\"retrieval\"), cue = targets::tar_option_get(\"cue\"), description = targets::tar_option_get(\"description\") )"},{"path":"https://njtierney.github.io/geotargets/reference/tar_terra_rast.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create a terra SpatRaster target — tar_terra_rast","text":"name Symbol, name target. target name must valid name symbol R, must start dot. See targets::tar_target() information. command R code run target. pattern Code define dynamic branching pattern target. See targets::tar_target() information. filetype character. File format expressed GDAL driver names passed terra::writeRaster() gdal character. GDAL driver specific datasource creation options passed terra::writeRaster() preserve_metadata character. \"drop\" (default), auxiliary files written terra::writeRaster() containing raster metadata units datetimes lost (note include layer names set names() <-). \"zip\", metadata retained archiving written files zip file upon writing unzipping upon reading. adds extra overhead slow pipelines. ... Additional arguments yet used tidy_eval Logical, whether enable tidy evaluation interpreting command pattern. TRUE, can use \"bang-bang\" operator !! programmatically insert values global objects. packages Character vector packages load right target runs output data reloaded downstream targets. Use tar_option_set() set packages globally subsequent targets define. library Character vector library paths try loading packages. repository Character length 1, remote repository target storage. Choices: \"local\": file system local machine. \"aws\": Amazon Web Services (AWS) S3 bucket. Can configured non-AWS S3 bucket using endpoint argument tar_resources_aws(), versioning capabilities may lost . See cloud storage section https://books.ropensci.org/targets/data.html details instructions. \"gcp\": Google Cloud Platform storage bucket. See cloud storage section https://books.ropensci.org/targets/data.html details instructions. character string tar_repository_cas() content-addressable storage. Note: repository \"local\" format \"file\" target create single output file. output file uploaded cloud tracked changes exists cloud. local file deleted target runs. error Character length 1, target stops throws error. Options: \"stop\": whole pipeline stops throws error. \"continue\": whole pipeline keeps going. \"null\": errored target continues returns NULL. data hash deliberately wrong target date next run pipeline. \"abridge\": currently running targets keep running, new targets launch . \"trim\": currently running targets stay running. queued target allowed start : downstream error, sibling branch tar_target() call (error happened dynamic branch). idea avoid starting new work immediate error impacts. error = \"trim\" just like error = \"abridge\", allows potentially healthy regions dependency graph begin running. (Visit https://books.ropensci.org/targets/debugging.html learn debug targets using saved workspaces.) memory Character length 1, memory strategy. \"persistent\", target stays memory end pipeline (unless storage \"worker\", case targets unloads value memory right storing order avoid sending copious data network). \"transient\", target gets unloaded every new target completes. Either way, target gets automatically loaded memory whenever another target needs value. cloud-based dynamic files (e.g. format = \"file\" repository = \"aws\"), memory strategy applies temporary local copy file: \"persistent\" means remains end pipeline deleted, \"transient\" means gets deleted soon possible. former conserves bandwidth, latter conserves local storage. garbage_collection Logical, whether run base::gc() just target runs. deployment Character length 1. deployment \"main\", target run central controlling R process. Otherwise, deployment \"worker\" set pipeline distributed/parallel computing, target runs parallel worker. distributed/parallel computing targets, please visit https://books.ropensci.org/targets/crew.html. priority Numeric length 1 0 1. Controls targets get deployed first multiple competing targets ready simultaneously. Targets priorities closer 1 get dispatched earlier (polled earlier tar_make_future()). resources Object returned tar_resources() optional settings high-performance computing functionality, alternative data storage formats, optional capabilities targets. See tar_resources() details. storage Character length 1, relevant tar_make_clustermq() tar_make_future(). Must one following values: \"main\": target's return value sent back host machine saved/uploaded locally. \"worker\": worker saves/uploads value. \"none\": almost never recommended. niche situations, e.g. data needs loaded explicitly another language. use , return value target totally ignored target ends, downstream target still attempts load data file (except retrieval = \"none\"). select storage = \"none\", return value target's command ignored, data saved automatically. dynamic files (format = \"file\") responsibility user write data store inside target. distinguishing feature storage = \"none\" (opposed format = \"file\") general case, downstream targets automatically try load data data store dependency. corollary, storage = \"none\" completely unnecessary format \"file\". retrieval Character length 1, relevant tar_make_clustermq() tar_make_future(). Must one following values: \"main\": target's dependencies loaded host machine sent worker target runs. \"worker\": worker loads targets dependencies. \"none\": dependencies loaded . choice almost never recommended. niche situations, e.g. data needs loaded explicitly another language. cue optional object tar_cue() customize rules decide whether target date. description Character length 1, custom free-form human-readable text description target. Descriptions appear target labels functions like tar_manifest() tar_visnetwork(), let select subsets targets names argument functions like tar_make(). example, tar_manifest(names = tar_described_as(starts_with(\"survival model\"))) lists targets whose descriptions start character string \"survival model\".","code":""},{"path":"https://njtierney.github.io/geotargets/reference/tar_terra_rast.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create a terra SpatRaster target — tar_terra_rast","text":"target class \"tar_stem\" use target pipeline","code":""},{"path":"https://njtierney.github.io/geotargets/reference/tar_terra_rast.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Create a terra SpatRaster target — tar_terra_rast","text":"terra::SpatRaster objects contain raster data directly—contain C++ pointer memory data stored. result, objects portable R sessions without special handling, causes problems including targets pipelines tar_target(). tar_terra_rast() handles issue writing reading target geospatial file (specified filetype) rather saving SpatRaster object .","code":""},{"path":"https://njtierney.github.io/geotargets/reference/tar_terra_rast.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Create a terra SpatRaster target — tar_terra_rast","text":"iteration argument unavailable hard-coded \"list\", option works currently.","code":""},{"path":[]},{"path":"https://njtierney.github.io/geotargets/reference/tar_terra_rast.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create a terra SpatRaster target — tar_terra_rast","text":"","code":"if (Sys.getenv(\"TAR_LONG_EXAMPLES\") == \"true\") { targets::tar_dir({ # tar_dir() runs code from a temporary directory. library(geotargets) targets::tar_script({ list( geotargets::tar_terra_rast( terra_rast_example, system.file(\"ex/elev.tif\", package = \"terra\") |> terra::rast() ) ) }) targets::tar_make() x <- targets::tar_read(terra_rast_example) }) }"},{"path":"https://njtierney.github.io/geotargets/reference/tar_terra_sds.html","id":null,"dir":"Reference","previous_headings":"","what":"Create a terra SpatRasterDataset target — tar_terra_sds","title":"Create a terra SpatRasterDataset target — tar_terra_sds","text":"Provides target format terra::SpatRasterDataset objects, hold sub-datasets, SpatRaster can multiple layers.","code":""},{"path":"https://njtierney.github.io/geotargets/reference/tar_terra_sds.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create a terra SpatRasterDataset target — tar_terra_sds","text":"","code":"tar_terra_sds( name, command, pattern = NULL, filetype = geotargets_option_get(\"gdal.raster.driver\"), gdal = geotargets_option_get(\"gdal.raster.creation.options\"), ..., tidy_eval = targets::tar_option_get(\"tidy_eval\"), packages = targets::tar_option_get(\"packages\"), library = targets::tar_option_get(\"library\"), repository = targets::tar_option_get(\"repository\"), error = targets::tar_option_get(\"error\"), memory = targets::tar_option_get(\"memory\"), garbage_collection = targets::tar_option_get(\"garbage_collection\"), deployment = targets::tar_option_get(\"deployment\"), priority = targets::tar_option_get(\"priority\"), resources = targets::tar_option_get(\"resources\"), storage = targets::tar_option_get(\"storage\"), retrieval = targets::tar_option_get(\"retrieval\"), cue = targets::tar_option_get(\"cue\"), description = targets::tar_option_get(\"description\") )"},{"path":"https://njtierney.github.io/geotargets/reference/tar_terra_sds.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create a terra SpatRasterDataset target — tar_terra_sds","text":"name Symbol, name target. target name must valid name symbol R, must start dot. See targets::tar_target() information. command R code run target. pattern Code define dynamic branching pattern target. See targets::tar_target() information. filetype character. File format expressed GDAL driver names passed terra::writeRaster(). gdal character. GDAL driver specific datasource creation options. passed terra::writeRaster() ... Additional arguments yet used. tidy_eval Logical, whether enable tidy evaluation interpreting command pattern. TRUE, can use \"bang-bang\" operator !! programmatically insert values global objects. packages Character vector packages load right target runs output data reloaded downstream targets. Use tar_option_set() set packages globally subsequent targets define. library Character vector library paths try loading packages. repository Character length 1, remote repository target storage. Choices: \"local\": file system local machine. \"aws\": Amazon Web Services (AWS) S3 bucket. Can configured non-AWS S3 bucket using endpoint argument tar_resources_aws(), versioning capabilities may lost . See cloud storage section https://books.ropensci.org/targets/data.html details instructions. \"gcp\": Google Cloud Platform storage bucket. See cloud storage section https://books.ropensci.org/targets/data.html details instructions. character string tar_repository_cas() content-addressable storage. Note: repository \"local\" format \"file\" target create single output file. output file uploaded cloud tracked changes exists cloud. local file deleted target runs. error Character length 1, target stops throws error. Options: \"stop\": whole pipeline stops throws error. \"continue\": whole pipeline keeps going. \"null\": errored target continues returns NULL. data hash deliberately wrong target date next run pipeline. \"abridge\": currently running targets keep running, new targets launch . \"trim\": currently running targets stay running. queued target allowed start : downstream error, sibling branch tar_target() call (error happened dynamic branch). idea avoid starting new work immediate error impacts. error = \"trim\" just like error = \"abridge\", allows potentially healthy regions dependency graph begin running. (Visit https://books.ropensci.org/targets/debugging.html learn debug targets using saved workspaces.) memory Character length 1, memory strategy. \"persistent\", target stays memory end pipeline (unless storage \"worker\", case targets unloads value memory right storing order avoid sending copious data network). \"transient\", target gets unloaded every new target completes. Either way, target gets automatically loaded memory whenever another target needs value. cloud-based dynamic files (e.g. format = \"file\" repository = \"aws\"), memory strategy applies temporary local copy file: \"persistent\" means remains end pipeline deleted, \"transient\" means gets deleted soon possible. former conserves bandwidth, latter conserves local storage. garbage_collection Logical, whether run base::gc() just target runs. deployment Character length 1. deployment \"main\", target run central controlling R process. Otherwise, deployment \"worker\" set pipeline distributed/parallel computing, target runs parallel worker. distributed/parallel computing targets, please visit https://books.ropensci.org/targets/crew.html. priority Numeric length 1 0 1. Controls targets get deployed first multiple competing targets ready simultaneously. Targets priorities closer 1 get dispatched earlier (polled earlier tar_make_future()). resources Object returned tar_resources() optional settings high-performance computing functionality, alternative data storage formats, optional capabilities targets. See tar_resources() details. storage Character length 1, relevant tar_make_clustermq() tar_make_future(). Must one following values: \"main\": target's return value sent back host machine saved/uploaded locally. \"worker\": worker saves/uploads value. \"none\": almost never recommended. niche situations, e.g. data needs loaded explicitly another language. use , return value target totally ignored target ends, downstream target still attempts load data file (except retrieval = \"none\"). select storage = \"none\", return value target's command ignored, data saved automatically. dynamic files (format = \"file\") responsibility user write data store inside target. distinguishing feature storage = \"none\" (opposed format = \"file\") general case, downstream targets automatically try load data data store dependency. corollary, storage = \"none\" completely unnecessary format \"file\". retrieval Character length 1, relevant tar_make_clustermq() tar_make_future(). Must one following values: \"main\": target's dependencies loaded host machine sent worker target runs. \"worker\": worker loads targets dependencies. \"none\": dependencies loaded . choice almost never recommended. niche situations, e.g. data needs loaded explicitly another language. cue optional object tar_cue() customize rules decide whether target date. description Character length 1, custom free-form human-readable text description target. Descriptions appear target labels functions like tar_manifest() tar_visnetwork(), let select subsets targets names argument functions like tar_make(). example, tar_manifest(names = tar_described_as(starts_with(\"survival model\"))) lists targets whose descriptions start character string \"survival model\".","code":""},{"path":"https://njtierney.github.io/geotargets/reference/tar_terra_sds.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create a terra SpatRasterDataset target — tar_terra_sds","text":"target class \"tar_stem\" use target pipeline","code":""},{"path":"https://njtierney.github.io/geotargets/reference/tar_terra_sds.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Create a terra SpatRasterDataset target — tar_terra_sds","text":"iteration argument unavailable hard-coded \"list\", option works currently.","code":""},{"path":[]},{"path":"https://njtierney.github.io/geotargets/reference/tar_terra_sds.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Create a terra SpatRasterDataset target — tar_terra_sds","text":"Andrew Gene Brown Nicholas Tierney Eric R. Scott","code":""},{"path":"https://njtierney.github.io/geotargets/reference/tar_terra_sds.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create a terra SpatRasterDataset target — tar_terra_sds","text":"","code":"if (Sys.getenv(\"TAR_LONG_EXAMPLES\") == \"true\") { targets::tar_dir({ # tar_dir() runs code from a temporary directory. library(geotargets) targets::tar_script({ elev_scale <- function(z = 1) { terra::rast(system.file(\"ex\", \"elev.tif\", package = \"terra\")) * z } list( tar_terra_sds( raster_elevs, # two rasters, one unaltered, one scaled by factor of 2 command = terra::sds(list( elev_scale(1), elev_scale(2) )) ) ) }) targets::tar_make() targets::tar_read(raster_elevs) }) }"},{"path":"https://njtierney.github.io/geotargets/reference/tar_terra_sprc.html","id":null,"dir":"Reference","previous_headings":"","what":"Create a terra SpatRasterCollection target — tar_terra_sprc","title":"Create a terra SpatRasterCollection target — tar_terra_sprc","text":"Provides target format terra::SpatRasterCollection objects, restriction extent geometric parameters.","code":""},{"path":"https://njtierney.github.io/geotargets/reference/tar_terra_sprc.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create a terra SpatRasterCollection target — tar_terra_sprc","text":"","code":"tar_terra_sprc( name, command, pattern = NULL, filetype = geotargets_option_get(\"gdal.raster.driver\"), gdal = geotargets_option_get(\"gdal.raster.creation.options\"), ..., tidy_eval = targets::tar_option_get(\"tidy_eval\"), packages = targets::tar_option_get(\"packages\"), library = targets::tar_option_get(\"library\"), repository = targets::tar_option_get(\"repository\"), error = targets::tar_option_get(\"error\"), memory = targets::tar_option_get(\"memory\"), garbage_collection = targets::tar_option_get(\"garbage_collection\"), deployment = targets::tar_option_get(\"deployment\"), priority = targets::tar_option_get(\"priority\"), resources = targets::tar_option_get(\"resources\"), storage = targets::tar_option_get(\"storage\"), retrieval = targets::tar_option_get(\"retrieval\"), cue = targets::tar_option_get(\"cue\"), description = targets::tar_option_get(\"description\") )"},{"path":"https://njtierney.github.io/geotargets/reference/tar_terra_sprc.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create a terra SpatRasterCollection target — tar_terra_sprc","text":"name Symbol, name target. target name must valid name symbol R, must start dot. See targets::tar_target() information. command R code run target. pattern Code define dynamic branching pattern target. See targets::tar_target() information. filetype character. File format expressed GDAL driver names passed terra::writeRaster(). gdal character. GDAL driver specific datasource creation options. passed terra::writeRaster() ... Additional arguments yet used. tidy_eval Logical, whether enable tidy evaluation interpreting command pattern. TRUE, can use \"bang-bang\" operator !! programmatically insert values global objects. packages Character vector packages load right target runs output data reloaded downstream targets. Use tar_option_set() set packages globally subsequent targets define. library Character vector library paths try loading packages. repository Character length 1, remote repository target storage. Choices: \"local\": file system local machine. \"aws\": Amazon Web Services (AWS) S3 bucket. Can configured non-AWS S3 bucket using endpoint argument tar_resources_aws(), versioning capabilities may lost . See cloud storage section https://books.ropensci.org/targets/data.html details instructions. \"gcp\": Google Cloud Platform storage bucket. See cloud storage section https://books.ropensci.org/targets/data.html details instructions. character string tar_repository_cas() content-addressable storage. Note: repository \"local\" format \"file\" target create single output file. output file uploaded cloud tracked changes exists cloud. local file deleted target runs. error Character length 1, target stops throws error. Options: \"stop\": whole pipeline stops throws error. \"continue\": whole pipeline keeps going. \"null\": errored target continues returns NULL. data hash deliberately wrong target date next run pipeline. \"abridge\": currently running targets keep running, new targets launch . \"trim\": currently running targets stay running. queued target allowed start : downstream error, sibling branch tar_target() call (error happened dynamic branch). idea avoid starting new work immediate error impacts. error = \"trim\" just like error = \"abridge\", allows potentially healthy regions dependency graph begin running. (Visit https://books.ropensci.org/targets/debugging.html learn debug targets using saved workspaces.) memory Character length 1, memory strategy. \"persistent\", target stays memory end pipeline (unless storage \"worker\", case targets unloads value memory right storing order avoid sending copious data network). \"transient\", target gets unloaded every new target completes. Either way, target gets automatically loaded memory whenever another target needs value. cloud-based dynamic files (e.g. format = \"file\" repository = \"aws\"), memory strategy applies temporary local copy file: \"persistent\" means remains end pipeline deleted, \"transient\" means gets deleted soon possible. former conserves bandwidth, latter conserves local storage. garbage_collection Logical, whether run base::gc() just target runs. deployment Character length 1. deployment \"main\", target run central controlling R process. Otherwise, deployment \"worker\" set pipeline distributed/parallel computing, target runs parallel worker. distributed/parallel computing targets, please visit https://books.ropensci.org/targets/crew.html. priority Numeric length 1 0 1. Controls targets get deployed first multiple competing targets ready simultaneously. Targets priorities closer 1 get dispatched earlier (polled earlier tar_make_future()). resources Object returned tar_resources() optional settings high-performance computing functionality, alternative data storage formats, optional capabilities targets. See tar_resources() details. storage Character length 1, relevant tar_make_clustermq() tar_make_future(). Must one following values: \"main\": target's return value sent back host machine saved/uploaded locally. \"worker\": worker saves/uploads value. \"none\": almost never recommended. niche situations, e.g. data needs loaded explicitly another language. use , return value target totally ignored target ends, downstream target still attempts load data file (except retrieval = \"none\"). select storage = \"none\", return value target's command ignored, data saved automatically. dynamic files (format = \"file\") responsibility user write data store inside target. distinguishing feature storage = \"none\" (opposed format = \"file\") general case, downstream targets automatically try load data data store dependency. corollary, storage = \"none\" completely unnecessary format \"file\". retrieval Character length 1, relevant tar_make_clustermq() tar_make_future(). Must one following values: \"main\": target's dependencies loaded host machine sent worker target runs. \"worker\": worker loads targets dependencies. \"none\": dependencies loaded . choice almost never recommended. niche situations, e.g. data needs loaded explicitly another language. cue optional object tar_cue() customize rules decide whether target date. description Character length 1, custom free-form human-readable text description target. Descriptions appear target labels functions like tar_manifest() tar_visnetwork(), let select subsets targets names argument functions like tar_make(). example, tar_manifest(names = tar_described_as(starts_with(\"survival model\"))) lists targets whose descriptions start character string \"survival model\".","code":""},{"path":"https://njtierney.github.io/geotargets/reference/tar_terra_sprc.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create a terra SpatRasterCollection target — tar_terra_sprc","text":"target class \"tar_stem\" use target pipeline","code":""},{"path":"https://njtierney.github.io/geotargets/reference/tar_terra_sprc.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Create a terra SpatRasterCollection target — tar_terra_sprc","text":"iteration argument unavailable hard-coded \"list\", option works currently.","code":""},{"path":[]},{"path":"https://njtierney.github.io/geotargets/reference/tar_terra_sprc.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Create a terra SpatRasterCollection target — tar_terra_sprc","text":"Andrew Gene Brown Nicholas Tierney","code":""},{"path":"https://njtierney.github.io/geotargets/reference/tar_terra_sprc.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create a terra SpatRasterCollection target — tar_terra_sprc","text":"","code":"if (Sys.getenv(\"TAR_LONG_EXAMPLES\") == \"true\") { targets::tar_dir({ # tar_dir() runs code from a temporary directory. library(geotargets) targets::tar_script({ elev_scale <- function(z = 1, projection = \"EPSG:4326\") { terra::project( terra::rast(system.file(\"ex\", \"elev.tif\", package = \"terra\")) * z, projection ) } list( tar_terra_sprc( raster_elevs, # two rasters, one unaltered, one scaled by factor of 2 and # reprojected to interrupted good homolosine command = terra::sprc(list( elev_scale(1), elev_scale(2, \"+proj=igh\") )) ) ) }) targets::tar_make() x <- targets::tar_read(raster_elevs) }) }"},{"path":"https://njtierney.github.io/geotargets/reference/tar_terra_tiles.html","id":null,"dir":"Reference","previous_headings":"","what":"Split a raster into tiles that can be iterated over with dynamic branching — tar_terra_tiles","title":"Split a raster into tiles that can be iterated over with dynamic branching — tar_terra_tiles","text":"target factory useful raster large high resolution work -memory. can instead split tiles can iterated using dynamic branching.","code":""},{"path":"https://njtierney.github.io/geotargets/reference/tar_terra_tiles.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Split a raster into tiles that can be iterated over with dynamic branching — tar_terra_tiles","text":"","code":"tar_terra_tiles( name, raster, tile_fun, filetype = geotargets_option_get(\"gdal.raster.driver\"), gdal = geotargets_option_get(\"gdal.raster.creation.options\"), ..., packages = targets::tar_option_get(\"packages\"), library = targets::tar_option_get(\"library\"), repository = targets::tar_option_get(\"repository\"), error = targets::tar_option_get(\"error\"), memory = targets::tar_option_get(\"memory\"), garbage_collection = targets::tar_option_get(\"garbage_collection\"), deployment = targets::tar_option_get(\"deployment\"), priority = targets::tar_option_get(\"priority\"), resources = targets::tar_option_get(\"resources\"), storage = targets::tar_option_get(\"storage\"), retrieval = targets::tar_option_get(\"retrieval\"), cue = targets::tar_option_get(\"cue\"), description = targets::tar_option_get(\"description\") )"},{"path":"https://njtierney.github.io/geotargets/reference/tar_terra_tiles.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Split a raster into tiles that can be iterated over with dynamic branching — tar_terra_tiles","text":"name Symbol, name target. target name must valid name symbol R, must start dot. See targets::tar_target() information. raster SpatRaster object split tiles. tile_fun helper function returns list numeric vectors tile_grid(), tile_n() tile_blocksize specified one following ways: named function, e.g. tile_blocksize \"tile_blocksize\". anonymous function, e.g. \\(x) tile_grid(x, nrow = 2, ncol = 2). filetype character. File format expressed GDAL driver names passed terra::makeTiles(). gdal character. GDAL driver specific datasource creation options passed terra::makeTiles(). ... additional arguments yet used. packages Character vector packages load right target runs output data reloaded downstream targets. Use tar_option_set() set packages globally subsequent targets define. library Character vector library paths try loading packages. repository Character length 1, remote repository target storage. Choices: \"local\": file system local machine. \"aws\": Amazon Web Services (AWS) S3 bucket. Can configured non-AWS S3 bucket using endpoint argument tar_resources_aws(), versioning capabilities may lost . See cloud storage section https://books.ropensci.org/targets/data.html details instructions. \"gcp\": Google Cloud Platform storage bucket. See cloud storage section https://books.ropensci.org/targets/data.html details instructions. character string tar_repository_cas() content-addressable storage. Note: repository \"local\" format \"file\" target create single output file. output file uploaded cloud tracked changes exists cloud. local file deleted target runs. error Character length 1, target stops throws error. Options: \"stop\": whole pipeline stops throws error. \"continue\": whole pipeline keeps going. \"null\": errored target continues returns NULL. data hash deliberately wrong target date next run pipeline. \"abridge\": currently running targets keep running, new targets launch . \"trim\": currently running targets stay running. queued target allowed start : downstream error, sibling branch tar_target() call (error happened dynamic branch). idea avoid starting new work immediate error impacts. error = \"trim\" just like error = \"abridge\", allows potentially healthy regions dependency graph begin running. (Visit https://books.ropensci.org/targets/debugging.html learn debug targets using saved workspaces.) memory Character length 1, memory strategy. \"persistent\", target stays memory end pipeline (unless storage \"worker\", case targets unloads value memory right storing order avoid sending copious data network). \"transient\", target gets unloaded every new target completes. Either way, target gets automatically loaded memory whenever another target needs value. cloud-based dynamic files (e.g. format = \"file\" repository = \"aws\"), memory strategy applies temporary local copy file: \"persistent\" means remains end pipeline deleted, \"transient\" means gets deleted soon possible. former conserves bandwidth, latter conserves local storage. garbage_collection Logical, whether run base::gc() just target runs. deployment Character length 1. deployment \"main\", target run central controlling R process. Otherwise, deployment \"worker\" set pipeline distributed/parallel computing, target runs parallel worker. distributed/parallel computing targets, please visit https://books.ropensci.org/targets/crew.html. priority Numeric length 1 0 1. Controls targets get deployed first multiple competing targets ready simultaneously. Targets priorities closer 1 get dispatched earlier (polled earlier tar_make_future()). resources Object returned tar_resources() optional settings high-performance computing functionality, alternative data storage formats, optional capabilities targets. See tar_resources() details. storage Character length 1, relevant tar_make_clustermq() tar_make_future(). Must one following values: \"main\": target's return value sent back host machine saved/uploaded locally. \"worker\": worker saves/uploads value. \"none\": almost never recommended. niche situations, e.g. data needs loaded explicitly another language. use , return value target totally ignored target ends, downstream target still attempts load data file (except retrieval = \"none\"). select storage = \"none\", return value target's command ignored, data saved automatically. dynamic files (format = \"file\") responsibility user write data store inside target. distinguishing feature storage = \"none\" (opposed format = \"file\") general case, downstream targets automatically try load data data store dependency. corollary, storage = \"none\" completely unnecessary format \"file\". retrieval Character length 1, relevant tar_make_clustermq() tar_make_future(). Must one following values: \"main\": target's dependencies loaded host machine sent worker target runs. \"worker\": worker loads targets dependencies. \"none\": dependencies loaded . choice almost never recommended. niche situations, e.g. data needs loaded explicitly another language. cue optional object tar_cue() customize rules decide whether target date. description Character length 1, custom free-form human-readable text description target. Descriptions appear target labels functions like tar_manifest() tar_visnetwork(), let select subsets targets names argument functions like tar_make(). example, tar_manifest(names = tar_described_as(starts_with(\"survival model\"))) lists targets whose descriptions start character string \"survival model\".","code":""},{"path":"https://njtierney.github.io/geotargets/reference/tar_terra_tiles.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Split a raster into tiles that can be iterated over with dynamic branching — tar_terra_tiles","text":"list two targets: upstream target creates list extents downstream pattern maps extents create list SpatRaster objects.","code":""},{"path":"https://njtierney.github.io/geotargets/reference/tar_terra_tiles.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Split a raster into tiles that can be iterated over with dynamic branching — tar_terra_tiles","text":"iteration argument unavailable hard-coded \"list\", option works currently. using tile_blocksize() helper function, may need set memory = \"transient\" upstream target provided raster argument tar_terra_tiles(). details help file tile_blocksize().","code":""},{"path":[]},{"path":"https://njtierney.github.io/geotargets/reference/tar_terra_tiles.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Split a raster into tiles that can be iterated over with dynamic branching — tar_terra_tiles","text":"Eric Scott","code":""},{"path":"https://njtierney.github.io/geotargets/reference/tar_terra_tiles.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Split a raster into tiles that can be iterated over with dynamic branching — tar_terra_tiles","text":"","code":"if (Sys.getenv(\"TAR_LONG_EXAMPLES\") == \"true\") { targets::tar_dir({ targets::tar_script({ library(targets) library(geotargets) library(terra) list( tar_target( my_file, system.file(\"ex/elev.tif\", package=\"terra\"), format = \"file\" ), tar_terra_rast( my_map, terra::rast(my_file) ), tar_terra_tiles( name = rast_split, raster = my_map, ncol = 2, nrow = 2 ) ) }) targets::tar_manifest() }) }"},{"path":"https://njtierney.github.io/geotargets/reference/tar_terra_vect.html","id":null,"dir":"Reference","previous_headings":"","what":"Create a terra SpatVector target — tar_terra_vect","title":"Create a terra SpatVector target — tar_terra_vect","text":"Provides target format terra::SpatVector objects.","code":""},{"path":"https://njtierney.github.io/geotargets/reference/tar_terra_vect.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create a terra SpatVector target — tar_terra_vect","text":"","code":"tar_terra_vect( name, command, pattern = NULL, filetype = geotargets_option_get(\"gdal.vector.driver\"), gdal = geotargets_option_get(\"gdal.vector.creation.options\"), ..., packages = targets::tar_option_get(\"packages\"), tidy_eval = targets::tar_option_get(\"tidy_eval\"), library = targets::tar_option_get(\"library\"), repository = targets::tar_option_get(\"repository\"), error = targets::tar_option_get(\"error\"), memory = targets::tar_option_get(\"memory\"), garbage_collection = targets::tar_option_get(\"garbage_collection\"), deployment = targets::tar_option_get(\"deployment\"), priority = targets::tar_option_get(\"priority\"), resources = targets::tar_option_get(\"resources\"), storage = targets::tar_option_get(\"storage\"), retrieval = targets::tar_option_get(\"retrieval\"), cue = targets::tar_option_get(\"cue\"), description = targets::tar_option_get(\"description\") )"},{"path":"https://njtierney.github.io/geotargets/reference/tar_terra_vect.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create a terra SpatVector target — tar_terra_vect","text":"name Symbol, name target. target name must valid name symbol R, must start dot. See targets::tar_target() information. command R code run target. pattern Code define dynamic branching pattern target. See targets::tar_target() information. filetype character. File format expressed GDAL driver names passed terra::writeVector(). See 'Note' details. gdal character. GDAL driver specific datasource creation options passed terra::writeVector(). ... Additional arguments yet used. packages Character vector packages load right target runs output data reloaded downstream targets. Use tar_option_set() set packages globally subsequent targets define. tidy_eval Logical, whether enable tidy evaluation interpreting command pattern. TRUE, can use \"bang-bang\" operator !! programmatically insert values global objects. library Character vector library paths try loading packages. repository Character length 1, remote repository target storage. Choices: \"local\": file system local machine. \"aws\": Amazon Web Services (AWS) S3 bucket. Can configured non-AWS S3 bucket using endpoint argument tar_resources_aws(), versioning capabilities may lost . See cloud storage section https://books.ropensci.org/targets/data.html details instructions. \"gcp\": Google Cloud Platform storage bucket. See cloud storage section https://books.ropensci.org/targets/data.html details instructions. character string tar_repository_cas() content-addressable storage. Note: repository \"local\" format \"file\" target create single output file. output file uploaded cloud tracked changes exists cloud. local file deleted target runs. error Character length 1, target stops throws error. Options: \"stop\": whole pipeline stops throws error. \"continue\": whole pipeline keeps going. \"null\": errored target continues returns NULL. data hash deliberately wrong target date next run pipeline. \"abridge\": currently running targets keep running, new targets launch . \"trim\": currently running targets stay running. queued target allowed start : downstream error, sibling branch tar_target() call (error happened dynamic branch). idea avoid starting new work immediate error impacts. error = \"trim\" just like error = \"abridge\", allows potentially healthy regions dependency graph begin running. (Visit https://books.ropensci.org/targets/debugging.html learn debug targets using saved workspaces.) memory Character length 1, memory strategy. \"persistent\", target stays memory end pipeline (unless storage \"worker\", case targets unloads value memory right storing order avoid sending copious data network). \"transient\", target gets unloaded every new target completes. Either way, target gets automatically loaded memory whenever another target needs value. cloud-based dynamic files (e.g. format = \"file\" repository = \"aws\"), memory strategy applies temporary local copy file: \"persistent\" means remains end pipeline deleted, \"transient\" means gets deleted soon possible. former conserves bandwidth, latter conserves local storage. garbage_collection Logical, whether run base::gc() just target runs. deployment Character length 1. deployment \"main\", target run central controlling R process. Otherwise, deployment \"worker\" set pipeline distributed/parallel computing, target runs parallel worker. distributed/parallel computing targets, please visit https://books.ropensci.org/targets/crew.html. priority Numeric length 1 0 1. Controls targets get deployed first multiple competing targets ready simultaneously. Targets priorities closer 1 get dispatched earlier (polled earlier tar_make_future()). resources Object returned tar_resources() optional settings high-performance computing functionality, alternative data storage formats, optional capabilities targets. See tar_resources() details. storage Character length 1, relevant tar_make_clustermq() tar_make_future(). Must one following values: \"main\": target's return value sent back host machine saved/uploaded locally. \"worker\": worker saves/uploads value. \"none\": almost never recommended. niche situations, e.g. data needs loaded explicitly another language. use , return value target totally ignored target ends, downstream target still attempts load data file (except retrieval = \"none\"). select storage = \"none\", return value target's command ignored, data saved automatically. dynamic files (format = \"file\") responsibility user write data store inside target. distinguishing feature storage = \"none\" (opposed format = \"file\") general case, downstream targets automatically try load data data store dependency. corollary, storage = \"none\" completely unnecessary format \"file\". retrieval Character length 1, relevant tar_make_clustermq() tar_make_future(). Must one following values: \"main\": target's dependencies loaded host machine sent worker target runs. \"worker\": worker loads targets dependencies. \"none\": dependencies loaded . choice almost never recommended. niche situations, e.g. data needs loaded explicitly another language. cue optional object tar_cue() customize rules decide whether target date. description Character length 1, custom free-form human-readable text description target. Descriptions appear target labels functions like tar_manifest() tar_visnetwork(), let select subsets targets names argument functions like tar_make(). example, tar_manifest(names = tar_described_as(starts_with(\"survival model\"))) lists targets whose descriptions start character string \"survival model\".","code":""},{"path":"https://njtierney.github.io/geotargets/reference/tar_terra_vect.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create a terra SpatVector target — tar_terra_vect","text":"target class \"tar_stem\" use target pipeline","code":""},{"path":"https://njtierney.github.io/geotargets/reference/tar_terra_vect.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Create a terra SpatVector target — tar_terra_vect","text":"terra::SpatVector objects contain vector data directly—contain C++ pointer memory data stored. result, objects portable R sessions without special handling, causes problems including targets pipelines tar_target(). tar_terra_rast() handles issue writing reading target geospatial file (specified filetype) rather saving SpatVector object .","code":""},{"path":"https://njtierney.github.io/geotargets/reference/tar_terra_vect.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Create a terra SpatVector target — tar_terra_vect","text":"iteration argument unavailable hard-coded \"list\", option works currently. Although may pass supported GDAL vector driver filetype argument, formats guaranteed work geotargets. moment, tested GeoJSON ESRI Shapefile appear work generally.","code":""},{"path":"https://njtierney.github.io/geotargets/reference/tar_terra_vect.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create a terra SpatVector target — tar_terra_vect","text":"","code":"if (Sys.getenv(\"TAR_LONG_EXAMPLES\") == \"true\") { targets::tar_dir({ # tar_dir() runs code from a temporary directory. targets::tar_script({ lux_area <- function(projection = \"EPSG:4326\") { terra::project( terra::vect(system.file(\"ex\", \"lux.shp\", package = \"terra\" )), projection ) } list( geotargets::tar_terra_vect( terra_vect_example, lux_area() ) ) }) targets::tar_make() x <- targets::tar_read(terra_vect_example) }) }"},{"path":"https://njtierney.github.io/geotargets/reference/tile_helpers.html","id":null,"dir":"Reference","previous_headings":"","what":"Helper functions to create tiles — tile_grid","title":"Helper functions to create tiles — tile_grid","text":"Wrappers around terra::getTileExtents() return list named numeric vectors describing extents tiles rather SpatExtent objects. may general use, intended primarily supplying tile_fun argument tar_terra_tiles().","code":""},{"path":"https://njtierney.github.io/geotargets/reference/tile_helpers.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Helper functions to create tiles — tile_grid","text":"","code":"tile_grid(raster, ncol, nrow) tile_blocksize(raster, n_blocks_row = 1, n_blocks_col = 1) tile_n(raster, n)"},{"path":"https://njtierney.github.io/geotargets/reference/tile_helpers.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Helper functions to create tiles — tile_grid","text":"raster SpatRaster object. ncol integer; number columns split SpatRaster . nrow integer; number rows split SpatRaster . n_blocks_row integer; multiple blocksize include tile vertically. n_blocks_col integer; multiple blocksize include tile horizontally. n integer; total number tiles split SpatRaster .","code":""},{"path":"https://njtierney.github.io/geotargets/reference/tile_helpers.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Helper functions to create tiles — tile_grid","text":"list named numeric vectors xmin, xmax, ymin, ymax values can coerced SpatExtent objects terra::ext().","code":""},{"path":"https://njtierney.github.io/geotargets/reference/tile_helpers.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Helper functions to create tiles — tile_grid","text":"tile_blocksize() creates extents using raster's native block size (see terra::fileBlocksize()), memory efficient. Create tiles multiples raster's blocksize n_blocks_row n_blocks_col. strongly suggest user explore many tiles created tile_blocksize() creating dynamically branched target using helper. Note block size property files apply -memory SpatRasters. Therefore, want use helper tar_terra_tiles() may need ensure upstream target provided raster argument memory setting memory = \"transient\". tile_grid() allows specification number rows columns split raster . E.g. nrow = 2 ncol = 2 create 4 tiles (specifies 2x2 matrix, 4 elements). tile_n() creates () n tiles prints number rows, columns, total tiles created.","code":""},{"path":"https://njtierney.github.io/geotargets/reference/tile_helpers.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Helper functions to create tiles — tile_grid","text":"Eric Scott","code":""},{"path":[]},{"path":"https://njtierney.github.io/geotargets/news/index.html","id":"geotargets-development-version","dir":"Changelog","previous_headings":"","what":"geotargets (development version)","title":"geotargets (development version)","text":"bugfix @brownag fixes use file.rename() tar_terra_rast(..., preserve_metadata = \"zip\"), work temporary directory different partition. (#121, PR #122).","code":""},{"path":"https://njtierney.github.io/geotargets/news/index.html","id":"geotargets-020-29-november-2024","dir":"Changelog","previous_headings":"","what":"geotargets 0.2.0 (29 November 2024)","title":"geotargets 0.2.0 (29 November 2024)","text":"Created tar_stars() tar_stars_proxy() create stars stars_proxy objects, respectively. Created tar_terra_tiles(), “target factory” splitting raster multiple tiles dynamic branching (#69). Created two helper functions use tar_terra_tiles(): tile_grid(), tile_n(), tile_blocksize() (#69, #86, #87, #89). Created utility function set_window() mostly internal use within tar_terra_tiles(). Removes iteration argument tar_*() functions. iteration now hard-coded \"list\" since option works (now least). Added description argument tar_*() functions passed tar_target(). Suppressed warning “[rast] skipped sub-datasets” tar_terra_sprc(), misleading context (#92, #104). Requires GDAL 3.1 greater use “ESRI Shapefile” driver tar_terra_vect() (#71, #97) geotargets now requires targets version 1.8.0 higher tar_terra_rast() gains preserve_metadata option set \"zip\" reads/writes targets zip archives include aux.json “sidecar” files sometimes written terra (#58) terra (>= 1.7.71), withr (>= 3.0.0), zip now required dependencies geotargets (moved Suggests Imports)","code":""},{"path":"https://njtierney.github.io/geotargets/news/index.html","id":"geotargets-010-14-may-2024","dir":"Changelog","previous_headings":"","what":"geotargets 0.1.0 (14 May 2024)","title":"geotargets 0.1.0 (14 May 2024)","text":"Created tar_terra_rast() tar_terra_vect() targets create SpatRaster SpatVector objects, respectively Created tar_terra_sprc() creates SpatRasterCollection object. geotargets_options_get() geotargets_options_set() can used set get options specific geotargets. geotargets now requires targets version 1.7.0 higher fixed bug resources supplied tar_terra_*() ignored (#66)","code":""}]