Recreation: Attribute Error 'NoneType' object has no attribute 'ExportToWkt'

Hi,

Having trouble with Recreation. Using a simplified AOI shapefile, no attributes other than geometry, no overlaps or holes. Running InVest3.3, which successfully ran the test case for the rec model. Windows 7.

First was getting a value error on projection as didn't realize needed to match both geographic and projected coordinate systems, so re-projected into UTM WSG84 Zone 18. That worked. Now getting this error and code:

Initializing...

09/06/2017 13:28:51 root DEBUG Loading <module 'natcap.invest.recreation.recmodel_client' from 'C:\INVEST~1.3_X\INVEST~1\natcap\invest\recreation\recmodel_client.pyc'> in frozen environment

Arguments:

aoi_path D:/Documents and Settings/acramer/Documents/recreation_workspace/AOI_20170830/AOI_reproj.shp

cell_size 1000000.0

compute_regression True

end_year 2014

grid_aoi True

grid_type square

predictor_table_path C:\InVEST_3.3.3_x86\recreation\predictors.csv

results_suffix AOI_

scenario_predictor_table_path C:\InVEST_3.3.3_x86\recreation\predictors_scenario.csv

start_year 2005

workspace_dir D:\Documents and Settings\acramer\Documents\recreation_workspace



09/06/2017 13:28:51 root INFO Logging will be saved to natcap.invest.recreation.recmodel_client-log-2017-09-06--13_28_51.txt

09/06/2017 13:28:51 root DEBUG Loaded the model from natcap.invest.recreation.recmodel_client

09/06/2017 13:28:51 root INFO Executing the loaded model

09/06/2017 13:28:51 root INFO Running InVEST version "3.3.3"

09/06/2017 13:28:51 root INFO Python architecture: ('32bit', 'WindowsPE')

09/06/2017 13:28:51 root INFO Disk space remaining for workspace: 615.75 GB

09/06/2017 13:28:51 root INFO Pointing temporary directory at the workspace at D:\Documents and Settings\acramer\Documents\recreation_workspace

09/06/2017 13:28:51 root INFO Starting natcap.invest.recreation.recmodel_client

09/06/2017 13:28:51 root INFO Setting tempfile.tempdir to D:\Documents and Settings\acramer\Documents\recreation_workspace\tmp

09/06/2017 13:28:51 natcap.invest.recmodel_client INFO tables validate correctly

09/06/2017 13:28:51 natcap.invest.recmodel_client INFO Contacting server, please wait.

09/06/2017 13:28:51 natcap.invest.recmodel_client INFO Server online, version: 3.3.2:./recserver_cache/0c010b5f4a698db8_fast_hash.pickle

09/06/2017 13:28:51 natcap.invest.recmodel_client INFO Server supports year queries between 2005 and 2014

09/06/2017 13:28:51 natcap.invest.recmodel_client INFO gridding aoi

09/06/2017 13:28:51 root ERROR ---------------------------------------------------

09/06/2017 13:28:51 root ERROR ---------------------- ERROR ----------------------

09/06/2017 13:28:51 root ERROR ---------------------------------------------------

09/06/2017 13:28:51 root ERROR Error: exception found while running natcap.invest.recreation.recmodel_client

09/06/2017 13:28:51 root DEBUG

09/06/2017 13:28:51 root DEBUG Build details

09/06/2017 13:28:51 root DEBUG Interpreter

09/06/2017 13:28:51 root DEBUG Current temp dir: D:\Documents and Settings\acramer\Documents\recreation_workspace\tmp

09/06/2017 13:28:51 root DEBUG tempfile.tempdir: D:\Documents and Settings\acramer\Documents\recreation_workspace\tmp

09/06/2017 13:28:51 root DEBUG

09/06/2017 13:28:51 root DEBUG System

09/06/2017 13:28:51 root DEBUG OS : Windows-7-6.1.7601-SP1

09/06/2017 13:28:51 root DEBUG Processor architecture: AMD64

09/06/2017 13:28:51 root DEBUG FS encoding : mbcs

09/06/2017 13:28:51 root DEBUG Preferred encoding: cp1252

09/06/2017 13:28:51 root DEBUG

09/06/2017 13:28:51 root DEBUG Python

09/06/2017 13:28:51 root DEBUG Version : 2.7.9

09/06/2017 13:28:51 root DEBUG Build : ('default', 'Dec 10 2014 12:24:55')

09/06/2017 13:28:51 root DEBUG Compiler : MSC v.1500 32 bit (Intel)

