techmatters / soil-id-algorithm

GNU Affero General Public License v3.0
1 stars 0 forks source link

bug: soil list result does not always provide LCC #119

Open shrouxm opened 4 months ago

shrouxm commented 4 months ago

Description

Sometimes the LCC values for list_soils are "nan" or "None". Not sure if this is due to missing data or an algorithm bug. Either we, we should return better values than "nan" or "None".

Steps To Reproduce

Query list_soils with the coordinates {"lon": -122.084000, "lat": 37.422000}.

Expected behavior

LCC values should exist.

Actual behavior

LCC values render as "nan" or "None"

Additional context

Example result json:

{
      "id": {
        "name": "Hangerone",
        "component": "Hangerone",
        "score_loc": 1.0,
        "rank_loc": "1"
      },
      "site": {
        "siteData": {
          "mapunitID": "1882928",
          "componentID": "24611985",
          "componentKind": "Series",
          "dataSource": "SSURGO",
          "textureInfill": "No",
          "rfvInfill": "No",
          "componentPct": 90,
          "distance": 133.0,
          "minCompDistance": 133.0,
          "slope": 1.0,
          "nirrcapcl": "nan",
          "nirrcapscl": "None",
          "nirrcapunit": "nan",
          "irrcapcl": "nan",
          "irrcapscl": "None",
          "irrcapunit": "nan",
          "taxsubgrp": "Cumulic Vertic Endoaquolls",
          "sdeURL": "https://casoilresource.lawr.ucdavis.edu/sde/?series=hangerone",
          "seeURL": "https://casoilresource.lawr.ucdavis.edu/see/#hangerone"
        },
        "siteDescription": "The Hangerone series consists of very deep, poorly drained soils that formed in alluvium from mixed rock sources. Hangerone soils are in basins. Slopes range from 0 to 2 percent. The mean annual precipitation is about 14 inches and the mean annual temperature is about 60 degrees F."
      },
      "esd": {
        "ESD": {
          "ecoclassid": ["R014XG903CA"],
          "ecoclassname": ["Salt Marsh"],
          "esd_url": [""]
        }
      },
      "bottom_depth": {
        "0": 24,
        "1": 42,
        "2": 68,
        "3": 88,
        "4": 115,
        "5": 183,
        "6": 225
      },
      "sand": {
        "0": 20.6,
        "1": 15.8,
        "2": 16.0,
        "3": 18.5,
        "4": 24.7,
        "5": 44.1,
        "6": 22.0
      },
      "clay": {
        "0": 41.8,
        "1": 50.7,
        "2": 49.6,
        "3": 43.8,
        "4": 33.7,
        "5": 24.4,
        "6": 48.6
      },
      "texture": {
        "0": "Clay",
        "1": "Clay",
        "2": "Clay",
        "3": "Clay",
        "4": "Clay loam",
        "5": "Loam",
        "6": "Clay"
      },
      "rock_fragments": {
        "0": 2,
        "1": 1,
        "2": 0,
        "3": 0,
        "4": 0,
        "5": 30,
        "6": 0
      },
      "cec": { "0": "CEC", "1": "CEC" },
      "ph": {
        "0": 8.3,
        "1": 8.3,
        "2": 8.4,
        "3": 8.6,
        "4": 8.5,
        "5": 8.6,
        "6": 8.2
      },
      "ec": {
        "0": 2.0,
        "1": 2.0,
        "2": 2.0,
        "3": 2.0,
        "4": 2.0,
        "5": 2.0,
        "6": 2.0
      },
      "lab": {
        "0": [41.22, 1.45, 6.17],
        "1": [41.22, 1.45, 6.17],
        "2": [41.22, 1.45, 6.17],
        "3": [60.67, 0.21, 8.29],
        "4": [71.25, -0.45, 8.34],
        "5": [71.62, 0.23, 14.6],
        "6": [41.23, 0.35, 6.53]
      },
      "munsell": {
        "0": "10YR 4/1",
        "1": "10YR 4/1",
        "2": "10YR 4/1",
        "3": "2.5Y 6/1",
        "4": "2.5Y 7/1",
        "5": "2.5Y 7/2",
        "6": "2.5Y 4/1"
      }
    }