[Stable]

handle_ru_geopoints(data, form_schema, wkt = FALSE, 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

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.

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 geopoints retained in their original format, plus columns of their coordinate components as provided by split_geopoint.

Details

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

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

See also

Examples

library(magrittr) data("geo_fs") data("geo_gj_raw") data("geo_wkt_raw") # GeoJSON geo_gj_parsed <- geo_gj_raw %>% ruODK::odata_submission_rectangle(form_schema = geo_fs) %>% ruODK::handle_ru_geopoints(form_schema = geo_fs, wkt = FALSE)
#> Warning: running command 'timedatectl' had status 1
dplyr::glimpse(geo_gj_parsed)
#> Rows: 1 #> Columns: 32 #> $ id <chr> "uuid:4e0d1766-9256-40e0-9556-3e… #> $ device_id <chr> "5afb51f35ba0c572" #> $ start_time <chr> "2020-11-02T12:16:02.834+08:00" #> $ end_time <chr> "2020-11-02T12:20:46.635+08:00" #> $ system_submission_date <chr> "2020-11-02T04:36:11.126Z" #> $ system_submitter_id <chr> "53" #> $ system_submitter_name <chr> "ruODK" #> $ system_attachments_present <int> 0 #> $ system_attachments_expected <int> 0 #> $ meta_instance_id <chr> "uuid:4e0d1766-9256-40e0-9556-3e… #> $ point_location_point_gps_longitude <dbl> 115.8844 #> $ point_location_point_gps_latitude <dbl> -31.99607 #> $ point_location_point_gps_altitude <dbl> -25.00354 #> $ point_location_point_gps_accuracy <dbl> 6.531 #> $ point_location_point_gps <list> ["Point", [115.8844, -31.99607, … #> $ point_location_point_map_longitude <dbl> 115.8844 #> $ point_location_point_map_latitude <dbl> -31.99607 #> $ point_location_point_map_altitude <dbl> -24.7084 #> $ point_location_point_map_accuracy <dbl> 4.282 #> $ point_location_point_map <list> ["Point", [115.8844, -31.99607, … #> $ point_location_point_manual_longitude <dbl> 115.8841 #> $ point_location_point_manual_latitude <dbl> -31.99486 #> $ point_location_point_manual_altitude <int> 0 #> $ point_location_point_manual_accuracy <int> 0 #> $ point_location_point_manual <list> ["Point", [115.8841, -31.99486, … #> $ path_location_path_gps <list> ["LineString", [[115.8844, -31.9… #> $ path_location_path_map <list> ["LineString", [[115.8843, -31.9… #> $ path_location_path_manual <list> ["LineString", [[115.8845, -31.9… #> $ shape_location_shape_gps <list> ["Polygon", [[115.8835, -31.9969… #> $ shape_location_shape_map <list> ["Polygon", [[115.8843, -31.9958… #> $ shape_location_shape_manual <list> ["Polygon", [[115.8829, -31.9951… #> $ odata_context <chr> "https://odkc.dbca.wa.gov.au/v1/…
# WKT geo_wkt_parsed <- geo_wkt_raw %>% ruODK::odata_submission_rectangle(form_schema = geo_fs) %>% ruODK::handle_ru_geopoints(form_schema = geo_fs, wkt = TRUE) dplyr::glimpse(geo_wkt_parsed)
#> Rows: 1 #> Columns: 29 #> $ id <chr> "uuid:4e0d1766-9256-40e0-9556-3e… #> $ device_id <chr> "5afb51f35ba0c572" #> $ start_time <chr> "2020-11-02T12:16:02.834+08:00" #> $ end_time <chr> "2020-11-02T12:20:46.635+08:00" #> $ system_submission_date <chr> "2020-11-02T04:36:11.126Z" #> $ system_submitter_id <chr> "53" #> $ system_submitter_name <chr> "ruODK" #> $ system_attachments_present <int> 0 #> $ system_attachments_expected <int> 0 #> $ meta_instance_id <chr> "uuid:4e0d1766-9256-40e0-9556-3e… #> $ point_location_point_gps <chr> "POINT (115.8844106 -31.9960723 … #> $ point_location_point_gps_longitude <dbl> 115.8844 #> $ point_location_point_gps_latitude <dbl> -31.99607 #> $ point_location_point_gps_altitude <dbl> -25.00354 #> $ point_location_point_map <chr> "POINT (115.884409 -31.9960719 -… #> $ point_location_point_map_longitude <dbl> 115.8844 #> $ point_location_point_map_latitude <dbl> -31.99607 #> $ point_location_point_map_altitude <dbl> -24.7084 #> $ point_location_point_manual <chr> "POINT (115.88407304137944 -31.9… #> $ point_location_point_manual_longitude <dbl> 115.8841 #> $ point_location_point_manual_latitude <dbl> -31.99486 #> $ point_location_point_manual_altitude <int> 0 #> $ path_location_path_gps <chr> "LINESTRING (115.8843747 -31.995… #> $ path_location_path_map <chr> "LINESTRING (115.8843333 -31.995… #> $ path_location_path_manual <chr> "LINESTRING (115.8845327 -31.995… #> $ shape_location_shape_gps <chr> "POLYGON ((115.88354263454677 -3… #> $ shape_location_shape_map <chr> "POLYGON ((115.8843246 -31.99587… #> $ shape_location_shape_manual <chr> "POLYGON ((115.88291566818953 -3… #> $ odata_context <chr> "https://odkc.dbca.wa.gov.au/v1/…