RomFeature: Feature entity data object

RomFeatureR Documentation

Feature entity data object

Description

Object for storing a single feature with attribute and timeseries related

Details

Has standard methods for managing data and meta data

Value

feature class of type RomFeature

Super class

hydrotools::RomEntity -> RomFeature

Public fields

base_entity_type

kind of entity

pk_name

the name of this entity's pk column

name

of this entity

hydrocode

alpha code for this entity from original dataset

ftype

feature type

hydroid

unique ID (integer)

bundle

main content type, i.e. facility, well, intake, ...

fstatus

entity status

description

notes field

mps

linked features

geom

feature geometry WKT

nextdown_id

feature geometry WKT

parent_id

feature geometry WKT

sql_select_from

syntax to use to select via an odbc or other SQL based datasource

base_only

- how to export to list in case of complex multi table entity and ODBC

Methods

Public methods

Inherited methods

Method new()

Usage
RomFeature$new(datasource = NULL, config, load_remote = FALSE)
Arguments
datasource

RESTful repository object

config

list of attributes to set, see also: to_list() for format

load_remote

automatically query REST dataa source for matches?

Returns

object instance


Method get_id()

Usage
RomFeature$get_id()
Returns

get_id the unique id of this entity alias to remote pkid, subclassed as function


Method load_data()

Usage
RomFeature$load_data(config, load_remote)
Arguments
config
load_remote

automatically query remote data source for matches?

Returns

the data from the remote connection


Method to_list()

Usage
RomFeature$to_list(base_only = FALSE)
Arguments
base_only

include only base table columns (TRUE) or add fields (FALSE)

Returns

list of object attributes suitable for input to new() and from_list() methods


Method from_list()

Usage
RomFeature$from_list(config)
Arguments
config

list of attributes to set, see also: to_list() for format

Returns

NULL


Method get_mps()

Usage
RomFeature$get_mps()
Returns

a dataframe of connected MPs


Method add_mp()

Usage
RomFeature$add_mp(thismp)
Arguments
thismp

mp entity

Returns

add a connected MP. TBD


Method save()

Usage
RomFeature$save(push_remote = FALSE)
Arguments
push_remote

update locally only or push to remote database

Returns

NULL


Method find_spatial_relations()

Usage
RomFeature$find_spatial_relations(
  target_entity = "dh_feature",
  inputs = list(bundle = NA, ftype = NA),
  operator = "st_contains",
  return_geoms = FALSE,
  query_remote = TRUE
)
Arguments
target_entity

what type to relate to (default dh_feature)

inputs

criteria to search for (list key = value format)

operator

what type of spatial function,default = st_contains Other options are 'overlaps' or 'st_within'

return_geoms

FALSE will return a smaller dataframe

query_remote

FALSE will search on in local datasource

Returns

dataframe of spatially related entities


Method clone()

The objects of this class are cloneable with this method.

Usage
RomFeature$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

See Also

NA

Examples

NA

HARPgroup/hydro-tools documentation built on July 4, 2025, 11:05 a.m.