Create an ATTAINS AU–ML Crosswalk from WQP Monitoring Location IDs for New Point AUs
Source:R/ATTAINSCrosswalks.R
TADA_CreatePointAUs.RdBuild a distinct crosswalk between WQP Monitoring Locations and ATTAINS
Assessment Units. Missing or blank ATTAINS.AssessmentUnitIdentifier values
are filled from TADA.MonitoringLocationIdentifier, optionally prefixed
with auid_prefix. Existing non-missing, non-blank AUIDs are left unchanged.
Optionally, this function can also return either a df or a shp file containing
the point or multipoint geometry and its corresponding assessment unit identifier.
Arguments
- .data
A data frame containing, at minimum:
TADA.MonitoringLocationIdentifier
If
create_geo = TRUE, the input must also contain:TADA.LatitudeMeasureTADA.LongitudeMeasureHorizontalCoordinateReferenceSystemDatumName
If missing water-type values need to be crosswalked, the input must also contain:
TADA.MonitoringLocationTypeName
Optional columns:
ATTAINS.AssessmentUnitIdentifierATTAINS.WaterType
- auid_prefix
Character or
NULL. If provided and non-empty, this prefix is added only to newly createdATTAINS.AssessmentUnitIdentifiervalues.- create_geo
Logical. If
TRUE, also create point geometry usingTADA_CreatePointAUGeometry().- download_geo
Logical. If
TRUE, write the geometry shapefile to the user's downloads folder.
Value
If create_geo = FALSE, a distinct crosswalk data frame containing:
ATTAINS.MonitoringLocationIdentifierATTAINS.AssessmentUnitIdentifierATTAINS.WaterType
If create_geo = TRUE, a named list with:
crosswalkgeometry
Details
If ATTAINS.WaterType is missing or contains any blank values, the function
attempts to populate it by calling TADA_UpdateATTAINSWaterTypes()
internally with overwrite_existing = FALSE and validation = "none".
Missing or blank
ATTAINS.AssessmentUnitIdentifiervalues are replaced withTADA.MonitoringLocationIdentifier.If
auid_prefixis supplied and non-empty, it is used only for newly created AUIDs.ATTAINS.MonitoringLocationIdentifieris created fromTADA.MonitoringLocationIdentifier.ATTAINS.WaterTypeis not overwritten unless it is missing or blank.