{"id":22413697,"url":"https://github.com/jsta/gssurgo","last_synced_at":"2025-07-31T23:31:35.761Z","repository":{"id":57436240,"uuid":"142450474","full_name":"jsta/gssurgo","owner":"jsta","description":"Python package enabling an open source gSSURGO workflow","archived":false,"fork":false,"pushed_at":"2022-01-06T23:18:44.000Z","size":3818,"stargazers_count":9,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-10T09:35:53.531Z","etag":null,"topics":["python","ssurgo"],"latest_commit_sha":null,"homepage":"https://www.nrcs.usda.gov/wps/portal/nrcs/detail/soils/survey/geo/?cid=nrcs142p2_053628","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jsta.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-07-26T14:13:40.000Z","updated_at":"2024-07-16T18:43:02.000Z","dependencies_parsed_at":"2022-09-06T01:11:45.023Z","dependency_job_id":null,"html_url":"https://github.com/jsta/gssurgo","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsta%2Fgssurgo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsta%2Fgssurgo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsta%2Fgssurgo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsta%2Fgssurgo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jsta","download_url":"https://codeload.github.com/jsta/gssurgo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228312125,"owners_count":17900219,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["python","ssurgo"],"created_at":"2024-12-05T14:14:20.639Z","updated_at":"2024-12-05T14:14:21.184Z","avatar_url":"https://github.com/jsta.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gssurgo\n\n[![PyPiVersion](https://img.shields.io/pypi/v/gssurgo.svg)](https://pypi.python.org/pypi/gssurgo/) [![Project Status: Active - The project has reached a stable, usable state and is being actively developed.](http://www.repostatus.org/badges/latest/active.svg)](http://www.repostatus.org/#active) [![PYPI Downloads](https://img.shields.io/pypi/dm/gssurgo.svg)](https://pypistats.org/packages/gssurgo) [![Build Status](https://travis-ci.org/jsta/gssurgo.svg?branch=master)](https://travis-ci.org/jsta/gssurgo) [![Code DOI](https://zenodo.org/badge/142450474.svg)](https://zenodo.org/badge/latestdoi/142450474)\n\nThe `gssurgo` python package enables open source workflows with the `gSSURGO` dataset. It provides:\n\n* A shell script `extract_gssurgo_tif` for generating stand-alone `gSSURGO` grids. **These raster grids are distributed within file geodatabase archives and can only be extracted using ArcGIS, the fileGDB driver, or (in the case of `extract_gssurgo_tif`) the `arcpy` python package.**  \n\n* Python functions for converting Geodatabase files to geopackage format. \n \n* Python functions for returning the results of specific `SQL` queries of `gSSURGO` data.\n \n* Python functions for referencing query results to corresponding (raster) grid cells.\n\n## Prereqs\n\n* The intial `tif` (grid) extraction step requies the `arcpy` python module. This step assumes that a python executable linked to `arcpy` can be found at `C:\\Python27\\ArcGIS10.3\\python.exe`. Edit [bin/extract_gssurgo_tif](bin/extract_gssurgo_tif) to enable alternate locations.\n\n* Remaining operations require the dependencies listed in [environment.yml](environment.yml) and [requirements.txt](requirements.txt). If using Anaconda, make sure you have the **64bit** version. You can install an Anaconda virtual environment with:\n\n```\nconda env create -n gssurgo -f environment.yml\nsource activate gssurgo\n```\n\n## Installation\n\n```\n# local install\n# pip install -e  . \n\n# development install \npip install git+git://github.com/jsta/gssurgo.git\n\n# development upgrade\n# pip install --upgrade git+git://github.com/jsta/gssurgo.git\n```\n\n## Usage\n\nA demonstration workflow using the `gssurgo` python package can be found at: https://github.com/jsta/gssurgo_data\n\n### 1. Extract tif and build gpkgs\n\n```\nextract_gssurgo_tif 'path/to/gSSURGO_STATE.gdb/MapunitRaster_10m' 'path/to/STATE.tif'\n```\n\n```py\nimport gssurgo\ngssurgo.build_gpkg(\"path/to/gSSURGO_STATE.gdb\", \"path/to/gSSURGO_STATE.gpkg\")\n```\n\n### 2. Generate an Area of Interest (AOI)\n\n```py\ngssurgo.aoi(in_raster_path = \"tifs\", out_raster = \"path/to/aoi.tif\", xmax = -88.34945, xmin = -88.35470, ymin = 38.70095, ymax = 38.70498)\n```\n\n### 3. Pull specific variable and merge with corresponding tif\n\n```py\ngssurgo.query_gpkg(src_tif = \"tests/aoi.tif\", gpkg_path = \"path/to/gkpgs/\", sql_query = 'SELECT mukey, nonirryield_r FROM mucropyld WHERE (cropname = \"Corn\")', out_raster = \"tests/aoi_results.tif\")\n\ngssurgo.query_gpkg(src_tif = \"tests/aoi.tif\", gpkg_path = \"path/to/gpkgs/\", sql_query = 'SELECT mukey, nonirryield_r FROM mucropyld WHERE (cropname = \"Corn\")', out_raster = \"tests/aoi_results.tif\")\n\n```\n\n\u003e The `sql_query` parameter must give a two column result of `mukey` and `some_variable` where no `mukey` entries are duplicated.\n\n### 4. Visualize output\n\n```py\ngssurgo.viz_numeric_output(\"path/to/aoi_results.tif\", \"path/to/aoi_results.png\")\n```\n\n![](scratch/nonirryield_r.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjsta%2Fgssurgo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjsta%2Fgssurgo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjsta%2Fgssurgo/lists"}