Description
This service consumes a JSON request containing a request identifier and CRP Offer geometry and returns sheet/rill water and wind erosion rates for a fallow management for up to the three most dominant soil components in a CRP Offer area, plus a weighted average for each erosion rate.
Request/Response JSON
Example of each attached.
CSIP Services Called by crpAssessment
wwesoilparams/2.0, wepp/3.1, weps/5.2
Data Sources Accessed by crpAssessment
CRP rotation object(s), how stored TBD
Data Stores Written To by crpAssessment
CRP_Results table, database and table columns TBD
Service Processes
- Consume crpAssessment request JSON
- Compute centroid of CRP Offer geometry from request JSON
- Compute representative WEPS region length, width, and orientation from CRP Offer geometry
- Populate request JSON with CRP Offer geometry and call wwesoilparams service
- Process wwesoilparams response JSON
- Fetch cokey and acres of dominant soil component
- If no other valid compoent, exit, else fetch cokey and acres of 2nd-most dominant component
- If no other valid component exit, else fetch cokey and acres of 3rd-most dominant component
- Fetch CRP fallow rotation object
- Note: Eventually there may be several rotation objects, but initially one. These rotation objects probably should be in a CRdb or maybe CRLMDO table (TBD).
- Initially, the same fallow rotation object will be used for all CRP erosion assessments
- Populate request JSON with CRP Offer geometry and call (new) DEMsteepness service, which returns a representative slope steepness.
- For each cokey
- Populate wepp service request JSON
- Set climateDataVersion to 2015
- Set usePRISM to true
- Set latitude parameter to CRP Offer centroid latitude coordinate
- Set longitude parameter to CRP Offer centroid longitude coordinate
- Set aspect parameter to 180
- Set width parameter to 50
- Set steepness parameter to DEMsteepness result
- Set length parameter to steepness-based LightleWeesie length
- Set slope_type to uniform
- Set soilPtr parameter to cokey
- Set contour parameter to none
- Set crlmod parameter to CRP fallow rotation object
- Call and post request JSON to wepp/3.1 model service
- Populate weps service request JSON
- Set crlmod parameter to CRP fallow rotation object
- Set crop_calibration_mode parameter to false
- Set soil parameter to cokey
- Set field shape to rectangle
- Set field_length to result from WEPS Region process above
- Set field_width to result from WEPS Region process above
- Set field radius to 0
- Set field_orientation to result from WEPS Region process above
- Set latitude parameter to CRP Offer centroid latitude coordinate
- Set longitude parameter to CRP Offer centroid longitude coordinate
- Set elevation parameter to 0
- Set wind_barriers four wind_barrier sub-parameters to null
- Set water_erosion_loss parameter to 0
- Set soil_rock_fragments to 0
- Call and post request JSON to weps/5.2 service
- Process wepp/3.1 response JSON(s)
- Compute weighted average water erosion rate
- If weighted average erosion rate > 100, set it to 100.
- Process weps/5.2 response JSON(s)
- Compute weighted average wind erosion rate
- If weighted average erosion rate > 100, set it to 100.
- Populate crpAssessment response JSON
- See sample response JSON
- Update CRP_Results table