09/06/2017 13:28:51 root DEBUG Implementation : CPython

09/06/2017 13:28:51 root DEBUG Architecture : 32bit

09/06/2017 13:28:51 root DEBUG Linkage format : WindowsPE

09/06/2017 13:28:51 root DEBUG

09/06/2017 13:28:51 root DEBUG Packages

09/06/2017 13:28:51 root DEBUG Cython : ?

09/06/2017 13:28:51 root DEBUG Numpy : 1.11.2

09/06/2017 13:28:51 root DEBUG Scipy : 0.16.1

09/06/2017 13:28:51 root DEBUG OSGEO : 1.11.3

09/06/2017 13:28:51 root DEBUG Shapely : 1.5.5

09/06/2017 13:28:51 root DEBUG InVEST : 3.3.3

09/06/2017 13:28:51 root DEBUG

09/06/2017 13:28:51 root DEBUG

09/06/2017 13:28:51 root DEBUG Exception not environment-related

09/06/2017 13:28:51 root DEBUG Printing traceback

Traceback (most recent call last):

File "C:\Users\natcap-servers\jenkins-home\workspace\natcap.invest\label\GCE-windows-1\exe\build\invest\out00-PYZ.pyz\natcap.invest.iui.executor", line 620, in runModel

File "C:\Users\natcap-servers\jenkins-home\workspace\natcap.invest\label\GCE-windows-1\exe\build\invest\out00-PYZ.pyz\natcap.invest.recreation.recmodel_client", line 200, in execute

File "C:\Users\natcap-servers\jenkins-home\workspace\natcap.invest\label\GCE-windows-1\exe\build\invest\out00-PYZ.pyz\natcap.invest.recreation.recmodel_client", line 346, in _grid_vector

AttributeError: 'NoneType' object has no attribute 'ExportToWkt'



09/06/2017 13:28:51 root ERROR Exiting due to failures



--Any ideas most appreciated. 


Thank you.


Comments

  • DaveDave Member, NatCap Staff
    Hmm, I wonder if the cell size paramter could be the issue? I'm not certain but that error might arise if the the cell size is so large that no cells actually fit inside the AOI. The units on the cell size parameter will be the same as the linear units in your AOI's projection, so meters for a UTM system.

    If changing the cell size doesn't work, you may send me your AOI shapefile and we should be able to resolve this.  davefisher@stanford.edu
  • AbbyAbby Member
    Hi Dave! Thanks for your fast reply!

    No go but may be - tried it with many a different cell size and same error. It is, though, in the Pacific, so under this projection it gets chopped in half [does it really need to be in
    UTM WSG84 Zone 18 to run or did I make that up-can't find projection needs in metadata-pardon]

    Anyway, know split projection can throw errors in tessellation in some cases in other programs. Could this be it?

    ( Also, should mention-it's a big one. May also be the issues. Will try brute as well.)
  • AbbyAbby Member
    Ah! Erase erase- needed to reproject the predictor table shapefiles or turn off the regression option- that was it. Pardon.

    Now I just, predictably, get a memory timed out error- too big an aoi I think. Ah well.
  • DaveDave Member, NatCap Staff
    Thanks for the update!

    Yes, all GIS inputs should use the same coordinate system as the AOI input. But you aren't limited to any particular system.

    Really large AOIs are known to be problematic, the software just isn't optimized for them. So you could consider breaking your AOI into smaller sections and batching them through invest. If you do that, it might pay off to make the gridded AOI ahead of time instead of asking invest to do that part, if it's really important that the grid cells are continuous and uniform across the whole AOI.
  • AbbyAbby Member
    Hi again Dave,

    So- did I think as you suggested- pre-gridded my AOI and then broke it up into chunks and fed them though Recreation invest. 
    [It's a pretty big AOI so the shapefile size limitation was a factor possibly as well (why not raster, Sir?) but not the real reason I write.] 

    It worked pretty well except there's a big hole (aka all cells in this input strip return 0) for what seems like a really large chunk around the international date line of a couple hundred km. (screenshot of output attached)

    The actual AOI is projected to have a central meridian  @ 180, so that should not be the problem. Have also tried further breaking up this strip and running it through again with no luck.

    Wondering if there is any way to get this data?


    (Thoughts of troubleshooting: Does the Recreation data go all the way to 180? Is this something that could be resolved by the input data on the program side projected to something else, say cylindrical equal area central meridian 180?)

    OK. Thank you for your help and I look forward to hearing from you.

    1449 x 917 - 63K
Sign In or Register to comment.