TypeError encountered: not a string

hi,
I am running a sediment delivery ratio model. it shows “TypeError encountered: not a string”. can you kindly check it for me?

Initializing…
Showing messages with level INFO and higher
2020-03-13 20:18:44,799 utils.prepare_workspace(109) INFO Writing log messages to F:\GIS\invest\FEWE\sdr\city\taipei\InVEST-Sediment-Delivery-Ratio-Model-(SDR)-log-2020-03-13–20_18_44.txt
2020-03-13 20:18:44,801 model._logged_target(1633) Level 100 Starting model with parameters:
Arguments for InVEST natcap.invest.sdr 3.7.0:
biophysical_table_path F:/GIS/invest/FEWE/sdr/city/biophysical_table_Gura_num1.csv
dem_path F:/GIS/invest/FEWE/ndr/cities/taipei/DEM.tif
drainage_path
erodibility_path F:/GIS/invest/FEWE/sdr/city/taipei/soil2.tif
erosivity_path F:/GIS/invest/FEWE/sdr/city/taipei/rain2.tif
ic_0_param 0.5
k_param 0.55
lulc_path F:/GIS/invest/FEWE/sdr/city/taipei/land4/w001001.adf
n_workers -1
results_suffix
sdr_max 0.8
threshold_flow_accumulation 100000
watersheds_path F:/GIS/invest/FEWE/ndr/cities/taipei/waterwsid.shp
workspace_dir F:\GIS\invest\FEWE\sdr\city\taipei

2020-03-13 20:18:44,875 usage._log_model(275) WARNING an exception encountered when logging TypeError(‘not a string’,)
2020-03-13 20:21:54,019 utils._log_gdal_errors(66) ERROR [errno 1] latitude or longitude exceeded limits
2020-03-13 20:21:54,020 utils._log_gdal_errors(66) ERROR [errno 1] latitude or longitude exceeded limits
2020-03-13 20:21:54,020 utils._log_gdal_errors(66) ERROR [errno 1] latitude or longitude exceeded limits
2020-03-13 20:21:54,022 utils._log_gdal_errors(66) ERROR [errno 1] latitude or longitude exceeded limits
2020-03-13 20:21:54,022 utils._log_gdal_errors(66) ERROR [errno 1] latitude or longitude exceeded limits
2020-03-13 20:21:54,022 utils._log_gdal_errors(66) ERROR [errno 1] latitude or longitude exceeded limits
2020-03-13 20:21:54,022 utils._log_gdal_errors(66) ERROR [errno 1] latitude or longitude exceeded limits
2020-03-13 20:21:54,023 utils._log_gdal_errors(66) ERROR [errno 1] latitude or longitude exceeded limits
2020-03-13 20:21:54,023 utils._log_gdal_errors(66) ERROR [errno 1] latitude or longitude exceeded limits
2020-03-13 20:21:54,023 utils._log_gdal_errors(66) ERROR [errno 1] latitude or longitude exceeded limits
2020-03-13 20:21:54,023 utils._log_gdal_errors(66) ERROR [errno 1] latitude or longitude exceeded limits
2020-03-13 20:21:54,023 utils._log_gdal_errors(66) ERROR [errno 1] latitude or longitude exceeded limits
2020-03-13 20:21:54,023 utils._log_gdal_errors(66) ERROR [errno 1] latitude or longitude exceeded limits
2020-03-13 20:21:54,025 utils._log_gdal_errors(66) ERROR [errno 1] latitude or longitude exceeded limits
2020-03-13 20:21:54,025 utils._log_gdal_errors(66) ERROR [errno 1] latitude or longitude exceeded limits
2020-03-13 20:21:54,025 utils._log_gdal_errors(66) ERROR [errno 1] latitude or longitude exceeded limits
2020-03-13 20:21:54,025 utils._log_gdal_errors(66) ERROR [errno 1] latitude or longitude exceeded limits
2020-03-13 20:21:54,025 utils._log_gdal_errors(66) ERROR [errno 1] latitude or longitude exceeded limits
2020-03-13 20:21:54,025 utils._log_gdal_errors(66) ERROR [errno 1] latitude or longitude exceeded limits
2020-03-13 20:21:54,026 utils._log_gdal_errors(66) ERROR [errno 1] Reprojection failed, err = -14, further errors will be suppressed on the transform object.
2020-03-13 20:21:54,026 utils._log_gdal_errors(66) ERROR [errno 1] latitude or longitude exceeded limits
2020-03-13 20:21:54,026 utils._log_gdal_errors(66) ERROR [errno 1] latitude or longitude exceeded limits
2020-03-13 20:21:54,026 utils._log_gdal_errors(66) ERROR [errno 1] latitude or longitude exceeded limits
2020-03-13 20:21:54,028 utils._log_gdal_errors(66) ERROR [errno 1] latitude or longitude exceeded limits
2020-03-13 20:21:54,028 utils._log_gdal_errors(66) ERROR [errno 1] latitude or longitude exceeded limits
2020-03-13 20:21:54,028 utils._log_gdal_errors(66) ERROR [errno 1] latitude or longitude exceeded limits
2020-03-13 20:21:54,029 utils._log_gdal_errors(66) ERROR [errno 1] latitude or longitude exceeded limits
2020-03-13 20:21:54,029 utils._log_gdal_errors(66) ERROR [errno 1] latitude or longitude exceeded limits
2020-03-13 20:21:54,029 utils._log_gdal_errors(66) ERROR [errno 1] latitude or longitude exceeded limits
2020-03-13 20:21:54,029 utils._log_gdal_errors(66) ERROR [errno 1] latitude or longitude exceeded limits
2020-03-13 20:21:54,029 utils._log_gdal_errors(66) ERROR [errno 1] latitude or longitude exceeded limits
2020-03-13 20:21:54,030 utils._log_gdal_errors(66) ERROR [errno 1] latitude or longitude exceeded limits
2020-03-13 20:21:54,030 utils._log_gdal_errors(66) ERROR [errno 1] latitude or longitude exceeded limits
2020-03-13 20:21:54,030 utils._log_gdal_errors(66) ERROR [errno 1] latitude or longitude exceeded limits
2020-03-13 20:21:54,032 utils._log_gdal_errors(66) ERROR [errno 1] latitude or longitude exceeded limits
2020-03-13 20:21:54,032 utils._log_gdal_errors(66) ERROR [errno 1] latitude or longitude exceeded limits
2020-03-13 20:21:54,032 utils._log_gdal_errors(66) ERROR [errno 1] latitude or longitude exceeded limits
2020-03-13 20:21:54,032 utils._log_gdal_errors(66) ERROR [errno 1] latitude or longitude exceeded limits
2020-03-13 20:21:54,032 utils._log_gdal_errors(66) ERROR [errno 1] latitude or longitude exceeded limits
2020-03-13 20:21:54,032 utils._log_gdal_errors(66) ERROR [errno 1] Reprojection failed, err = -14, further errors will be suppressed on the transform object.
2020-03-13 20:21:54,035 Task.add_task(636) ERROR Something went wrong when adding task align input rasters (0), terminating taskgraph.
Traceback (most recent call last):
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\taskgraph\Task.py”, line 602, in add_task
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\taskgraph\Task.py”, line 1068, in _call
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\pygeoprocessing\geoprocessing.py”, line 682, in align_and_resize_raster_stack
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\pygeoprocessing\geoprocessing.py”, line 2680, in transform_bounding_box
File “C:\Python27\lib\site-packages\osgeo\osr.py”, line 765, in ImportFromWkt
TypeError: not a string
2020-03-13 20:21:54,036 model._logged_target(1639) ERROR Exception while executing <function execute at 0x0FA257F0>
Traceback (most recent call last):
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\natcap\invest\ui\model.py”, line 1636, in _logged_target
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\natcap\invest\sdr.py”, line 189, in execute
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\taskgraph\Task.py”, line 602, in add_task
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\taskgraph\Task.py”, line 1068, in _call
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\pygeoprocessing\geoprocessing.py”, line 682, in align_and_resize_raster_stack
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\pygeoprocessing\geoprocessing.py”, line 2680, in transform_bounding_box
File “C:\Python27\lib\site-packages\osgeo\osr.py”, line 765, in ImportFromWkt
TypeError: not a string
2020-03-13 20:21:54,036 model._logged_target(1642) INFO Execution finished
2020-03-13 20:21:54,038 utils.prepare_workspace(115) INFO Elapsed time: 3m 9.24s
2020-03-13 20:21:54,039 execution.run(78) ERROR Target <function _logged_target at 0x149AB1B0> failed with exception
Traceback (most recent call last):
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\natcap\invest\ui\execution.py”, line 68, in run
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\natcap\invest\ui\model.py”, line 1636, in _logged_target
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\natcap\invest\sdr.py”, line 189, in execute
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\taskgraph\Task.py”, line 602, in add_task
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\taskgraph\Task.py”, line 1068, in _call
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\pygeoprocessing\geoprocessing.py”, line 682, in align_and_resize_raster_stack
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\pygeoprocessing\geoprocessing.py”, line 2680, in transform_bounding_box
File “C:\Python27\lib\site-packages\osgeo\osr.py”, line 765, in ImportFromWkt
TypeError: not a string
2020-03-13 20:21:54,039 execution.run(83) INFO Execution finished

Hi @mhyuan -

I wonder if the error is related to the LULC input “w001001.adf”. It looks like this is an ESRI GRID raster, so try entering the associated file “hdr.adf” and see if that helps. Alternately, I advise converting the file to a TIFF, like your erodibility and erosivity rasters are, since they’re easier to work with in a lot of ways, and it’s much more obvious which file to enter into the model.

~ Stacie

Dear Stacie,
Thanks for your quick response. I have done something according to your suggestion. However, it shows similar error information. Can you kindly check it for me?
Initializing…
Showing messages with level INFO and higher
2020-03-16 11:49:50,509 utils.prepare_workspace(109) INFO Writing log messages to F:\GIS\invest\FEWE\sdr\city\taipei\InVEST-Sediment-Delivery-Ratio-Model-(SDR)-log-2020-03-16–11_49_50.txt
2020-03-16 11:49:50,510 model._logged_target(1633) Level 100 Starting model with parameters:
Arguments for InVEST natcap.invest.sdr 3.7.0:
biophysical_table_path F:/GIS/invest/FEWE/sdr/city/biophysical_table_Gura_num2.csv
dem_path F:/GIS/invest/FEWE/sdr/city/taipei/dem4.tif
drainage_path
erodibility_path F:/GIS/invest/FEWE/sdr/city/taipei/soil2.tif
erosivity_path F:/GIS/invest/FEWE/sdr/city/taipei/rain2.tif
ic_0_param 0.5
k_param 0.55
lulc_path F:/GIS/invest/FEWE/sdr/city/taipei/land4.tif
n_workers -1
results_suffix
sdr_max 0.8
threshold_flow_accumulation 100000
watersheds_path F:/GIS/invest/FEWE/sdr/city/taipei/watershed4.shp
workspace_dir F:\GIS\invest\FEWE\sdr\city\taipei

