This forum is shutting down! Please post new discussions at

Crop production : an error

Hi guys,

I ran the crop model for calculating corn production, the data looks fine but I got an error at the end. It says "'NoneType' object has no attribute 'GetLayer' "

The log file is attached, please let me know what it means, thank you!


  • DaveDave Member, Administrator, NatCap Staff
    Thanks for posting! That looks like a small bug we will fix. The aggregate results polygon is an optional input and even though you chose not to include it, the model is trying to load it anyway and failing to do so. 

    Like you said, this should not affect the results you got. And if you do want to provide a polygon vector by which to aggregate results, that should work just fine.
  • urgendalaiurgendalai Member
    edited February 15
    @ Dave 

    Hi Dave, thank you for verifying this. 
    I also have a problem on the carbon model, do you mind to take a look at it?
    I guess it says my map has an issue but do not know what it is.

    Thank you!

    Post edited by urgendalai on
  • swolnyswolny Member, NatCap Staff
    Hi @urgendalai -

    Searching the forum for your error, I found this post - does the answer that they provide (about not having a NoData value defined) help you?

    ~ Stacie

  • @ swolny

    Thank you for help, but where could I type that command in? The black window? I found it can not be typed. 
  • DaveDave Member, Administrator, NatCap Staff
    That command is used to define a nodata value for a raster that has no nodata value defined. But that command is just one  of many ways to accomplish that. You could also use your GIS program of choice, and google for "set nodata value raster" or something similar.

    Also, reading that other thread, it sounds like we should have already fixed a bug that handles rasters without a nodata definition. So if you don't mind, could you send your input data to me as it may help us fix an issue in our software?

  • swolnyswolny Member, NatCap Staff
    You can set NoData values in several ways. James provided a command-line method, but you can use your GIS to do this. In ArcGIS, try SetNull, or the CopyRaster command allows you to set a NoData value. In QGIS, if you do Save As on a raster, one of your options is setting the NoData value.

    ~ Stacie

Sign In or Register to comment.