Pollination value error

I am encountering exactly the same ERROR as described in a previous post 2169

I checked my shape file for any rows not populated - the file is complete and contains the 3 seasons spring, summer and autumn for all rows.
I checked for typos in the shape file, the biophysical CSV table and the guild CSV table but could not find any.

  1. Headers in biophysical table
    lucode lu_descript nesting_cavity_availability_index nesting_ground_availability_index floral_resources_spring_index floral_resources_summer_index floral_resources_autumn_index
  2. Headers in guild table
    SPECIES nesting_suitability_cavity_index nesting_suitability_ground_index foraging_activity_spring_index foraging_activity_summer_index foraging_activity_autumn_index alpha relative_abundance
  3. Headers in attribute table of farm shape file:
    fid DN crop_type half_sat p_managed season fr_spring fr_summer fr_autumn n_cavity n_ground p_dep

I re-populated the season column several times using the CASE function in QGIS and re-ran the pollination model several times. However, I keep getting the same error message.

WHEN “DN” = 1 THEN ‘Spring’
When “DN” = 2 THEN ‘Summer’
WHEN “DN” = 3 THEN ‘Summer’
WHEN “DN” = 4 THEN ‘Summer’
WHEN “DN” = 5 THEN ‘Autumn’
WHEN “DN” = 6 THEN ‘Autumn’
WHEN “DN” = 7 THEN ‘Autumn’
WHEN “DN” = 8 THEN ‘Autumn’
WHEN “DN” = 9 THEN ‘Summer’
WHEN “DN” = 10 THEN ‘Summer’
WHEN “DN” = 11 THEN ‘Summer’
WHEN “DN” = 12 THEN ‘Summer’
WHEN “DN” > 12 THEN ‘Spring’

Can you help?

Attached the latest log file and biophysical CSV. I can provide the shape file via a public link if helpful.

Pollinator25.csv (552 Bytes)

InVEST-natcap.invest.pollination-log-2023-04-22–18_19_21.txt (3.0 KB)

Here is the link to the previous post with the same error message: Pollination: ValueError encountered

Here is the public link to the farm shape file: WeTransfer - Send Large Files & Share Photos Online - Up to 2GB Free

Hi @aludzuweit -

Thanks for detailing all of the things you tried to fix this. I’m wondering if it’s actually a problem with capitalization.

As the User Guide says, " The SEASON name must exactly match a season given in the Guild Table."

The error message says:
ValueError: Found seasons in farm polygon that were not specified in the biophysical table: {‘Autumn’, ‘Spring’, ‘Summer’}. Expected only these: defaultdict(<class ‘dict’>, {‘spring’: {‘guild’: ‘foraging_activity_spring_index’, ‘farm’: ‘fr_spring’, ‘biophysical’: ‘floral_resources_spring_index’}, ‘summer’: {‘guild’: ‘foraging_activity_summer_index’, ‘farm’: ‘fr_summer’, ‘biophysical’: ‘floral_resources_summer_index’}, ‘autumn’: {‘guild’: ‘foraging_activity_autumn_index’, ‘farm’: ‘fr_autumn’, ‘biophysical’: ‘floral_resources_autumn_index’}})

The difference between the two is that “Autumn” etc are capitalized in the farm polygon, but are not capitalized in the biophysical table. Can you check to see if this is the issue?

~ Stacie

1 Like

Thank you @swolny! Changing season names from capital to small letters in the farm polygon has indeed solved the issue. The model ran through fine and without errors. :slightly_smiling_face: