Home » Software » PostGIS: Spatially enabled Relational Database Sytem » Analysis of SSURGO Data in PostGIS: An Overview » Seasonally Wet Soils and Shrink-Swell Potential
Seasonally Wet Soils and Shrink-Swell Potential
Example 1: The location of seasonaly wet soils via two methods: hydricrating and USDA Soil Taxonomy interpretation.
Example 1 map
Example 2 map
-- optionally link polygons here...-- compute the percent of each map unit that contains components that may be seasonally wetSELECT mukey, wet_flag, sum(comppct_r) AS pct_muFROM(SELECT mukey, cokey, comppct_r,-- slightly less restrictive than hydricrating aloneCASE WHEN ((taxclname ~~* '%aqu%') = 't') OR (hydricrating = 'Yes') then 1 ELSE 0 END AS wet_flagFROM component-- subset to Yolo CountyWHERE areasymbol = 'ca113') AS yolo_wet_components-- only keep map unit with some component that meets the criteriaWHERE wet_flag = 1-- aggregate by map unit, wet_flagGROUP BY yolo_wet_components.mukey, yolo_wet_components.wet_flagORDER BY mukey;X
Example 1.1 Extract a list of wet components, and sum area based on component (series) name
musym | mukey | muname | wet_area_ac-------+--------+----------------------------------------------------------------+-------------Sc | 459268 | Sacramento clay | 35710.90Mf | 459244 | Marvin silty clay loam | 18877.18Sg | 459272 | Sacramento soils, flooded | 12273.51Cn | 459219 | Clear Lake soils, flooded | 11665.84Cc | 459216 | Capay soils, flooded | 11029.83Sv | 459288 | Sycamore complex, drained | 8410.41St | 459286 | Sycamore silty clay loam, drained | 6900.77Ck | 459218 | Clear Lake clay | 6737.88Sa | 459266 | Sacramento silty clay loam | 6014.48Sp | 459283 | Sycamore silt loam, drained | 5537.18Sw | 459289 | Sycamore complex, flooded | 5041.96Wb | 459301 | Willows clay | 4950.34Ss | 459285 | Sycamore silty clay loam | 4859.59Pb | 459254 | Pescadero silty clay, saline-alkali | 4700.77So | 459282 | Sycamore silt loam | 3953.42Rh | 459262 | Riverwash | 3698.88Pc | 459255 | Pescadero soils, flooded | 3589.01Tb | 459292 | Tyndall very fine sandy loam | 3299.03Ob | 459252 | Omni silty clay | 3174.44[...]X
Example 2: Classify soils according to shrink-swell capacity of the top 1 meter of soil, weighted by horizon thickness and component percent.
-- set a lower boundary for the query\SET lwr_bdy 100-- add a class label, based on NRCS guidelinesSELECT mapunit.musym, mapunit.muname, mapunit.muacres,round(mu_wt_lep::numeric, 2) AS lep,CASE WHEN mu_wt_lep < 3 THEN 'Low'WHEN mu_wt_lep >= 3 AND mu_wt_lep < 6 THEN 'Moderate'WHEN mu_wt_lep >= 6 AND mu_wt_lep < 9 THEN 'High'WHEN mu_wt_lep >= 9 THEN 'Very High'END AS lep_classFROM(-- compute map unit lep, weighted by component percent, to set depthSELECT component.mukey,sum(component.comppct_r * co_wt_mean_lep) / sum(component.comppct_r) AS mu_wt_lepFROM(-- compute a horizon-thickness weighted mean lep to a set depthSELECT cokey, sum(thick * lep_r) / sum(thick) AS co_wt_mean_lepFROM(-- compute horizon thickness, but only to a set depthSELECT cokey, hzdept_r, hzdepb_r, lep_r,CASE WHEN hzdepb_r > :lwr_bdy THEN (:lwr_bdy - hzdept_r)ELSE (hzdepb_r - hzdept_r) END AS thickFROM chorizonWHERE areasymbol = 'ca113'AND lep_r IS NOT NULLAND hzdept_r <= :lwr_bdy) AS hz_lepGROUP BY cokey) AS co_lepJOIN componentON co_lep.cokey = component.cokeyGROUP BY mukey) AS mu_lepJOIN mapunitON mu_lep.mukey = mapunit.mukeyORDER BY muacres DESC, lep DESC;X
musym | muname | muacres | lep | lep_class-------+------------------------------------------------------------------+---------+------+-----------Ya | Yolo silt loam | 39698 | 2.52 | LowSc | Sacramento clay | 34886 | 7.50 | HighCa | Capay silty clay | 33465 | 7.50 | HighMrG2 | Millsholm rocky loam, 15 to 75 percent slopes, eroded | 30118 | 1.50 | LowRg | Rincon silty clay loam | 24580 | 6.36 | HighBrA | Brentwood silty clay loam, 0 to 2 percent slopes | 23045 | 7.50 | HighCtD2 | Corning gravelly loam, 2 to 15 percent slopes, eroded | 22080 | 5.34 | ModerateMf | Marvin silty clay loam | 20970 | 6.60 | HighDaF2 | Dibble clay loam, 30 to 50 percent slopes, eroded | 18612 | 7.11 | HighSmE2 | Sehorn-Balcom complex, 15 to 30 percent slopes, eroded | 17794 | 6.17 | HighTaA | Tehama loam, 0 to 2 percent slopes | 16622 | 3.75 | ModerateBdF2 | Balcom-Dibble complex, 30 to 50 percent slopes, eroded | 16405 | 5.73 | ModerateSmD | Sehorn-Balcom complex, 2 to 15 percent slopes | 16117 | 6.50 | HighBaF2 | Balcom silty clay loam, 30 to 50 percent slopes, eroded | 12637 | 4.50 | ModerateSg | Sacramento soils, flooded | 12258 | 6.27 | HighCn | Clear Lake soils, flooded | 11666 | 6.92 | HighSmF2 | Sehorn-Balcom complex, 30 to 50 percent slopes, eroded | 11226 | 6.33 | HighCc | Capay soils, flooded | 11030 | 7.50 | HighSv | Sycamore complex, drained | 9241 | 4.18 | ModerateMs | Myers clay | 8938 | 7.50 | HighPfF2 | Positas gravelly loam, 30 to 50 percent slopes, eroded | 7920 | 5.34 | ModerateSt | Sycamore silty clay loam, drained | 7839 | 4.50 | ModerateCk | Clear Lake clay | 6946 | 7.50 | HighRa | Reiff very fine sandy loam | 6847 | 1.50 | Low[...]X
Software
- General Purpose Programming with Scripting Languages
- LaTeX Tips and Tricks
- PostGIS: Spatially enabled Relational Database Sytem
- PROJ: forward and reverse geographic projections
- GDAL and OGR: geodata conversion and re-projection tools
- R: advanced statistical package
- GRASS GIS: raster, vector, and imagery analysis
- Generic Mapping Tools: high quality map production