This forum is shutting down! Please post new discussions at

Pollination- Farms shapefile column titles

Hello NatCappers,

I've succesfully managed to run the pollination 3.4 model for 150 species across 60 LULC classes! Phew it took about a week to run it! 

Now I'm trying to build and include a layer on farms in order to estimate the impact on potential yields. I have some questions about how to name the seasons (in which the crops are pollinated) in the famr attribute table. In the user guide it says that the name of the season should be identical to that used in the guild table. 

Currently I have 'floral_resources_summer_index' in the Biophysical table and 'floral_activity_summer_index' in my guilds table. Which of these naming conventions should I be following? When I justed used 'summer' the error told me it had to match what was written in both tables - but they are not identical.

Any clarification would be greatly appreciated!



  • DougDoug Administrator, NatCap Staff
    Hi Sylvie,

    Just an avid InVEST user here but thought maybe I could help. It is a bit confusing, but I believe you want to match the 
    guilds table naming convention, except I believe the guild table requires the column headers to be such as: 
    'foraging_activity_summer_index' (replace summer, with spring, autumn, etc...).

    So if you swap out 'floral' for 'foraging' in your guild table, and then use that for your farm polygon shapefile, it should be satisfied!

    If that still doesn't seem to fix the issue, could you post the log file? There could be a weird regular expression matching issue going on.

    Good luck! 
  • SylvieSylvie Member
    Hi Doug,

    Thanks for this tip! I tried filling in the 'season' attribute with the labels from the guilds table as you suggested (using foraging rather than floral) but I still get an error because my Biophysical table uses 'floral'. However, I previously ran my model with these labels in the biophysical table and guild table without problem. So I'm not sure if I also need to change the labels in the Biophysical table as well?

    ValueError: Expected a biophysical, guild, and farm entry for 'summer'
    but instead found only {'biophysical': u'floral_resources_summer_index',
    'guild': u'foraging_activity_summer_index'}. Ensure there are corresponding
    entries of 'summer' in both the guilds, biophysical table, and farm fields.

    I've attached the log in a separate document


  • DougDoug Administrator, NatCap Staff
    Hey Sylvie,

    It looks like the guild and biophysical table are in good shape the way you have it. The farm polygon / attribute table is the issue I think.

    I think a concrete example will help clear things up. Let's say we have spring and summer seasons. Then in the farm shapefile attribute table we would have the following fields:
    - fr_spring
    - fr_summer
    - season
    - n_cavity
    - n_ground  (where ground / cavity is the substrate)

    So under the 'season' field it will either be 'summer' or 'spring', and in the 'fr_spring', 'fr_summer' field will be the 0-1 value. (note these are just the necessary matching fields, the other fields: 'half_sat', etc are still expected).

    Likewise in the guild table for headers / fields:
    - foraging_activity_spring_index
    - foraging_activity_summer_index
    - nesting_suitability_cavity_index
    - nesting_suitability_ground_index

    And in Biophysical table:
    - floral_resources_spring_index
    - floral_resources_summer_index
    - nesting_cavity_availability_index
    - nesting_ground_availability_index

    Hopefully this helps line up what the model expects as far as "matching" goes across tables. I think for your 'season' field in the farm table you just want the name of the season. Then the fr_[SEASON], n_[SUBSTRATE] fields.

    Let me know how it goes!
  • SylvieSylvie Member
    That worked!

    I also didnt realize that the titles in the farm polygone layer were case sensitive. I had them all as capslock because it was written fr_[SEASON] which was also causing some of my problem. 

    Thank you so much for all the help!
  • DougDoug Administrator, NatCap Staff
    That's great! 
  • SylvieSylvie Member
    Hey Doug,

    I quickly saw that you were online just now. I'm running into one recurring problem now when I run the model. In the final step when the model writes the results to the shapefile it keeps running into errors with specific polygones and will give me an KeyError with the # of the offending polygone and stop. I cant seem to see what is wrong with that polygon and if I remove it the program will keep running until it encounters another problematic polygon. 

    My farm polygones all have repeated values across their attributes based on crop type. The offending polygones had all the same attribute values as other farm polygones that were processed and didnt throw an error. Other than one by one removing these polygones, can you think of what might be causing this to happen?

Sign In or Register to comment.