ExtractFromDAF: DAF File Reader

View source: R/ExtractFromDAF.R

ExtractFromDAFR Documentation

DAF File Reader

Description

Extracts data from DAF Files.

Usage

ExtractFromDAF(
  fileName,
  extract_features = TRUE,
  extract_images = TRUE,
  extract_offsets = TRUE,
  extract_stats = TRUE,
  endianness = .Platform$endian,
  pnt_in_poly_algorithm = 1,
  pnt_in_poly_epsilon = 1e-12,
  display_progress = TRUE,
  ...
)

Arguments

fileName

path to file.

extract_features

whether to extract features (and graphs, pops and regions) from file. Default is TRUE.

extract_images

whether to extract images information from file. Default is TRUE.

extract_offsets

whether to extract IFDs offsets from corresponding. Default is TRUE.
See getOffsets for further details.

extract_stats

whether to extract population statistics. Default is TRUE.

endianness

The endian-ness ("big" or "little") of the target system for the file. Default is .Platform$endian.
Endianness describes the bytes order of data stored within the files. This parameter may not be modified.

pnt_in_poly_algorithm

algorithm used to determine if object belongs to a polygon region or not. Default is 1.
Note that for the moment only 1(Trigonometry) is available.

pnt_in_poly_epsilon

epsilon to determine if object belongs to a polygon region or not. It only applies when algorithm is 1. Default is 1e-12.

display_progress

whether to display a progress bar. Default is TRUE.

...

Other arguments to be passed.

Details

When extract_features is TRUE it allows features, graphs, pops, regions to be extracted.
If extract_features is TRUE, extract_stats will be automatically forced to TRUE.
If extract_stats is TRUE, extract_features will be automatically forced to TRUE.
If extract_offsets is TRUE, extract_images will be automatically forced to TRUE.
If extract_images is TRUE, information about images will be extracted.

Value

A named list of class 'IFC_data', whose members are:
-description, a list of descriptive information,
-fileName, path of fileName input,
-fileName_image, path of .cif image fileName is refering to,
-features, a data.frame of features,
-features_def, a describing how features are defined,
-graphs, a list of graphical elements found,
-pops, a list describing populations found,
-regions, a list describing how regions are defined,
-images, a data.frame describing information about images,
-offsets, an integer vector of images and masks IFDs offsets,
-stats, a data.frame describing populations count and percentage to parent and total population,
-checksum, checksum of .cif image fileName is refering to computed from images values found in current daf.

Source

For pnt_in_poly_algorithm, Trigonometry, is an adaptation of Jeremy VanDerWal's code https://github.com/jjvanderwal/SDMTools

Examples

if(requireNamespace("IFCdata", quietly = TRUE)) {
  ## use a daf file
  file_daf <- system.file("extdata", "example.daf", package = "IFCdata")
  daf <- ExtractFromDAF(fileName = file_daf)
} else {
  message(sprintf('Please run `install.packages("IFCdata", repos = "%s", type = "source")` %s',
                  'https://gitdemont.github.io/IFCdata/',
                  'to install extra files required to run this example.'))
}

IFC documentation built on Sept. 14, 2023, 1:08 a.m.