There are two typeError for NDR

what’s the matter and what should I do? thanks!

ERROR1.UnicodeEncodeError: ‘ascii’ codec can’t encode characters in position 13-14: ordinal not in range(128).

ERROR2.TypeError: Can only aggregate by integer based fields, requested field is of type String

Arguments for InVEST natcap.invest.ndr.ndr 3.7.0:
biophysical_table_path C:/Users/chen/Desktop/nanchunhendr.csv
calc_n True
calc_p True
dem_path G:/aGlovis-g/浏阳/INVEST/tiff1/demtif2.tif
k_param 2
lulc_path G:/aGlovis-g/浏阳/INVEST/tiff1/fwlulc1.tif
n_workers -1
runoff_proxy_path G:/aGlovis-g/浏阳/INVEST/tiff1/rain101.tif
subsurface_critical_length_n 150
subsurface_critical_length_p 150
subsurface_eff_n 0.8
subsurface_eff_p 0.8
threshold_flow_accumulation 1000
watersheds_path G:/aGlovis-g/浏阳/INVEST/tiff1/watershed.shp
workspace_dir G:\aGlovis-g\浏阳\INVEST\firworkndr\no1

Hi @steve ,

Please upload the log file (.txt) here so that we can diagnose the issue in detail.

Meanwhile, ensure that your biophysical table is UTF-8 encoded and that the values in the “lucode” column are formatted as integers. Also, check that the watersheds vector’s “ws_id” column is formatted as an integer type, not as a string nor text. After you make those changes, try to re-run the model.


1 Like

I have a sneaky suspicion this is an outdated version of invest. The logfile would confirm that. But you might also try the latest version (3.9.0 InVEST | Natural Capital Project).