Create function to parse new WQX 3.0 JSON array for friendlier user display of values on figs/maps/UI #463
Labels
Future Improvement
Minimum viable function complete, issue includes potential future improvements
Is your feature request related to a problem? Please describe.
WQX 3.0 will be delivering all 1-to-many results as JSON arrays. In general, these are machine readable but not very user friendly. In TADA, we may want/need to develop a more human readable/friendly way to display these results in maps, figures, and the TADA shiny app.
See examples:
['NAWQA - National Water-Quality Assessment', '32UFDQNOO']
['USGS', 'UT230000']
["302"]
["Lakes","RLSWQD","Small Lakes"]
['USGS', 'LEAD_OBOD']
["NTID","NTWQM","MDDNR","WATERQUALITY","BAY774"]
Note that ['USGS', 'LEAD_OBOD'] has a comma AND a space in between while ["NTID","NTWQM","MDDNR","WATERQUALITY","BAY774"] only has a comma with no space.
The WQP team still needs to finalize the formatting.
Describe the solution you'd like
Create new TADA package function in Utilities.R to parse these out for user friendly display in figures, maps, etc.
The WQP team is still working out kinks so it is not clear yet which of the above conventions will be used (" vs. ') and space vs no space.
Once the profiles are finalized, we can create this new TADA package function in Utilities.R to parse these out for user friendly display in figures, maps, etc.
In addition, TADA_FindNearbySites generates a TADA_MonitoringLocationID column which includes a JSON array as the new monitoring location ID for paired sites. This TADA function should be updates as well to be consistent with the WQX 3.0 JSON arrays once finalized. The new TADA function above could then be leveraged for displaying the sites on the Site Review map (currently in development by @renaemyers).
Describe alternatives you've considered
Maybe this utility function for parsing the JSON arrays out for user friendly display in figures, maps, etc. is not necessary. Open to ideas.
Reminders for TADA contributors addressing this issue
New features should include all of the following work:
Create the function/code.
Document all code using comments to describe what is does.
Create tests in tests folder.
Create help file using roxygen2 above code.
Create working examples in help file (via roxygen2).
Add to appropriate vignette (or create new one).
The text was updated successfully, but these errors were encountered: