Mast head image

Farmland Protection Policy Act

This script retrieves data for the Farmland Protection Act.


Text highlighted in yellow in the example script can be changed for a particular area. Examples can be found on the Tips page.

Tips Page

Copy the example script below and paste it into the query page on the Soil Data Access site.

Soil Data Access Query Page

Example Script

SELECT

m.musym AS Map_unit_symbol, m.muname AS Map_unit_name,

CONVERT(VARCHAR(3), slope_l) + ' to ' + CONVERT(VARCHAR(3),slope_h) AS Slope,

(c.nirrcapcl + c.nirrcapscl) AS LCC,

(SELECT TOP 1 cy.nonirryield_r

FROM cocropyld AS cy

WHERE c.cokey=cy.cokey AND cropname LIKE 'Corn') AS Corn_YLD,

(SELECT TOP 1 cy2.cropprodindex

FROM cocropyld AS cy2

WHERE c.cokey=cy2.cokey AND cropname LIKE 'corn') AS Corn_Prod_Index,

farmlndcl AS Farm_land_class, m.muacres AS Map_unit_acres,

ROUND((CAST(muacres*100 AS FLOAT)/areaacres),2) AS Map_unit_percent,

compname AS Component_name,

(SELECT top 1 texture

FROM chorizon AS ch

LEFT OUTER JOIN chtexturegrp AS cht ON ch.chkey = cht.chkey

WHERE ch.cokey = c.cokey ORDER BY rvindicator DESC) AS Texture,

LEFT(l.areASymbol, 2) AS 'State',

RIGHT(l.areASymbol, 3) AS 'County', l.areaname AS Area_name, l.areaacres AS Area_acres

FROM legend AS l

INNER JOIN mapunit AS m ON l.lkey = m.lkey

INNER JOIN component AS c ON m.mukey = c.mukey

WHERE l.areASymbol= 'IN011'

AND c.majcompflag='Yes' AND

cokey = (SELECT top 1 cokey FROM component AS c3 WHERE c3.mukey=m.mukey ORDER BY comppct_r DESC, cokey)

ORDER BY l.areASymbol, m.muname, c.comppct_r DESC

Example Table Output

Description of tables and columns can be found on this link: Table and Column Descriptions

Map_unit_symbol Map_unit_name Slope LCC Corn_YLD Corn_Prod_Index Farm_land_class Map_unit_acres Map_unit_percent Component_name Texture State County Area_name Area_acres
CbaA Camden silt loam, 0 to 2 percent slopes 0 to 2 155 All areas are prime farmland 88 0.03 Camden SICL IN 011 Boone County, Indiana 270957
WmnA Wawaka silt loam, 6 to 12 percent slopes, eroded 6 to 12 3e 130 Not prime farmland 106 0.04 Wawaka SR- FS GRV-LCOS IN 011 Boone County, Indiana 270957
ThrA Treaty silty clay loam, 0 to 1 percent slopes 0 to 1 2w 175 Prime farmland if drained 63023 23.26 Treaty SICL IN 011 Boone County, Indiana 270957



Helping People Help the Land

USDA is an equal opportunity provider, employer, and lender.