From 7cf5c38c4b4599966d8c0c543b5434219f4908ab Mon Sep 17 00:00:00 2001 From: Aariq Date: Tue, 13 Aug 2024 15:49:53 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20njtierne?= =?UTF-8?q?y/geotargets@1be6d62f7e7130366affbd634dedd1fb778a50b3=20?= =?UTF-8?q?=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- news/index.html | 6 +- pkgdown.yml | 2 +- reference/index.html | 12 +-- reference/tar_terra_tiles.html | 17 +++-- reference/tile_blocksize.html | 8 ++ reference/tile_helpers.html | 132 +++++++++++++++++++++++++++++++++ search.json | 2 +- sitemap.xml | 2 +- 8 files changed, 161 insertions(+), 20 deletions(-) create mode 100644 reference/tile_blocksize.html create mode 100644 reference/tile_helpers.html diff --git a/news/index.html b/news/index.html index 8d5e7f8..856f255 100644 --- a/news/index.html +++ b/news/index.html @@ -36,9 +36,9 @@

Changelog

geotargets (development version)

geotargets 0.1.0 (14 May 2024)

diff --git a/pkgdown.yml b/pkgdown.yml index dc5205d..fdf57e5 100644 --- a/pkgdown.yml +++ b/pkgdown.yml @@ -2,7 +2,7 @@ pandoc: 3.1.11 pkgdown: 2.1.0 pkgdown_sha: ~ articles: {} -last_built: 2024-07-17T05:26Z +last_built: 2024-08-13T15:49Z urls: reference: https://njtierney.github.io/geotargets/reference article: https://njtierney.github.io/geotargets/articles diff --git a/reference/index.html b/reference/index.html index 452de64..5378be9 100644 --- a/reference/index.html +++ b/reference/index.html @@ -44,12 +44,6 @@

All functionscreate_tile_exts() - - -
Create extents for raster tiles
-
- geotargets_option_set() geotargets_option_get()
@@ -90,6 +84,12 @@

All functionstile_grid() tile_blocksize() + + +
Helper functions to create tiles

diff --git a/reference/tar_terra_tiles.html b/reference/tar_terra_tiles.html index a6724df..53d47b3 100644 --- a/reference/tar_terra_tiles.html +++ b/reference/tar_terra_tiles.html @@ -48,8 +48,7 @@

Usage
tar_terra_tiles(
   name,
   raster,
-  ncol,
-  nrow,
+  tile_fun,
   filetype = geotargets_option_get("gdal.raster.driver"),
   gdal = geotargets_option_get("gdal.raster.creation.options"),
   ...,
@@ -95,12 +94,10 @@ 

Argumentsncol -

integer; number of columns to split the SpatRaster into

- - -
nrow
-

integer; number of rows to split the SpatRaster into

+
tile_fun
+

a helper function that returns a list of numeric vectors such as tile_grid or tile_blocksize specified in one of the following ways:

  • A named function, e.g. tile_blocksize or "tile_blocksize"

  • +
  • An anonymous function, e.g. \(x) tile_grid(x, nrow = 2, ncol = 2)

  • +
filetype
@@ -278,6 +275,10 @@

Value

a list of two targets: an upstream target that creates a list of extents and a downstream pattern that maps over these extents to create a list of SpatRaster objects.

+
+

Author

diff --git a/reference/tile_blocksize.html b/reference/tile_blocksize.html new file mode 100644 index 0000000..5c59641 --- /dev/null +++ b/reference/tile_blocksize.html @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/reference/tile_helpers.html b/reference/tile_helpers.html new file mode 100644 index 0000000..2544070 --- /dev/null +++ b/reference/tile_helpers.html @@ -0,0 +1,132 @@ + +Helper functions to create tiles — tile_grid • geotargets + Skip to contents + + +
+
+
+ +
+

Wrappers around terra::getTileExtents() that return a list of named numeric +vectors describing the extents of tiles rather than SpatExtent objects. +While these may have general use, they are intended primarily for supplying +to the tile_fun argument of tar_terra_tiles().

+
+ +
+

Usage

+
tile_grid(raster, ncol, nrow)
+
+tile_blocksize(raster)
+
+ +
+

Arguments

+ + +
raster
+

a SpatRaster object

+ + +
ncol
+

integer; number of columns to split the SpatRaster into

+ + +
nrow
+

integer; number of rows to split the SpatRaster into

+ +
+
+

Value

+

list of named numeric vectors with xmin, xmax, ymin, and ymax values +that can be coerced to SpatExtent objects with terra::ext().

+
+
+

Details

+

tile_blocksize() creates extents using the raster's native blocksize (see +terra::fileBlocksize()), which should be more memory efficient. tile_grid() +allows specification of a number of rows and columns to split the raster +into. E.g. nrow = 2 and ncol = 2 would create 4 tiles (because it specifies a 2x2 matrix, which has 4 elements).

+
+
+

Author

+

Eric Scott

+
+ +
+

Examples

+
f <- system.file("ex/elev.tif", package="terra")
+r <- terra::rast(f)
+r_tiles <- tile_grid(r, ncol = 2, nrow = 2)
+r_tiles
+#> [[1]]
+#>      xmin      xmax      ymin      ymax 
+#>  5.741667  6.141667 49.816667 50.191667 
+#> 
+#> [[2]]
+#>      xmin      xmax      ymin      ymax 
+#>  6.133333  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.133333  6.533333 49.441667 49.816667 
+#> 
+
+
+
+ + +
+ + + +
+ + + + + + + diff --git a/search.json b/search.json index d61dfc5..a83b857 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/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/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 (2024). geotargets: 'Targets' Extensions Geospatial Formats. R package version 0.1.0.9000, https://njtierney.github.io/geotargets/, https://github.com/njtierney/geotargets.","code":"@Manual{, title = {geotargets: 'Targets' Extensions for Geospatial Formats}, author = {Nicholas Tierney and Eric Scott and Andrew Brown}, year = {2024}, note = {R package version 0.1.0.9000, https://njtierney.github.io/geotargets/}, 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_stars() use place tar_target() targets pipeline, work terra raster, vector, raster collection data. like see download working examples , see repo, demo-geotargets.","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.019 seconds] #> ▶ ended pipeline [0.185 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.034 seconds] #> ▶ ended pipeline [0.173 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 18081 #> 1 Diekirch 2 Diekirch 218 32543 #> 1 Diekirch 3 Redange 259 18664"},{"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.112 seconds] #> ▶ ended pipeline [0.266 seconds] #> Warning message: #> [rast] skipped sub-datasets (see 'describe(sds=TRUE)'): #> /private/var/folders/wr/by_lst2d2fngf67mknmgf4340000gn/T/Rtmpr9sjXA/targets_1085a12a40d0c/_targets/scratch/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/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] #> ▶ ended pipeline [0.17 seconds] #> Warning message: #> In CPL_write_gdal(mat, file, driver, options, type, dims, from, : #> GDAL Message 6: creation option '' is not formatted with the key=value format #> 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":"a-note-on-development","dir":"","previous_headings":"","what":"A note on development","title":"Targets Extensions for Geospatial Formats","text":"geotargets still undergoing development. currently consider extensions terra maturing approaching stability. love people use package kick tyres. using work, want users know API change subtle breaking ways.","code":""},{"path":"https://njtierney.github.io/geotargets/reference/create_tile_exts.html","id":null,"dir":"Reference","previous_headings":"","what":"Create extents for raster tiles — create_tile_exts","title":"Create extents for raster tiles — create_tile_exts","text":"wrapper around terra::getTileExtents() creating tile specification. Rather supply template, one created original raster extent CRS using ncol nrow. output list named numeric vectors can coerced SpatExtent objects terra::ext().","code":""},{"path":"https://njtierney.github.io/geotargets/reference/create_tile_exts.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create extents for raster tiles — create_tile_exts","text":"","code":"create_tile_exts(raster, ncol, nrow)"},{"path":"https://njtierney.github.io/geotargets/reference/create_tile_exts.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create extents for raster tiles — create_tile_exts","text":"raster SpatRaster object ncol integer; number columns split SpatRaster nrow integer; number rows split SpatRaster ","code":""},{"path":"https://njtierney.github.io/geotargets/reference/create_tile_exts.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create extents for raster tiles — create_tile_exts","text":"list named numeric vectors xmin, xmax, ymin, ymax values","code":""},{"path":"https://njtierney.github.io/geotargets/reference/create_tile_exts.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Create extents for raster tiles — create_tile_exts","text":"may general use, created primarily use within tar_terra_tiles().","code":""},{"path":"https://njtierney.github.io/geotargets/reference/create_tile_exts.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Create extents for raster tiles — create_tile_exts","text":"Eric Scott","code":""},{"path":"https://njtierney.github.io/geotargets/reference/create_tile_exts.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create extents for raster tiles — create_tile_exts","text":"","code":"f <- system.file(\"ex/elev.tif\", package=\"terra\") r <- terra::rast(f) r_tiles <- create_tile_exts(r, ncol = 2, nrow = 2) r_tiles #> [[1]] #> xmin xmax ymin ymax #> 5.741667 6.141667 49.816667 50.191667 #> #> [[2]] #> xmin xmax ymin ymax #> 6.133333 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.133333 6.533333 49.441667 49.816667 #>"},{"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 ) 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 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":"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.","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\"), iteration = targets::tar_option_get(\"iteration\"), 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\"), iteration = targets::tar_option_get(\"iteration\"), 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. Subsequent targets can refer name symbolically induce dependency relationship: e.g. tar_target(downstream_target, f(upstream_target)) target named downstream_target depends target upstream_target function f(). addition, target's name determines random number generator seed. way, target runs reproducible seed someone else running pipeline get results, two targets pipeline share seed. (Even dynamic branches different names thus different seeds.) can recover seed completed target tar_meta(your_target, seed) run tar_seed_set() result locally recreate target's initial RNG state. command R code run target. pattern Language define branching target. example, pipeline numeric vector targets x y, tar_target(z, x + y, pattern = map(x, y)) implicitly defines branches z compute x[1] + y[1], x[2] + y[2], . See user manual details. 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. Note: repository \"local\" format \"file\" target create single output file. output file uploaded cloud tracked changes exists cloud. local file deleted target runs. iteration Character length 1, name iteration mode target. Choices: \"vector\": branching happens vctrs::vec_slice() aggregation happens vctrs::vec_c(). \"list\", branching happens [[]] aggregation happens list(). \"group\": dplyr::group_by()-like functionality branch subsets non-dynamic data frame. iteration = \"group\", target must dynamic (pattern argument tar_target() must left NULL). target's return value must data frame special tar_group column consecutive integers 1 number groups. integer designates group, branch created collection rows group. See tar_group() function see can create special tar_group column dplyr::group_by(). error Character length 1, target stops throws error. Options: \"stop\": whole pipeline stops throws error. \"continue\": whole pipeline keeps going. \"abridge\": currently running targets keep running, new targets launch . (Visit https://books.ropensci.org/targets/debugging.html learn debug targets using saved workspaces.) \"null\": errored target continues returns NULL. data hash deliberately wrong target date next run pipeline. 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":[]},{"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\"), ..., 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\"), iteration = targets::tar_option_get(\"iteration\"), 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. Subsequent targets can refer name symbolically induce dependency relationship: e.g. tar_target(downstream_target, f(upstream_target)) target named downstream_target depends target upstream_target function f(). addition, target's name determines random number generator seed. way, target runs reproducible seed someone else running pipeline get results, two targets pipeline share seed. (Even dynamic branches different names thus different seeds.) can recover seed completed target tar_meta(your_target, seed) run tar_seed_set() result locally recreate target's initial RNG state. command R code run target. pattern Language define branching target. example, pipeline numeric vector targets x y, tar_target(z, x + y, pattern = map(x, y)) implicitly defines branches z compute x[1] + y[1], x[2] + y[2], . See user manual details. 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. Note: repository \"local\" format \"file\" target create single output file. output file uploaded cloud tracked changes exists cloud. local file deleted target runs. iteration Character length 1, name iteration mode target. Choices: \"vector\": branching happens vctrs::vec_slice() aggregation happens vctrs::vec_c(). \"list\", branching happens [[]] aggregation happens list(). \"group\": dplyr::group_by()-like functionality branch subsets non-dynamic data frame. iteration = \"group\", target must dynamic (pattern argument tar_target() must left NULL). target's return value must data frame special tar_group column consecutive integers 1 number groups. integer designates group, branch created collection rows group. See tar_group() function see can create special tar_group column dplyr::group_by(). error Character length 1, target stops throws error. Options: \"stop\": whole pipeline stops throws error. \"continue\": whole pipeline keeps going. \"abridge\": currently running targets keep running, new targets launch . (Visit https://books.ropensci.org/targets/debugging.html learn debug targets using saved workspaces.) \"null\": errored target continues returns NULL. data hash deliberately wrong target date next run pipeline. 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":[]},{"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_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\"), iteration = targets::tar_option_get(\"iteration\"), 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. Subsequent targets can refer name symbolically induce dependency relationship: e.g. tar_target(downstream_target, f(upstream_target)) target named downstream_target depends target upstream_target function f(). addition, target's name determines random number generator seed. way, target runs reproducible seed someone else running pipeline get results, two targets pipeline share seed. (Even dynamic branches different names thus different seeds.) can recover seed completed target tar_meta(your_target, seed) run tar_seed_set() result locally recreate target's initial RNG state. command R code run target. pattern Language define branching target. example, pipeline numeric vector targets x y, tar_target(z, x + y, pattern = map(x, y)) implicitly defines branches z compute x[1] + y[1], x[2] + y[2], . See user manual details. 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. Note: repository \"local\" format \"file\" target create single output file. output file uploaded cloud tracked changes exists cloud. local file deleted target runs. iteration Character length 1, name iteration mode target. Choices: \"vector\": branching happens vctrs::vec_slice() aggregation happens vctrs::vec_c(). \"list\", branching happens [[]] aggregation happens list(). \"group\": dplyr::group_by()-like functionality branch subsets non-dynamic data frame. iteration = \"group\", target must dynamic (pattern argument tar_target() must left NULL). target's return value must data frame special tar_group column consecutive integers 1 number groups. integer designates group, branch created collection rows group. See tar_group() function see can create special tar_group column dplyr::group_by(). error Character length 1, target stops throws error. Options: \"stop\": whole pipeline stops throws error. \"continue\": whole pipeline keeps going. \"abridge\": currently running targets keep running, new targets launch . (Visit https://books.ropensci.org/targets/debugging.html learn debug targets using saved workspaces.) \"null\": errored target continues returns NULL. data hash deliberately wrong target date next run pipeline. 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":[]},{"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 , potentially using parallel workers.","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, ncol, nrow, 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. Subsequent targets can refer name symbolically induce dependency relationship: e.g. tar_target(downstream_target, f(upstream_target)) target named downstream_target depends target upstream_target function f(). addition, target's name determines random number generator seed. way, target runs reproducible seed someone else running pipeline get results, two targets pipeline share seed. (Even dynamic branches different names thus different seeds.) can recover seed completed target tar_meta(your_target, seed) run tar_seed_set() result locally recreate target's initial RNG state. raster SpatRaster object split tiles ncol integer; number columns split SpatRaster nrow integer; number rows split SpatRaster 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. 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. \"abridge\": currently running targets keep running, new targets launch . (Visit https://books.ropensci.org/targets/debugging.html learn debug targets using saved workspaces.) \"null\": errored target continues returns NULL. data hash deliberately wrong target date next run pipeline. 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":"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\"), iteration = targets::tar_option_get(\"iteration\"), 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. Subsequent targets can refer name symbolically induce dependency relationship: e.g. tar_target(downstream_target, f(upstream_target)) target named downstream_target depends target upstream_target function f(). addition, target's name determines random number generator seed. way, target runs reproducible seed someone else running pipeline get results, two targets pipeline share seed. (Even dynamic branches different names thus different seeds.) can recover seed completed target tar_meta(your_target, seed) run tar_seed_set() result locally recreate target's initial RNG state. command R code run target. pattern Language define branching target. example, pipeline numeric vector targets x y, tar_target(z, x + y, pattern = map(x, y)) implicitly defines branches z compute x[1] + y[1], x[2] + y[2], . See user manual details. 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. Note: repository \"local\" format \"file\" target create single output file. output file uploaded cloud tracked changes exists cloud. local file deleted target runs. iteration Character length 1, name iteration mode target. Choices: \"vector\": branching happens vctrs::vec_slice() aggregation happens vctrs::vec_c(). \"list\", branching happens [[]] aggregation happens list(). \"group\": dplyr::group_by()-like functionality branch subsets non-dynamic data frame. iteration = \"group\", target must dynamic (pattern argument tar_target() must left NULL). target's return value must data frame special tar_group column consecutive integers 1 number groups. integer designates group, branch created collection rows group. See tar_group() function see can create special tar_group column dplyr::group_by(). error Character length 1, target stops throws error. Options: \"stop\": whole pipeline stops throws error. \"continue\": whole pipeline keeps going. \"abridge\": currently running targets keep running, new targets launch . (Visit https://books.ropensci.org/targets/debugging.html learn debug targets using saved workspaces.) \"null\": errored target continues returns NULL. data hash deliberately wrong target date next run pipeline. 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":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Create a terra SpatVector target — tar_terra_vect","text":"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/news/index.html","id":"geotargets-development-version","dir":"Changelog","previous_headings":"","what":"geotargets (development version)","title":"geotargets (development version)","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. Created helper functions set_window() create_tile_exts() mostly use within tar_terra_tiles(). Added description argument tar_*() functions passed tar_target()","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/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/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 (2024). geotargets: 'Targets' Extensions Geospatial Formats. R package version 0.1.0.9000, https://njtierney.github.io/geotargets/, https://github.com/njtierney/geotargets.","code":"@Manual{, title = {geotargets: 'Targets' Extensions for Geospatial Formats}, author = {Nicholas Tierney and Eric Scott and Andrew Brown}, year = {2024}, note = {R package version 0.1.0.9000, https://njtierney.github.io/geotargets/}, 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_stars() use place tar_target() targets pipeline, work terra raster, vector, raster collection data. like see download working examples , see repo, demo-geotargets.","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.019 seconds] #> ▶ ended pipeline [0.185 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.034 seconds] #> ▶ ended pipeline [0.173 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 18081 #> 1 Diekirch 2 Diekirch 218 32543 #> 1 Diekirch 3 Redange 259 18664"},{"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.112 seconds] #> ▶ ended pipeline [0.266 seconds] #> Warning message: #> [rast] skipped sub-datasets (see 'describe(sds=TRUE)'): #> /private/var/folders/wr/by_lst2d2fngf67mknmgf4340000gn/T/Rtmpr9sjXA/targets_1085a12a40d0c/_targets/scratch/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/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] #> ▶ ended pipeline [0.17 seconds] #> Warning message: #> In CPL_write_gdal(mat, file, driver, options, type, dims, from, : #> GDAL Message 6: creation option '' is not formatted with the key=value format #> 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":"a-note-on-development","dir":"","previous_headings":"","what":"A note on development","title":"Targets Extensions for Geospatial Formats","text":"geotargets still undergoing development. currently consider extensions terra maturing approaching stability. love people use package kick tyres. using work, want users know API change subtle breaking ways.","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 ) 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 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":"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.","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\"), iteration = targets::tar_option_get(\"iteration\"), 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\"), iteration = targets::tar_option_get(\"iteration\"), 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. Subsequent targets can refer name symbolically induce dependency relationship: e.g. tar_target(downstream_target, f(upstream_target)) target named downstream_target depends target upstream_target function f(). addition, target's name determines random number generator seed. way, target runs reproducible seed someone else running pipeline get results, two targets pipeline share seed. (Even dynamic branches different names thus different seeds.) can recover seed completed target tar_meta(your_target, seed) run tar_seed_set() result locally recreate target's initial RNG state. command R code run target. pattern Language define branching target. example, pipeline numeric vector targets x y, tar_target(z, x + y, pattern = map(x, y)) implicitly defines branches z compute x[1] + y[1], x[2] + y[2], . See user manual details. 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. Note: repository \"local\" format \"file\" target create single output file. output file uploaded cloud tracked changes exists cloud. local file deleted target runs. iteration Character length 1, name iteration mode target. Choices: \"vector\": branching happens vctrs::vec_slice() aggregation happens vctrs::vec_c(). \"list\", branching happens [[]] aggregation happens list(). \"group\": dplyr::group_by()-like functionality branch subsets non-dynamic data frame. iteration = \"group\", target must dynamic (pattern argument tar_target() must left NULL). target's return value must data frame special tar_group column consecutive integers 1 number groups. integer designates group, branch created collection rows group. See tar_group() function see can create special tar_group column dplyr::group_by(). error Character length 1, target stops throws error. Options: \"stop\": whole pipeline stops throws error. \"continue\": whole pipeline keeps going. \"abridge\": currently running targets keep running, new targets launch . (Visit https://books.ropensci.org/targets/debugging.html learn debug targets using saved workspaces.) \"null\": errored target continues returns NULL. data hash deliberately wrong target date next run pipeline. 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":[]},{"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\"), ..., 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\"), iteration = targets::tar_option_get(\"iteration\"), 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. Subsequent targets can refer name symbolically induce dependency relationship: e.g. tar_target(downstream_target, f(upstream_target)) target named downstream_target depends target upstream_target function f(). addition, target's name determines random number generator seed. way, target runs reproducible seed someone else running pipeline get results, two targets pipeline share seed. (Even dynamic branches different names thus different seeds.) can recover seed completed target tar_meta(your_target, seed) run tar_seed_set() result locally recreate target's initial RNG state. command R code run target. pattern Language define branching target. example, pipeline numeric vector targets x y, tar_target(z, x + y, pattern = map(x, y)) implicitly defines branches z compute x[1] + y[1], x[2] + y[2], . See user manual details. 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. Note: repository \"local\" format \"file\" target create single output file. output file uploaded cloud tracked changes exists cloud. local file deleted target runs. iteration Character length 1, name iteration mode target. Choices: \"vector\": branching happens vctrs::vec_slice() aggregation happens vctrs::vec_c(). \"list\", branching happens [[]] aggregation happens list(). \"group\": dplyr::group_by()-like functionality branch subsets non-dynamic data frame. iteration = \"group\", target must dynamic (pattern argument tar_target() must left NULL). target's return value must data frame special tar_group column consecutive integers 1 number groups. integer designates group, branch created collection rows group. See tar_group() function see can create special tar_group column dplyr::group_by(). error Character length 1, target stops throws error. Options: \"stop\": whole pipeline stops throws error. \"continue\": whole pipeline keeps going. \"abridge\": currently running targets keep running, new targets launch . (Visit https://books.ropensci.org/targets/debugging.html learn debug targets using saved workspaces.) \"null\": errored target continues returns NULL. data hash deliberately wrong target date next run pipeline. 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":[]},{"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_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\"), iteration = targets::tar_option_get(\"iteration\"), 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. Subsequent targets can refer name symbolically induce dependency relationship: e.g. tar_target(downstream_target, f(upstream_target)) target named downstream_target depends target upstream_target function f(). addition, target's name determines random number generator seed. way, target runs reproducible seed someone else running pipeline get results, two targets pipeline share seed. (Even dynamic branches different names thus different seeds.) can recover seed completed target tar_meta(your_target, seed) run tar_seed_set() result locally recreate target's initial RNG state. command R code run target. pattern Language define branching target. example, pipeline numeric vector targets x y, tar_target(z, x + y, pattern = map(x, y)) implicitly defines branches z compute x[1] + y[1], x[2] + y[2], . See user manual details. 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. Note: repository \"local\" format \"file\" target create single output file. output file uploaded cloud tracked changes exists cloud. local file deleted target runs. iteration Character length 1, name iteration mode target. Choices: \"vector\": branching happens vctrs::vec_slice() aggregation happens vctrs::vec_c(). \"list\", branching happens [[]] aggregation happens list(). \"group\": dplyr::group_by()-like functionality branch subsets non-dynamic data frame. iteration = \"group\", target must dynamic (pattern argument tar_target() must left NULL). target's return value must data frame special tar_group column consecutive integers 1 number groups. integer designates group, branch created collection rows group. See tar_group() function see can create special tar_group column dplyr::group_by(). error Character length 1, target stops throws error. Options: \"stop\": whole pipeline stops throws error. \"continue\": whole pipeline keeps going. \"abridge\": currently running targets keep running, new targets launch . (Visit https://books.ropensci.org/targets/debugging.html learn debug targets using saved workspaces.) \"null\": errored target continues returns NULL. data hash deliberately wrong target date next run pipeline. 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":[]},{"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 , potentially using parallel workers.","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. Subsequent targets can refer name symbolically induce dependency relationship: e.g. tar_target(downstream_target, f(upstream_target)) target named downstream_target depends target upstream_target function f(). addition, target's name determines random number generator seed. way, target runs reproducible seed someone else running pipeline get results, two targets pipeline share seed. (Even dynamic branches different names thus different seeds.) can recover seed completed target tar_meta(your_target, seed) run tar_seed_set() result locally recreate target's initial RNG state. raster SpatRaster object split tiles tile_fun helper function returns list numeric vectors tile_grid 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. 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. \"abridge\": currently running targets keep running, new targets launch . (Visit https://books.ropensci.org/targets/debugging.html learn debug targets using saved workspaces.) \"null\": errored target continues returns NULL. data hash deliberately wrong target date next run pipeline. 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":[]},{"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\"), iteration = targets::tar_option_get(\"iteration\"), 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. Subsequent targets can refer name symbolically induce dependency relationship: e.g. tar_target(downstream_target, f(upstream_target)) target named downstream_target depends target upstream_target function f(). addition, target's name determines random number generator seed. way, target runs reproducible seed someone else running pipeline get results, two targets pipeline share seed. (Even dynamic branches different names thus different seeds.) can recover seed completed target tar_meta(your_target, seed) run tar_seed_set() result locally recreate target's initial RNG state. command R code run target. pattern Language define branching target. example, pipeline numeric vector targets x y, tar_target(z, x + y, pattern = map(x, y)) implicitly defines branches z compute x[1] + y[1], x[2] + y[2], . See user manual details. 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. Note: repository \"local\" format \"file\" target create single output file. output file uploaded cloud tracked changes exists cloud. local file deleted target runs. iteration Character length 1, name iteration mode target. Choices: \"vector\": branching happens vctrs::vec_slice() aggregation happens vctrs::vec_c(). \"list\", branching happens [[]] aggregation happens list(). \"group\": dplyr::group_by()-like functionality branch subsets non-dynamic data frame. iteration = \"group\", target must dynamic (pattern argument tar_target() must left NULL). target's return value must data frame special tar_group column consecutive integers 1 number groups. integer designates group, branch created collection rows group. See tar_group() function see can create special tar_group column dplyr::group_by(). error Character length 1, target stops throws error. Options: \"stop\": whole pipeline stops throws error. \"continue\": whole pipeline keeps going. \"abridge\": currently running targets keep running, new targets launch . (Visit https://books.ropensci.org/targets/debugging.html learn debug targets using saved workspaces.) \"null\": errored target continues returns NULL. data hash deliberately wrong target date next run pipeline. 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":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Create a terra SpatVector target — tar_terra_vect","text":"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)"},{"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 ","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 blocksize (see terra::fileBlocksize()), memory efficient. tile_grid() allows specification number rows columns split raster . E.g. nrow = 2 ncol = 2 create 4 tiles (specifies 2x2 matrix, 4 elements).","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":"https://njtierney.github.io/geotargets/reference/tile_helpers.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Helper functions to create tiles — tile_grid","text":"","code":"f <- system.file(\"ex/elev.tif\", package=\"terra\") r <- terra::rast(f) r_tiles <- tile_grid(r, ncol = 2, nrow = 2) r_tiles #> [[1]] #> xmin xmax ymin ymax #> 5.741667 6.141667 49.816667 50.191667 #> #> [[2]] #> xmin xmax ymin ymax #> 6.133333 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.133333 6.533333 49.441667 49.816667 #>"},{"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":"Created tar_stars() tar_stars_proxy() create stars stars_proxy objects, respectively. Created tar_terra_tiles(), “target factory” splitting raster multiple tiles dynamic branching. Created two helper functions use tar_terra_tiles(): tile_grid() tile_blocksize(). Created utility function set_window() mostly internal use within tar_terra_tiles(). Added description argument tar_*() functions passed tar_target().","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":""}] diff --git a/sitemap.xml b/sitemap.xml index b004d09..521cd6e 100644 --- a/sitemap.xml +++ b/sitemap.xml @@ -6,7 +6,6 @@ https://njtierney.github.io/geotargets/authors.html https://njtierney.github.io/geotargets/index.html https://njtierney.github.io/geotargets/news/index.html -https://njtierney.github.io/geotargets/reference/create_tile_exts.html https://njtierney.github.io/geotargets/reference/geotargets-options.html https://njtierney.github.io/geotargets/reference/geotargets-package.html https://njtierney.github.io/geotargets/reference/index.html @@ -16,5 +15,6 @@ https://njtierney.github.io/geotargets/reference/tar_terra_sprc.html https://njtierney.github.io/geotargets/reference/tar_terra_tiles.html https://njtierney.github.io/geotargets/reference/tar_terra_vect.html +https://njtierney.github.io/geotargets/reference/tile_helpers.html