My goal is to read in a DBF from CropScape using Python and plot the DBF to create a figure as in the example. I need help reading in and plotting the DBF.
DATA: I download the CropScape Cropland DBF from https://nassgeodata.gmu.edu/CropScape/. I define my Area of Interest as Iowa.
Then I download Defined Area of Interest Data for the year 2020
, corn
and soybean
, and the projection Degrees Lat/Lon, WGS84 Datum
.
What I have so far:
filename = 'CDL_2020_clip_20210826173123_1609691609.tif.vat.dbf'
dbf = gpd.read_file(filename)
Additional information that might be useful is:
dbf.head() =
VALUE RED GREEN BLUE CLASS_NAME OPACITY geometry
0 0 0.0 0.000 0.000 Background 0.0 None
1 1 1.0 0.827 0.000 Corn 1.0 None
2 2 1.0 0.149 0.149 Cotton 1.0 None
3 3 0.0 0.659 0.894 Rice 1.0 None
4 4 1.0 0.620 0.043 Sorghum 1.0 None
len(dbf) = 256