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

Curate a OFE group ID #298

Open
3 tasks done
akrherz opened this issue Nov 22, 2024 · 1 comment
Open
3 tasks done

Curate a OFE group ID #298

akrherz opened this issue Nov 22, 2024 · 1 comment
Assignees
Labels

Comments

@akrherz
Copy link
Member

akrherz commented Nov 22, 2024

@dejames52 and @edulukin have been patiently waiting for me to do some analysis of what they called an uniqueid to classify our DEP OFEs into comparable groups. I'd rather not call this value uniqueid as that implies something it is not. I'll instead call it a groupid and it will be represented by an underscore seperated string of values in the form <slopeclass>_<kwfactclass>_<tillagecode>_<genlandusecode> where

slopeclass is

Bulk slope % class
0 <= x <= 2 1
2 < x <= 4 2
4 < x <= 6 3
6 < x <= 12 4
12 < x 5

kwfactclass is

kwfact class
0 < x <= 0.28 1
0.28 < x <= 0.32 2
0.32 < x 3

tillagecode and genlandusecode are verbatim.

TODO

  • create database storage
  • assign these at import time
  • update current database entries with these
@akrherz akrherz self-assigned this Nov 22, 2024
akrherz added a commit to akrherz/iem-database that referenced this issue Nov 22, 2024
@akrherz
Copy link
Member Author

akrherz commented Nov 22, 2024

The SQL run to update the current entries

update flowpath_ofes o
SET groupid = case when bulk_slope <= 0.02 then 1 when bulk_slope <= 0.04 then 2 when bulk_slope <= 0.06 then 3 when bulk_slope <= 0.12 then 4 else 5 end
||'_'|| case when kwfact <= 0.28 then 1 when kwfact <= 0.32 then 2 else 3 end 
||'_'|| substr(f.management, 1, 1) ||'_'|| l.label
from gssurgo g, fields f, general_landuse l where o.gssurgo_id = g.id
and f.field_id = o.field_id and f.genlu = l.id ;

akrherz added a commit to akrherz/dep that referenced this issue Dec 5, 2024
akrherz added a commit to akrherz/dep that referenced this issue Dec 5, 2024
akrherz added a commit to akrherz/dep that referenced this issue Dec 12, 2024
akrherz added a commit to akrherz/dep that referenced this issue Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant