soilDB icon indicating copy to clipboard operation
soilDB copied to clipboard

multiple RV parent material groups results in duplicate coiids via fetchNASIS_components

Open brownag opened this issue 7 years ago • 1 comments

Multiple parent material groups marked as RV results in a duplication of component records when joining to the pmgroup view. Currently, the many:one flattening assumes that the component's RV PM group is the lone value one would like to portray.

Need to add extra checks for anything that uses RV record to "flatten" a many:one relationship. I can't think of any legitimate case where multiple RVs are necessary (usually a data entry error), but regardless of their legitimacy, they will always result in a duplication on a join where the constraint is rvindicator==1.

See also: same problem only for component horizon texture group #32

Here are a few sample component IDs with this problem from MLRA22A:


> c <- get_component_data_from_NASIS_db()
-> QC: duplicate coiids, this should not happen. Use `get('dupe.coiids', envir=soilDB.env)` for related coiid values.
> get('dupe.coiids', envir=soilDB.env)
 [1] "641142"  "641696"  "666282"  "666331"  "917492"  "1154299" "1154376" "1269515" "1271600" "1692214"

brownag avatar Feb 13 '18 22:02 brownag

From the NASIS documentation for Component Parent Material Group table description (emphasis added)

The Component Parent Material Group table lists the range of parent materials in which this component formed when mapped in this mapunit. For example, a component formed in one parent material, such as loess, or one vertical sequence of parent materials, such as loamy glacial drift over silty residuum weathered from shale, has one row in this table. A component formed in one parent material in some delineations of this data mapunit, but another parent material (or sequence of parent materials) in other delineations has two rows in this table, one for each parent material (or sequence of parent materials). One row is identified as the representative parent material.

brownag avatar Feb 13 '18 23:02 brownag

The presence of multiple RV values in parent material group no longer duplicates component records in fetchNASIS() result. The values are concatenated together to create composite pmkind and pmorigin

So for example Waca component in CA719 (COIID 641696) has pmkind "mudflow deposits & residuum" and pmorigin "andesite & tuff, acidic"

brownag avatar Apr 28 '23 23:04 brownag