InVEST python read in pollination_willamette.invs.json

Dear community

pollination_willamette.invs.json
I thought that this included all input files. Why I need to provide additionally all the other files like guild_table, landcover, farms.shp?

Path
Is it possible to provide a path to my input file “pollination_willamette.invs.json”?
At the moment the path is “(env-invest) C:\Users\f80809100>”. So I was forced to copy the input files from the original path: O:\Data-Work\27_Natural_Resources-RE\271_KLIM_Work\CC_Impacts\NCCS\Data\M2b_Pollination\InVEST\InVEST_Sample-Data. I suppose that I should not change to directory C:/Users to run InVEST successfully.

Kind regards

@edavis
@jdouglass

Hello @sibylles ,

Yes, you can provide all of your input parameters to the InVEST pollination model through this JSON file. Filepaths can be relative or absolute paths. See below for a few examples.

As @edavis mentioned in another thread, you would use the datastack file from the command-line by adding the -d flag and providing the path to your datastack file there:

Relative path example

When using relative paths, the paths are relative to the location of the .json file. So if this .json file is located at C:\datastack.invest.json, then farms.shp would be expected to be found at C:\farms.shp. The guild table would be expected to be found at C:\my_folder\guild_table.csv.

{
    "args": {
        "farm_vector_path": "farms.shp",
        "guild_table_path": "my_folder/guild_table.csv",
        "landcover_biophysical_table_path": "landcover_biophysical_table.csv",
        "landcover_raster_path": "landcover.tif",
        "results_suffix": ""
    },
    "invest_version": "3.7.0",
    "model_name": "natcap.invest.pollination"
}

Absolute path example

These json files can also have filepaths defined as absolute paths, specifying where, exactly, on disk the file is located. Using absolute paths, you could store your JSON file anywhere on the hard drive and be able to access files anywhere on your hard drive.

{
    "args": {
        "farm_vector_path": "C:\InVEST_data\Pollination\farms.shp",
        "guild_table_path": "C:\InVEST_data\Pollination\guild_table.csv",
        "landcover_biophysical_table_path": "C:\InVEST_data\Pollination\landcover_biophysical_table.csv",
        "landcover_raster_path": "C:\InVEST_data\Pollination\landcover.tif",
        "results_suffix": ""
    },
    "invest_version": "3.7.0",
    "model_name": "natcap.invest.pollination"
}

Hope this helps,
James

Thanks @jdouglass

Ah I realize know, the json invest sample file consist only a part of the data. It does not include guild table, biophysical table etc. So when just feeding in the json file, the code was asking for the guild table.

Kind regards
Sibylle