Stable lifecycle

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("gep_fs")
#> Warning: data set ‘gep_fs’ not found
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) dplyr::glimpse(geo_gj_parsed)
#> Rows: 2 #> Columns: 34 #> $ id <chr> "uuid:38e5a3a9-f037-4e32-8cda-9… #> $ device_id <chr> "sandbox.central.getodk.org:80G… #> $ start_time <chr> "2020-08-16T15:28:09.092+08:00"… #> $ username <chr> "username not found", NA #> $ subscriber_id <chr> "subscriberid not found", "5050… #> $ end_time <chr> "2020-08-16T15:28:38.821+08:00"… #> $ system_submission_date <chr> "2020-08-16T07:28:39.190Z", "20… #> $ system_submitter_id <chr> "1094", "241" #> $ system_submitter_name <chr> "test-location", "flora" #> $ system_attachments_present <int> 0, 0 #> $ system_attachments_expected <int> 0, 0 #> $ meta_instance_id <chr> "uuid:38e5a3a9-f037-4e32-8cda-9… #> $ point_location_point_gps_longitude <dbl> 115.7783, 115.8844 #> $ point_location_point_gps_latitude <dbl> -32.05900, -31.99606 #> $ point_location_point_gps_altitude <int> 0, -16 #> $ point_location_point_gps_accuracy <dbl> 0.000, 4.288 #> $ point_location_point_gps <list> [["Point", [115.7783, -32.059,… #> $ point_location_point_map_longitude <dbl> 115.7820, 115.8846 #> $ point_location_point_map_latitude <dbl> -32.05784, -31.99611 #> $ point_location_point_map_altitude <int> 0, -15 #> $ point_location_point_map_accuracy <dbl> 0.000, 4.288 #> $ point_location_point_map <list> [["Point", [115.782, -32.05784… #> $ point_location_point_manual_longitude <dbl> 115.7826, 115.8846 #> $ point_location_point_manual_latitude <dbl> -32.05860, -31.99612 #> $ point_location_point_manual_altitude <int> 0, -21 #> $ point_location_point_manual_accuracy <dbl> 0.000, 4.288 #> $ point_location_point_manual <list> [["Point", [115.7826, -32.0586… #> $ path_location_path_gps <list> [["LineString", [[115.7758, -3… #> $ path_location_path_map <list> [["LineString", [[115.7834, -3… #> $ path_location_path_manual <list> [["LineString", [[115.774, -32… #> $ shape_location_shape_gps <list> [["Polygon", [[115.7742, -32.0… #> $ shape_location_shape_map <list> [["Polygon", [[115.7743, -32.0… #> $ shape_location_shape_manual <list> [["Polygon", [[115.7741, -32.0… #> $ odata_context <chr> "https://sandbox.central.getodk…
# 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: 2 #> Columns: 31 #> $ id <chr> "uuid:38e5a3a9-f037-4e32-8cda-9… #> $ device_id <chr> "sandbox.central.getodk.org:80G… #> $ start_time <chr> "2020-08-16T15:28:09.092+08:00"… #> $ username <chr> "username not found", NA #> $ subscriber_id <chr> "subscriberid not found", "5050… #> $ end_time <chr> "2020-08-16T15:28:38.821+08:00"… #> $ system_submission_date <chr> "2020-08-16T07:28:39.190Z", "20… #> $ system_submitter_id <chr> "1094", "241" #> $ system_submitter_name <chr> "test-location", "flora" #> $ system_attachments_present <int> 0, 0 #> $ system_attachments_expected <int> 0, 0 #> $ meta_instance_id <chr> "uuid:38e5a3a9-f037-4e32-8cda-9… #> $ point_location_point_gps <chr> "POINT (115.778298 -32.059001 0… #> $ point_location_point_gps_longitude <dbl> 115.7783, 115.8844 #> $ point_location_point_gps_latitude <dbl> -32.05900, -31.99606 #> $ point_location_point_gps_altitude <int> 0, -16 #> $ point_location_point_map <chr> "POINT (115.782034 -32.057838 0… #> $ point_location_point_map_longitude <dbl> 115.7820, 115.8846 #> $ point_location_point_map_latitude <dbl> -32.05784, -31.99611 #> $ point_location_point_map_altitude <int> 0, -15 #> $ point_location_point_manual <chr> "POINT (115.782592 -32.058601 0… #> $ point_location_point_manual_longitude <dbl> 115.7826, 115.8846 #> $ point_location_point_manual_latitude <dbl> -32.05860, -31.99612 #> $ point_location_point_manual_altitude <int> 0, -21 #> $ path_location_path_gps <chr> "LINESTRING (115.775764 -32.058… #> $ path_location_path_map <chr> "LINESTRING (115.783408 -32.056… #> $ path_location_path_manual <chr> "LINESTRING (115.774004 -32.058… #> $ shape_location_shape_gps <chr> "POLYGON ((115.774218 -32.05833… #> $ shape_location_shape_map <chr> "POLYGON ((115.774304 -32.06079… #> $ shape_location_shape_manual <chr> "POLYGON ((115.774133 -32.05699… #> $ odata_context <chr> "https://sandbox.central.getodk…