Skip to contents

Takes a list as returned by get_idaifield_docs(), idf_query(), idf_index_query(), or idf_json_query() and transforms it into a flatter, more R-friendly structure.

Usage

simplify_idaifield(
  resources,
  index = NULL,
  config = NULL,
  keep_geometry = FALSE,
  find_layers = FALSE,
  silent = FALSE,
  ...
)

Arguments

resources

An idaifield_docs or idaifield_resources list as returned by get_idaifield_docs(), idf_query(), idf_index_query(), or idf_json_query().

index

A data.frame as returned by make_index() or get_field_index(). Required for UUID replacement and layer detection.

config

An idaifield_config object as returned by get_configuration(). Required when find_layers = TRUE.

keep_geometry

logical. Should geometry be kept as a GeoJSON string? Default is TRUE.

find_layers

logical. Should the containing layer be detected and added as relation.liesWithinLayer? Default is TRUE.

silent

logical. Should messages be suppressed? Default is FALSE.

...

sink for deprecated params

Value

An idaifield_simple list with the same resources in a flatter format, with connection, projectname stored as attributes.

Details

Relations are flattened into named vectors with a relation.-prefix (e.g. relation.liesWithin). UUIDs in relations are replaced with human-readable identifiers. Geometry is kept as a GeoJSON string if keep_geometry = TRUE.

Note: If you are working with a subset of resources (e.g. from idf_query()), you should supply the index of the complete project database, not just the subset — otherwise UUID replacement will be incomplete.

See also

Examples

if (FALSE) { # \dontrun{
conn <- connect_idaifield(serverip = "localhost", project = "rtest", pwd = "hallo")
docs <- get_idaifield_docs(connection = conn)
simple <- simplify_idaifield(docs)
} # }