InVEST Recreation and Tourism model Connection error

What is the issue or question you have?

Is the connection error caused by my local environment or by the InVEST server?

What do you expect to happen?

Successfully connect to the InVEST Recreation model’s remote server or receive guidance on an alternative approach.

What have you tried so far?

  1. Split the AOI from ADM0 (Thailand) to ADM1 level because using ADM0 resulted in too many photo points, making the model fail due to size.
  2. Attempted to run the Recreation model with the ADM1-level shapefiles using Python.
  3. Despite these changes, I still cannot connect to the server.

Upload the logfile using the :outbox_tray: button

recreation_batch_20251031-115826.log (510.9 KB)

Hi @yf11 , which version of natcap.invest are you using? I think I can tell from the traceback that you are attempting to connect to a defunct server, so updating natcap.invest should likely do the trick.

Also, the latest version will tell you right away whether your AOI contains too many points or not. So you may wish to try ADM0 again. Though you may still find you need to split it up.

I’m using the natcap.invest (3.17.0).

Of course, I can run the model manually with the split adm1 level, but when I tried to run it through Python, I still encountered the following errors.

Problem 1: Server Connection Failure

  • The Natural Capital Project server (34.44.144.58:54321) is refusing connections

Problem 2: File Reading Bug

  • InVEST’s internal _copy_aoi_no_grid function returns None

  • The same error occurs with both Shapefiles and GeoPackages

  • GDAL can read the files correctly, but InVEST’s internal processing fails

Hi @yf11 , there a couple things from your original log that indicate an older version of natcap.invest was running at that time.

  1. The _retrieve_photo_user_days function was renamed to _retrieve_user_days.
  2. natcap.invest now requires Pyro5 instead of Pyro4. That could possibly explain the server connection problems.

If you have updated to 3.17.0 and Pyro5 and you have a new logfile please share it, I am happy to take a closer look.

It looks like this function is designed to return None. It should however write a new file to the destination filepath:

def _copy_aoi_no_grid(source_aoi_path, dest_aoi_path):
    """Copy a shapefile from source to destination."""

If you have an updated log with new Traceback, I am happy to take a closer look.