Simplify a List Imported from an iDAI.field / Field Desktop Database
Source:R/simplify_idaifield_resources.R
simplify_idaifield.RdTakes 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_docsoridaifield_resourceslist as returned byget_idaifield_docs(),idf_query(),idf_index_query(), oridf_json_query().- index
A data.frame as returned by
make_index()orget_field_index(). Required for UUID replacement and layer detection.- config
An
idaifield_configobject as returned byget_configuration(). Required whenfind_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
get_idaifield_docs()to import resources from the databasemake_index()andget_field_index()for building an indexget_configuration()for the project configurationfix_relations()for relation flatteningfind_layer()for layer detectionidaifield_as_matrix()for converting the result to a matrix
Examples
if (FALSE) { # \dontrun{
conn <- connect_idaifield(serverip = "localhost", project = "rtest", pwd = "hallo")
docs <- get_idaifield_docs(connection = conn)
simple <- simplify_idaifield(docs)
} # }