Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create function to parse new WQX 3.0 JSON array for friendlier user display of values on figs/maps/UI #463

Open
6 tasks
cristinamullin opened this issue May 24, 2024 · 1 comment
Assignees
Labels
Future Improvement Minimum viable function complete, issue includes potential future improvements

Comments

@cristinamullin
Copy link
Collaborator

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).

@cristinamullin
Copy link
Collaborator Author

The WQP team has finalized the JSON array format to be:

["MD819747","EPABEACH"]
["USGS","LEAD_OBOD"]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Future Improvement Minimum viable function complete, issue includes potential future improvements
Projects
None yet
Development

No branches or pull requests

2 participants