Stable lifecycle

handle_ru_geotraces(
  data,
  form_schema,
  wkt = FALSE,
  odkc_version = get_default_odkc_version(),
  verbose = get_ru_verbose()
)

Arguments

data

Submissions rectangled into a tibble. E.g. the output of ``` ruODK::odata_submission_get(parse = FALSE) ruODK::odata_submission_rectangle(form_schema = ...) ```

form_schema

The `form_schema` for the submissions. E.g. the output of `ruODK::form_schema()`.

wkt

Whether geofields are GeoJSON (if FALSE) or WKT strings (if TRUE), default: FALSE.

odkc_version

The ODK Central version as decimal number (major.minor). `ruODK` uses this parameter to adjust for breaking changes in ODK Central. Default: get_default_odkc_version or 0.8 if unset. Set default get_default_odkc_version through ru_setup(odkc_version=0.8). See vignette("Setup", package = "ruODK").

verbose

Whether to display debug messages or not. Read `vignette("setup", package = "ruODK")` to learn how `ruODK`'s verbosity can be set globally or per function.

Value

The submissions tibble with all geotraces retained in their original format, plus columns of their first point's coordinate components as provided by split_geotrace.

Details

For a given tibble of submissions, find all columns which are listed in the form schema as type geotrace, and extract their components. Extracted components are longitude (X), latitude (Y), altitude (Z, where given), and accuracy (M, where given) of the first point of the geotrace.

The original column is retained to allow parsing into other spatially enabled formats.

See also

Examples

if (FALSE) { library(magrittr) data("gep_fs") data("geo_wkt_raw") data("geo_gj_raw") # GeoJSON geo_gj_parsed <- geo_gj_raw %>% ruODK::odata_submission_rectangle(form_schema = geo_fs) %>% ruODK::handle_ru_geotraces(form_schema = geo_fs, wkt = FALSE) dplyr::glimpse(geo_gj_parsed) # WKT geo_wkt_parsed <- geo_wkt_raw %>% ruODK::odata_submission_rectangle(form_schema = geo_fs) %>% ruODK::handle_ru_geotraces(form_schema = geo_fs, wkt = TRUE) dplyr::glimpse(geo_wkt_parsed) }