0

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.

Define Area of Interest

Then I download Defined Area of Interest Data for the year 2020, corn and soybean, and the projection Degrees Lat/Lon, WGS84 Datum.

Download Defined Area of Interest Data

Flight Path overlaid on Iowa CropScape DBF

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
Trenton McKinney
  • 56,955
  • 33
  • 144
  • 158
Natasha
  • 101
  • 1
  • 12

1 Answers1

1

ArcGIS_coloro_table_readme.docx contents

To view the image attribute file of the downloaded CDL data in GeoTIFF format in ArgGIS software, the user has to load a .tif.vat.dbf created by ArcGIS. The .tif.vat.dbf file has to have the same file name as the CDL data file. There are two .tif.vat.dbf files included in the downloaded package. The default .tif.vat.dbf file, which has the same file name as the CDL file, is compatible with the ArcGIS. 10.3.1 as shown in the following example: CDL_2019_clip_20200203101819_718535908.tif CDL_2019_clip_20200203101819_718535908.tif.vat.dbf

Please notice that all three file extension tags .tif.vat.dbf are required.

The ArcGIS. 10.3.1 (including earlier version) and ArcGIS 10.7.0 use different scales for RGB values. The ArcGIS 10.3.1 outputs RGB values ranging from 0 – 1 (same as the Erdas Imagine values), while ArcGIS 10.7.0 has RGB values ranging from 0 – 255.

All CDLs from previous years (up to 2018) have .vat.dbf files with RGB values ranging from 0 – 1. Therefore, they are compatible with the .tif.vat.dbf file of the ArcGIS. 10.3.1 version. Starting from 2019 CDLs, the .tif.vat.dbf file of ArcGIS 10.7.0 are included in the downloading package to make it compatible with ArcGIS 10.7.0. Users have to rename the included file “ArcGIS10.7.0_2019_30m_cdls.tif.vat.dbf” to the same name as the CDL file’s like the following: CDL_2019_clip_20200203101819_718535908.tif.vat.dbf If you want to view the image attribute in the ArcGIS 10.7.0. The renamed .tif.vat.dbf file has to be loaded into ArcGIS 10.7.0. along with the CDL file.

NASS maintains an extensive Frequently Asked Questions (FAQs) webpage, including how to properly attribute the CDL in ESRI ArcGIS and Erdas Imagine, at the following webpage: https://www.nass.usda.gov/Research_and_Science/Cropland/sarsfaqs2.php#Section2_1.0.

Trenton McKinney
  • 56,955
  • 33
  • 144
  • 158