This repo is a demonstration workflow using the gssurgo
python package.
-
Download zip files from: https://nrcs.app.box.com/v/soils
-
Have the
arcpy
python module available for the intialtif
extraction step -
Install the dependencies for the
gssurgo
python package. If using Anaconda, make sure you have the 64bit version. You can install an Anaconda virtual environment with:
conda env create -n gssurgo -f environment.yml
source activate gssurgo
make all
import gssurgo
gssurgo.aoi(in_raster_path = "tifs", out_raster = "tests/aoi.tif", xmax = -88.34945, xmin = -88.35470, ymin = 38.70095, ymax = 38.70498)
Compose an SQL query that give a two column result of mukey
and some_variable
. For example, "SELECT mukey, pwsl1pomu FROM Valu1"
.
gssurgo.query_gpkg(src_tif = "tests/aoi.tif", gpkg_path = "gpkgs", sql_query = "SELECT mukey, pwsl1pomu FROM Valu1", out_raster = "tests/aoi_results.tif")
gssurgo.viz_numeric_output("tests/aoi_results.tif", "tests/aoi_results.png")