ncss-tech / SoilKnowledgeBase

Unified descriptions and structures for USDA-NRCS / National Cooperative Soil Survey / Soil and Plant Science Division standards.
https://ncss-tech.github.io/SoilKnowledgeBase/
7 stars 1 forks source link

[OSD] Standard phrasing and order for drainage class in JSON output #74

Closed brownag closed 8 months ago

brownag commented 8 months ago

Many series range across several drainage classes and this is rather unwieldy if you are trying to do any sort of operations on this free-form text.

Currently the unique values included in the drainage column (parsed from Drainage and Permeability) include

 [1] "somewhat poorly"                         "moderately well"                        
 [3] "well"                                    NA                                       
 [5] "excessively"                             "poorly"                                 
 [7] "somewhat excessively or well"            "very poorly"                            
 [9] "somewhat excessively"                    "well and moderately well"               
[11] "well to somewhat excessively"            "well to moderately well"                
[13] "poorly and very poorly"                  "poorly or very poorly"                  
[15] "poorly to somewhat poorly"               "moderately well to somewhat poorly"     
[17] "moderately well and somewhat poorly"     "somewhat poorly to moderately well"     
[19] "somewhat poorly and moderately well"     "very poorly and poorly"                 
[21] "well or moderately well"                 "moderately well or somewhat poorly"     
[23] "poorly to very poorly"                   "somewhat poorly and poorly"             
[25] "excessively to somewhat excessively"     "excessively or somewhat excessively"    
[27] "very poorly or poorly"                   "somewhat excessively or excessively"    
[29] "poorly or somewhat poorly"               "well to excessively"                    
[31] "somewhat poorly to poorly"               "well or somewhat excessively"           
[33] "somewhat excessively and excessively"    "moderately well and well"               
[35] "poorly and somewhat poorly"              "excessively and somewhat excessively"   
[37] "well and somewhat excessively"           "moderately well or well"                
[39] "moderately well or somewhat excessively" "somewhat poorly or moderately well"     
[41] "somewhat poorly or poorly"               "well or excessively"                    
[43] "very poorly to poorly"                   "somewhat excessively to well"           
[45] "somewhat excessively and well"           "somewhat excessively to excessively"    
[47] "well or well"                            "moderately well to somewhat excessively"
[49] "moderately well to well"                 "very poorly or very poorly"             
[51] "excessively to well"   

The drainage_overview is parsed from the "overview" section at the head of each OSD. This does not always match the Drainage and Permeability section in phrasing or concept. Add an error reporting section to properly check this after "cleaning"

 [1] "somewhat poorly"                         "moderately well"                        
 [3] "well"                                    "excessively"                            
 [5] NA                                        "poorly"                                 
 [7] "very poorly"                             "somewhat excessively"                   
 [9] "well and moderately well"                "well to somewhat excessively"           
[11] "excessively and somewhat excessively"    "well to moderately well"                
[13] "poorly and very poorly"                  "poorly or very poorly"                  
[15] "poorly to somewhat poorly"               "moderately well to somewhat poorly"     
[17] "moderately well or somewhat poorly"      "somewhat poorly to moderately well"     
[19] "somewhat poorly and moderately well"     "very poorly and poorly"                 
[21] "well to excessively"                     "well or moderately well"                
[23] "somewhat excessively to moderately well" "somewhat poorly or poorly"              
[25] "excessively to somewhat excessively"     "excessively or somewhat excessively"    
[27] "somewhat poorly and poorly"              "very poorly or poorly"                  
[29] "somewhat excessively or excessively"     "somewhat excessively and excessively"   
[31] "poorly or somewhat poorly"               "well or somewhat excessively"           
[33] "moderately well and well"                "poorly and somewhat poorly"             
[35] "well and somewhat excessively"           "moderately well and somewhat poorly"    
[37] "moderately well or well"                 "moderately well or somewhat excessively"
[39] "somewhat poorly or moderately well"      "poorly to very poorly"                  
[41] "well or excessively"                     "somewhat poorly to poorly"              
[43] "somewhat excessively to well"            "moderately well to somewhat excessively"
[45] "somewhat excessively and well"           "somewhat excessively to excessively"    
[47] "excessively and well"                    "moderately well to well"                
[49] "somewhat excessively or well"            "excessively to well"                    
[51] "well and somewhat poorly"                "very poorly to poorly" 
brownag commented 8 months ago