2020-03-16 11:49:50,592 usage._log_model(275) WARNING an exception encountered when logging TypeError(‘not a string’,)
2020-03-16 11:52:59,983 utils._log_gdal_errors(66) ERROR [errno 1] latitude or longitude exceeded limits
2020-03-16 11:52:59,984 utils._log_gdal_errors(66) ERROR [errno 1] latitude or longitude exceeded limits
2020-03-16 11:52:59,984 utils._log_gdal_errors(66) ERROR [errno 1] latitude or longitude exceeded limits
2020-03-16 11:52:59,986 utils._log_gdal_errors(66) ERROR [errno 1] latitude or longitude exceeded limits
2020-03-16 11:52:59,986 utils._log_gdal_errors(66) ERROR [errno 1] latitude or longitude exceeded limits
2020-03-16 11:52:59,986 utils._log_gdal_errors(66) ERROR [errno 1] latitude or longitude exceeded limits
2020-03-16 11:52:59,986 utils._log_gdal_errors(66) ERROR [errno 1] latitude or longitude exceeded limits
2020-03-16 11:52:59,986 utils._log_gdal_errors(66) ERROR [errno 1] latitude or longitude exceeded limits
2020-03-16 11:52:59,986 utils._log_gdal_errors(66) ERROR [errno 1] latitude or longitude exceeded limits
2020-03-16 11:52:59,986 utils._log_gdal_errors(66) ERROR [errno 1] latitude or longitude exceeded limits
2020-03-16 11:52:59,986 utils._log_gdal_errors(66) ERROR [errno 1] latitude or longitude exceeded limits
2020-03-16 11:52:59,986 utils._log_gdal_errors(66) ERROR [errno 1] latitude or longitude exceeded limits
2020-03-16 11:52:59,986 utils._log_gdal_errors(66) ERROR [errno 1] latitude or longitude exceeded limits
2020-03-16 11:52:59,986 utils._log_gdal_errors(66) ERROR [errno 1] latitude or longitude exceeded limits
2020-03-16 11:52:59,987 utils._log_gdal_errors(66) ERROR [errno 1] latitude or longitude exceeded limits
2020-03-16 11:52:59,987 utils._log_gdal_errors(66) ERROR [errno 1] latitude or longitude exceeded limits
2020-03-16 11:52:59,987 utils._log_gdal_errors(66) ERROR [errno 1] latitude or longitude exceeded limits
2020-03-16 11:52:59,987 utils._log_gdal_errors(66) ERROR [errno 1] latitude or longitude exceeded limits
2020-03-16 11:52:59,989 utils._log_gdal_errors(66) ERROR [errno 1] latitude or longitude exceeded limits
2020-03-16 11:52:59,989 utils._log_gdal_errors(66) ERROR [errno 1] Reprojection failed, err = -14, further errors will be suppressed on the transform object.
2020-03-16 11:52:59,990 utils._log_gdal_errors(66) ERROR [errno 1] latitude or longitude exceeded limits
2020-03-16 11:52:59,990 utils._log_gdal_errors(66) ERROR [errno 1] latitude or longitude exceeded limits
2020-03-16 11:52:59,990 utils._log_gdal_errors(66) ERROR [errno 1] latitude or longitude exceeded limits
2020-03-16 11:52:59,990 utils._log_gdal_errors(66) ERROR [errno 1] latitude or longitude exceeded limits
2020-03-16 11:52:59,990 utils._log_gdal_errors(66) ERROR [errno 1] latitude or longitude exceeded limits
2020-03-16 11:52:59,990 utils._log_gdal_errors(66) ERROR [errno 1] latitude or longitude exceeded limits
2020-03-16 11:52:59,992 utils._log_gdal_errors(66) ERROR [errno 1] latitude or longitude exceeded limits
2020-03-16 11:52:59,992 utils._log_gdal_errors(66) ERROR [errno 1] latitude or longitude exceeded limits
2020-03-16 11:52:59,992 utils._log_gdal_errors(66) ERROR [errno 1] latitude or longitude exceeded limits
2020-03-16 11:52:59,993 utils._log_gdal_errors(66) ERROR [errno 1] latitude or longitude exceeded limits
2020-03-16 11:52:59,993 utils._log_gdal_errors(66) ERROR [errno 1] latitude or longitude exceeded limits
2020-03-16 11:52:59,993 utils._log_gdal_errors(66) ERROR [errno 1] latitude or longitude exceeded limits
2020-03-16 11:52:59,993 utils._log_gdal_errors(66) ERROR [errno 1] latitude or longitude exceeded limits
2020-03-16 11:52:59,993 utils._log_gdal_errors(66) ERROR [errno 1] latitude or longitude exceeded limits
2020-03-16 11:52:59,993 utils._log_gdal_errors(66) ERROR [errno 1] latitude or longitude exceeded limits
2020-03-16 11:52:59,993 utils._log_gdal_errors(66) ERROR [errno 1] latitude or longitude exceeded limits
2020-03-16 11:52:59,994 utils._log_gdal_errors(66) ERROR [errno 1] latitude or longitude exceeded limits
2020-03-16 11:52:59,994 utils._log_gdal_errors(66) ERROR [errno 1] latitude or longitude exceeded limits
2020-03-16 11:52:59,994 utils._log_gdal_errors(66) ERROR [errno 1] latitude or longitude exceeded limits
2020-03-16 11:52:59,996 utils._log_gdal_errors(66) ERROR [errno 1] Reprojection failed, err = -14, further errors will be suppressed on the transform object.
2020-03-16 11:52:59,996 Task.add_task(636) ERROR Something went wrong when adding task align input rasters (0), terminating taskgraph.
Traceback (most recent call last):
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\taskgraph\Task.py”, line 602, in add_task
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\taskgraph\Task.py”, line 1068, in _call
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\pygeoprocessing\geoprocessing.py”, line 682, in align_and_resize_raster_stack
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\pygeoprocessing\geoprocessing.py”, line 2680, in transform_bounding_box
File “C:\Python27\lib\site-packages\osgeo\osr.py”, line 765, in ImportFromWkt
TypeError: not a string
2020-03-16 11:52:59,996 model._logged_target(1639) ERROR Exception while executing <function execute at 0x0FD507F0>
Traceback (most recent call last):
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\natcap\invest\ui\model.py”, line 1636, in _logged_target
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\natcap\invest\sdr.py”, line 189, in execute
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\taskgraph\Task.py”, line 602, in add_task
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\taskgraph\Task.py”, line 1068, in _call
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\pygeoprocessing\geoprocessing.py”, line 682, in align_and_resize_raster_stack
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\pygeoprocessing\geoprocessing.py”, line 2680, in transform_bounding_box
File “C:\Python27\lib\site-packages\osgeo\osr.py”, line 765, in ImportFromWkt
TypeError: not a string
2020-03-16 11:52:59,996 model._logged_target(1642) INFO Execution finished
2020-03-16 11:52:59,996 utils.prepare_workspace(115) INFO Elapsed time: 3m 9.49s
2020-03-16 11:52:59,996 execution.run(78) ERROR Target <function _logged_target at 0x0FD917B0> failed with exception
Traceback (most recent call last):
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\natcap\invest\ui\execution.py”, line 68, in run
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\natcap\invest\ui\model.py”, line 1636, in _logged_target
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\natcap\invest\sdr.py”, line 189, in execute
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\taskgraph\Task.py”, line 602, in add_task
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\taskgraph\Task.py”, line 1068, in _call
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\pygeoprocessing\geoprocessing.py”, line 682, in align_and_resize_raster_stack
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\pygeoprocessing\geoprocessing.py”, line 2680, in transform_bounding_box
File “C:\Python27\lib\site-packages\osgeo\osr.py”, line 765, in ImportFromWkt
TypeError: not a string
2020-03-16 11:52:59,996 execution.run(83) INFO Execution finished

Hi @mhyuan,

Sorry to see you’re still having troubles. A few things:

  1. Could you download, install, and run the latest version of InVEST and SDR that has a pretty significant bug fix? InVEST 3.8 SDR-BugFix
  2. Can you check that your input rasters and watershed shapefile are properly projected with valid Coordinate Systems? It appears that at least one of the input files is not behaving correctly.

Cheers,

Doug