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

How to handle different water rights amount search cases? #101

Open
amabdallah opened this issue May 19, 2022 · 4 comments
Open

How to handle different water rights amount search cases? #101

amabdallah opened this issue May 19, 2022 · 4 comments
Labels
WestDAAT Improvement Idea to improve WestDAAT.

Comments

@amabdallah
Copy link
Contributor

amabdallah commented May 19, 2022

We decided to design the flow and volume range filters to be simplisitic. In reality, there are many complex cases that we need the filters to handle as summarized in this table. We need to see how to support handling the AND OR cases

Use case: show me water rights that have a flow of more than 5 CFS or a volume of more than 7,000 AF. I think the current implementation handles the AND case, not the OR. What if the user wants to limit the search to the AND case?

Case Flow Volume
case 1 value value
case 2 value null
case 3 null value
case 4 null null
case 5 0 0
case 6 value 0
case 7 0 value

Notes

  1. Case 4 is for exempt water rights
  2. Zero is a value but there is a chance the state added zero instead of null. We need to revisit the mapping of our data and probably reach out to the states to revise how we handle this null/zero issue.
  3. Are there other cases out there?

SQL Query
This basic SQL query is a starting point to see the distribution of CFS and AF types of values across states

SELECT [AllocationFlow_CFS],
      [AllocationVolume_AF]
      
  FROM [Core].[AllocationAmounts_fact]

image

@rwjam
Copy link
Member

rwjam commented May 20, 2022

Good comment on should these two filters work on an AND, OR, or both query? This might be an issue of not tracking how, and the why, the states track water right data as either CFS or AF, or even both.

Use cases that 'might' pop up in the future in the event somebody is searching for water rights...

  1. Show me water rights that have > 5 CFS & > 100 AF.
  2. Show me water rights that have > 5 CFS or > 100 AF.

Wonder if it's possible to add a AND / OR button between these two filters?

image

@amabdallah
Copy link
Contributor Author

Related to this issue, do the states provide the Volume of Flow value as "unknown," or is this introduced in the data mapping or importing? If the state does not provide the value, we need to keep it blank in our database. The "unknown" value might affect this WestDAAT filter as it compares numeric values logically. Rights with "unknown" values might be excluded because of this issuue.

https://westdaat.westernstateswater.org/details/right/WYwr_WR10573?state=N4IgtgziBcIQhgFwKYBtUEsUFoBuBOEAGnHgAcZQAvAexrABllc0YBGABhNSSwFcAJshgAWAEwA6AMwAOfFIBsHZSuVtuNAHYBzfkJjZOCiWLZsZU1arEBfG0A
image

@amabdallah amabdallah added the WestDAAT Improvement Idea to improve WestDAAT. label Oct 5, 2022
@amabdallah
Copy link
Contributor Author

Here is the WestDAAT code that has the min and max values for flow and volume. I'm not sure if there is an AND or even OR clause between these filters. It could be the "unknown" issue that is causing that behavior.

<label>Flow Range (CFS)</label>

@amabdallah
Copy link
Contributor Author

In another example in Utah, the Assigned Volume (AF) value is "0"
Question, did Utah provide the 0 or was it introduced in the mapping/importing of data? Zero has meaning here that is different than blank. Blank could mean the value is unquantified which is okay but zero is problematic which means the owner ha a right but they cannot use any water. Let's come up with a consistent way of handing these values across our states.

https://westdaat.westernstateswater.org/details/right/UTwr_WR110242?state=N4IgtgziBcIQhgFwKYBtUEsUFoBuBOEAGnHgAcZQAvAexrABllc0YBGAVgDoBmAdj74AbAA4RPHmyHSALDJKokWAK4ATZDBkAGLnzYAmfGxF62fDlqH4FNAHYBzFepjY2Brmy36vQ-jJFCHDwAvsFAA

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WestDAAT Improvement Idea to improve WestDAAT.
Projects
None yet
Development

No branches or pull requests

2 participants