It is likely a few generic helper functions could be developed to apply this type of process to other fields. Effervescence class would be a good example of a similar problem.

brownag commented 8 months ago

I also noticed that "subaqueous" class is never parsed properly even though it is in the class list. The approach used in the original code does not adequately cover this case. There are at least 46 series that have subaqueous in Drainage and Permeability section, but none of them parse as such

brownag commented 8 months ago

OK. Subaqueous fixed n=69 series)

SERIES DRAINAGE.AND.PERMEABILITY
567 ANGUILLA DRAINAGE AND SATURATED HYDRAULIC CONDUCTIVITY: Drainage class--Subaqueous Saturated hydraulic conductivity--High to very high Soil moisture regime--Peraquic Soil is continuously inundated by saline and brackish water.
673 AQUAPAUG DRAINAGE AND SATURATED HYDRAULIC CONDUCTIVITY: Subaqueous soil, peraquic soil moisture regime, moderately high or high saturated hydraulic conductivity due to soil texture. The soil is permanently submerged with water.
1112 BAFFIN DRAINAGE AND PERMEABILITY: Subaqueous. These soils are permanently submerged with sea water.
1863 BILLINGTON DRAINAGE AND SATURATED HYDRAULIC CONDUCTIVITY: Drainage class--Subaqueous Saturated hydraulic conductivity--Moderately high or high Soil moisture regime--Peraquic Soil is continuously inundated with salt or brackish water.
2617 BROAD CREEK DRAINAGE AND SATURATED HYDRAULIC CONDUCTIVITY: Drainage Class: Subaqueous drainage Saturated Hydraulic Conductivity: Moderately high to high Soil Moisture Regime: Peraquic Broad Creek soils are permanently submerged / continuously inundated with salt or brackish water. The presence of hypersulfidic materials within 50 cm of the soil surface puts these soils at risk for potential acid sulfate soil formation if they are dredged and exposed to the air.
2908 BURLINGAME DRAINAGE AND SATURATED HYDRAULIC CONDUCTIVITY: Subaqueous soil, peraquic soil moisture regime, moderately high or high saturated hydraulic conductivity due to soil texture. The soil is permanently submerged with water.
4198 COARDS DRAINAGE AND SATURATED HYDRAULIC CONDUCTIVITY: Drainage Class: Subaqueous (permanently submersed) Saturated Hydraulic Conductivity: Low to moderately low Soil is permanently submerged with salt or brackish water. The presence of sulfidic material within 50 cm of the soil surface puts these soils at risk for acid sulfate drainage if they are dredged and exposed to the air.
4437 CONTEES WHARF DRAINAGE AND SATURATED HYDRAULIC CONDUCTIVITY: Drainage Class: Subaqueous drainage Saturated Hydraulic Conductivity: Low to moderately low Soil Moisture Regime: Peraquic Soil is permanently submerged / continuously inundated with brackish water. The presence of hypo-sulfidic materials within 50 cm of the soil surface puts these soils at risk for potential acid sulfate soil formation if they are dredged and exposed to the air.
4601 COTTMAN DRAINAGE AND SATURATED HYDRAULIC CONDUCTIVITY: Drainage Class: Subaqueous (permanently submerged) Saturated Hydraulic Conductivity: Moderately low to moderately high
5351 DEMAS DRAINAGE AND PERMEABILITY: Agricultural Drainage Class: Subaqueous (permanently submersed) Permeability: Moderately rapid or rapid Saturated Hydraulic Conductivity Class: Moderately high to high Shrink-Swell Potential: Low
5985 DUTCHMAN POINT DRAINAGE AND SATURATED HYDRAULIC CONDUCTIVITY: Drainage Class: Subaqueous and peraquic soil moisture regime Saturated Hydraulic Conductivity: Moderately high to high and low to very low in the lithologic discontinuity Soil is permanently submerged / continuously inundated with brackish water. These soils have potential to have sulfidic materials within the soil profile putting these soils at risk for potential acid sulfate soil formation if they are dredged and exposed to the air.
5989 DUVALL CREEK DRAINAGE AND SATURATED HYDRAULIC CONDUCTIVITY: Drainage Class: Subaqueous drainage Saturated Hydraulic Conductivity: High to very high Soil Moisture Regime: Peraquic Soil is permanently submerged / continuously inundated with brackish water. The presence of hypersulfidic materials within 50 cm of the soil surface puts these soils at risk for potential acid sulfate soil formation if they are dredged and exposed to the air.
6866 FIGGS DRAINAGE AND SATURATED HYDRAULIC CONDUCTIVITY: Drainage Class: Subaqueous drainage and peraquic soil moisture regime. Saturated Hydraulic Conductivity: Low to moderately high Soil is permanently submerged with salt or brackish water. The presence of sulfidic material within 50 cm of the soil surface puts these soils at risk for acid sulfate drainage if they are dredged and exposed to the air.
7132 FORT NECK DRAINAGE AND SATURATED HYDRAULIC CONDUCTIVITY: Drainage class--Subaqueous Saturated hydraulic conductivity--Moderately high to very high Soil moisture regime--Peraquic Soil is continuously inundated by saline and brackish water
8076 GREAT BAY DRAINAGE AND SATURATED HYDRAULIC CONDUCTIVITY: Subaqueous drainage class, peraquic moisture regime, and low or very low saturated hydraulic conductivity. The soil is continuously inundated with salt or brackish water.
8906 HERRING CREEK DRAINAGE AND PERMEABILITY: Agricultural Drainage Class: Subaqueous (permanently submersed) Saturated Hydraulic Conductivity: Moderately low or low Permeability (obsolete): Moderately slow or slow
9033 HILLSMERE DRAINAGE AND SATURATED HYDRAULIC CONDUCTIVITY: Drainage Class: Subaqueous drainage Saturated Hydraulic Conductivity: Moderately high to high Soil Moisture Regime: Peraquic Soil is permanently submerged / continuously inundated with brackish water. The presence of hyper-sulfidic materials within 50 cm of the soil surface puts these soils at risk for potential acid sulfate soil formation if they are dredged and exposed to the air.
9593 INDIAN RIVER DRAINAGE AND PERMEABILITY: Agricultural Drainage Class: Subaqueous (permanently submersed) Permeability: Moderately rapid or rapid Saturated Hydraulic Conductivity Class: Moderately high to high Shrink-Swell Potential: Low
11842 LONGPOINT DRAINAGE AND SATURATED HYDRAULIC CONDUCTIVITY: Drainage Class: Subaqueous drainage Saturated Hydraulic Conductivity: High to very high in estuarine deposits, Moderately high to very high in pre-Holocene fluviomarine deposits Soil Moisture Regime: Peraquic Soil is permanently submerged / continuously inundated with brackish water. The presence of hypersulfidic materials within 50 cm of the soil surface puts these soils at severe risk for potential acid sulfate soil formation if they are dredged and exposed to the air.
12358 MANTOLOKING DRAINAGE AND SATURATED HYDRAULIC CONDUCTIVITY: Drainage Class: Subaqueous drainage Saturated Hydraulic Conductivity: High to very high Internal free water occurrence class: Very shallow 0 to 10 inches (0 to 25 cm) and permanently submerged Flooding Frequency and Duration: Very frequent and very long as these soils are permanently submerged or exposed only during spring low tides Ponding Frequency and Duration: None Index Surface Runoff: Negligible
12491 MARSHNECK DRAINAGE AND SATURATED HYDRAULIC CONDUCTIVITY: Subaqueous, peraquic moisture regime, moderately high or high saturated hydraulic conductivity. Soil is permanently submerged with salt or brackish water.
12551 MASSAPOG DRAINAGE AND SATURATED HYDRAULIC CONDUCTIVITY: Subaqueous, peraquic moisture regime, moderately high to high saturated hydraulic conductivity. Soil is permanently submerged with salt or brackish water.
13042 MIDDLEMOOR DRAINAGE AND SATURATED HYDRAULIC CONDUCTIVITY: Drainage Class: Subaqueous (permanently submersed) Saturated Hydraulic Conductivity: Low to moderately low
13646 MUDDY CREEK DRAINAGE AND SATURATED HYDRAULIC CONDUCTIVITY: Drainage Class: Subaqueous drainage Saturated Hydraulic Conductivity: Moderately low to high Soil Moisture Regime: Peraquic Soil is permanently submerged / continuously inundated with brackish water. The presence of hypo-sulfidic materials within 50 cm of the soil surface puts these soils at risk for potential acid sulfate soil formation if they are dredged and exposed to the air.
13816 NAGUNT DRAINAGE AND SATURATED HYDRAULIC CONDUCTIVITY: Drainage class--Subaqueous Saturated hydraulic conductivity--Moderately high to very high Soil moisture regime--Peraquic Soil is continuously inundated by saline and brackish water
13873 NAPATREE DRAINAGE AND SATURATED HYDRAULIC CONDUCTIVITY: Subaqueous, peraquic moisture regime, and high or very high saturated hydraulic conductivity. Soil is permanently submerged with salt or brackish water.
14990 OVERBOARD DRAINAGE AND SATURATED HYDRAULIC CONDUCTIVITY: Drainage Class: Subaqueous drainage Saturated Hydraulic Conductivity: Moderately high to high Soil Moisture Regime: Peraquic Soil is permanently submerged / continuously inundated with brackish water. The presence of hypo-sulfidic materials within 50 cm of the soil surface puts these soils at extreme risk for potential acid sulfate soil formation if they are dredged and exposed to the air.
15307 PASTURE POINT DRAINAGE AND SATURATED HYDRAULIC CONDUCTIVITY: Agricultural Drainage Class: Subaqueous (permanently submersed) Saturated Hydraulic Conductivity: Moderately high to moderately low
15853 PISHAGQUA DRAINAGE AND SATURATED HYDRAULIC CONDUCTIVITY: Drainage class--Subaqueous Saturated hydraulic conductivity--Moderately high or high Soil moisture regime--Peraquic Soil is continuously inundated by saline and brackish water.
16928 RHODE RIVER DRAINAGE AND SATURATED HYDRAULIC CONDUCTIVITY: Drainage Class: Subaqueous drainage Saturated Hydraulic Conductivity: Moderately high to high Soil Moisture Regime: Peraquic Soil is permanently submerged with salt or brackish water with a range of 7 to 15 ppt
16930 RHODESFOLLY DRAINAGE AND SATURATED HYDRAULIC CONDUCTIVITY: Drainage class--Subaqueous Saturated hydraulic conductivity--High or very high Soil moisture regime--Peraquic Soil is permanently inundated with saline and brackish water with considerable tidal exchange which limits the development of sulfidic soil material.
17641 SAND POINT DRAINAGE AND SATURATED HYDRAULIC CONDUCTIVITY: Drainage Class: Subaqueous drainage Saturated Hydraulic Conductivity: Very high to moderately high in the substratum Soil Moisture Regime: Peraquic Soil is permanently submerged with salt or brackish water with a range of 7 to 15 ppt
18073 SELLMAN DRAINAGE AND SATURATED HYDRAULIC CONDUCTIVITY: Drainage Class: Subaqueous and peraquic soil moisture regime Saturated Hydraulic Conductivity: Low to moderately low Soil is permanently submerged / continuously inundated with brackish water. The presence of hypo-sulfidic materials within 50 cm of the soil surface puts these soils at risk for potential acid sulfate soil formation if they are dredged and exposed to the air.
18526 SINEPUXENT DRAINAGE AND PERMEABILITY: Drainage Class: Subaqueous (permanently submersed) Saturated Hydraulic Conductivity: High to Very High
18909 SOUTH RIVER DRAINAGE AND SATURATED HYDRAULIC CONDUCTIVITY: Drainage Class: Subaqueous drainage Saturated Hydraulic Conductivity: Moderately high to very high throughout Soil Moisture Regime: Peraquic Soil is permanently submerged / continuously inundated with brackish water. The presence of hypersulfidic materials within 50 cm of the soil surface puts these soils at risk for potential acid sulfate soil formation if they are dredged and exposed to the air.
20248 TINGLES DRAINAGE AND SATURATED HYDRAULIC CONDUCTIVITY: Drainage Class: Subaqueous and peraquic soil moisture regime Saturated Hydraulic Conductivity: Low to moderately low Soil is permanently submerged with salt or brackish water. The presence of sulfidic material within 50 cm of the soil surface puts these soils at risk for acid sulfate drainage if they are dredged and exposed to the air.
20566 TRAPPE DRAINAGE AND PERMEABILITY: Agricultural Drainage Class: Subaqueous (permanently submersed) Permeability: Moderate to very rapid Saturated Hydraulic Conductivity: Moderately high to very high
20688 TRUITT DRAINAGE AND SATURATED HYDRAULIC CONDUCTIVITY: Drainage Class: Subaqueous drainage and peraquic soil moisture regime Saturated Hydraulic Conductivity: Low to moderately low (not sure of saturated hydraulic conductivity for these soils) Soil is permanently submerged with salt or brackish water. The presence of sulfidic material within 20 inches (50 centimeters) of the soil surface puts these soils at risk for acid sulfate drainage if they are dredged and exposed to the air.
21859 WEQUETEQUOCK DRAINAGE AND SATURATED HYDRAULIC CONDUCTIVITY: Subaqueous, peraquic moisture regime, moderately high or high saturated hydraulic conductivity due to low bulk density. Soil is permanently submerged with salt or brackish water.
22915 FOX CREEK DRAINAGE AND SATURATED HYDRAULIC CONDUCTIVITY: Drainage Class: Subaqueous drainage Saturated Hydraulic Conductivity: Moderately high to very high Soil Moisture Regime: Peraquic Soil is permanently submerged / continuously inundated with brackish water. The presence of hyper-sulfidic materials within 50 cm of the soil surface puts these soils at risk for potential acid sulfate soil formation if they are dredged and exposed to the air.
22969 MAREAS DRAINAGE AND SATURATED HYDRAULIC CONDUCTIVITY: Drainage class: Subaqueous (permanently submersed) Saturated hydraulic conductivity (KSAT): Moderately high to high Flooding frequency and duration: Very frequent for very long duration from tides
22999 TUCKERTOWN DRAINAGE AND SATURATED HYDRAULIC CONDUCTIVITY: Subaqueous soil, peraquic soil moisture regime, moderately high saturated hydraulic conductivity due to low bulk density. The soil is permanently submerged with water.
23016 TUMAGAN DRAINAGE AND SATURATED HYDRAULIC CONDUCTIVITY: Drainage Class: Subaqueous and peraquic soil moisture regime Saturated Hydraulic Conductivity: Moderately high to high in the organic horizons and low to moderately low in the mineral horizons
23026 WICKFORD DRAINAGE AND SATURATED HYDRAULIC CONDUCTIVITY: Subaqueous soil, peraquic soil moisture regime, moderately high saturated hydraulic conductivity due to low bulk density. The soil is permanently submerged with fresh water.
23054 METEDECONK DRAINAGE AND SATURATED HYDRAULIC CONDUCTIVITY: Drainage Class: Subaqueous drainage and peraquic soil moisture regime Saturated Hydraulic Conductivity: Moderately high to high in the organic horizons and low to moderately low in the mineral horizons (if present)
23056 MAR NEGRO DRAINAGE AND SATURATED HYDRAULIC CONDUCTIVITY: Drainage class: Subaqueous (permanently submersed) Flooding frequency and duration: Very frequent for very long duration from tides Saturated hydraulic conductivity: Moderately high to high
brownag commented 8 months ago

Item number 7 is mostly resolved. The remaining empty cases either have no drainage class info in drainage and permeability, or have odd spelling errors etc. which I personally don't think fixes should be applied to. A more authoritative column may be possible using values parsed from drainage plus drainage_overview. That will be dealt with in a future PR which will add a post-processing script to compare D&P versus overview drainage classes and flag mismatches.