Scenario generator mix-ups on macs

What is the issue or question you have?

I am teaching students how to use the scenario generator using 3.12.1 and the farthest from vs. nearest to commands seem to be backwards in their implementation.

What do you expect to happen?

When they try to create buffers around focal land cover, it finds areas the farthest from and when using farthest from, it creates buffers. Here is a result from the log file pasted below where we asked the program to place forest forests in ag lands farthest from developed areas. You can see this created buffers instead.

What have you tried so far?

Students with macs (nearly all of them) are all discovering this issue.

Attach the logfile here:

2023-03-20 10:48:44,300 (natcap.invest.utils) utils.prepare_workspace(161) Level 100 Writing log messages to [/Users/student/Desktop/agtoforest/InVEST-natcap.invest.scenario_gen_proximity-log-2023-03-20–10_48_44.txt]
2023-03-20 10:48:44,300 (main) cli.main(475) Level 100 Starting model with parameters:
Arguments for InVEST natcap.invest.scenario_gen_proximity 3.12.1:
aoi_path
area_to_convert 10000
base_lulc_path /Users/student/Desktop/GIS/DesMoines_NDR/NLCD_DesMoines.tif
convert_farthest_from_edge True
convert_nearest_to_edge False
convertible_landcover_codes 82
focal_landcover_codes 23 24
n_fragmentation_steps 1
n_workers -1
replacement_lucode 41
results_suffix _agritoforest
workspace_dir /Users/student/Desktop/agtoforest

2023-03-20 10:48:44,304 (natcap.invest.scenario_gen_proximity) scenario_gen_proximity.execute(226) INFO executing farthest_from_edge scenario
2023-03-20 10:48:44,369 (pygeoprocessing.geoprocessing) geoprocessing.raster_calculator(396) INFO starting stats_worker
2023-03-20 10:48:44,370 (pygeoprocessing.geoprocessing) geoprocessing.raster_calculator(402) INFO started stats_worker <Thread(Thread-1 (stats_worker), started daemon 13146583040)>
2023-03-20 10:48:44,416 (pygeoprocessing.geoprocessing) geoprocessing.raster_calculator(483) INFO 100.0% complete
2023-03-20 10:48:44,417 (pygeoprocessing.geoprocessing) geoprocessing.raster_calculator(486) INFO Waiting for raster stats worker result.
2023-03-20 10:48:44,520 (natcap.invest.scenario_gen_proximity) scenario_gen_proximity._convert_landscape(404) INFO step 1 of 1
2023-03-20 10:48:44,520 (natcap.invest.scenario_gen_proximity) scenario_gen_proximity._convert_landscape(413) INFO create distance transform for current landcover
2023-03-20 10:48:44,524 (pygeoprocessing.geoprocessing) geoprocessing.raster_calculator(396) INFO starting stats_worker
2023-03-20 10:48:44,524 (pygeoprocessing.geoprocessing) geoprocessing.raster_calculator(402) INFO started stats_worker <Thread(Thread-2 (stats_worker), started daemon 13146583040)>
2023-03-20 10:48:44,582 (pygeoprocessing.geoprocessing) geoprocessing.raster_calculator(483) INFO 100.0% complete
2023-03-20 10:48:44,582 (pygeoprocessing.geoprocessing) geoprocessing.raster_calculator(486) INFO Waiting for raster stats worker result.
2023-03-20 10:48:44,638 (pygeoprocessing.geoprocessing) geoprocessing.raster_calculator(483) INFO 100.0% complete
2023-03-20 10:48:44,914 (pygeoprocessing.geoprocessing_core) geoprocessing.distance_transform_edt(2501) INFO Distance Transform Phase 2
2023-03-20 10:48:45,410 (pygeoprocessing.geoprocessing) geoprocessing.raster_calculator(396) INFO starting stats_worker
2023-03-20 10:48:45,410 (pygeoprocessing.geoprocessing) geoprocessing.raster_calculator(402) INFO started stats_worker <Thread(Thread-3 (stats_worker), started daemon 13146583040)>
2023-03-20 10:48:45,463 (pygeoprocessing.geoprocessing) geoprocessing.raster_calculator(483) INFO 100.0% complete
2023-03-20 10:48:45,463 (pygeoprocessing.geoprocessing) geoprocessing.raster_calculator(486) INFO Waiting for raster stats worker result.
2023-03-20 10:48:45,515 (pygeoprocessing.geoprocessing) geoprocessing.raster_calculator(483) INFO 100.0% complete
2023-03-20 10:48:45,717 (pygeoprocessing.geoprocessing_core) geoprocessing.distance_transform_edt(2501) INFO Distance Transform Phase 2
2023-03-20 10:48:46,135 (pygeoprocessing.geoprocessing) geoprocessing.raster_calculator(396) INFO starting stats_worker
2023-03-20 10:48:46,135 (pygeoprocessing.geoprocessing) geoprocessing.raster_calculator(402) INFO started stats_worker <Thread(Thread-4 (stats_worker), started daemon 13146583040)>
2023-03-20 10:48:46,265 (pygeoprocessing.geoprocessing) geoprocessing.raster_calculator(483) INFO 100.0% complete
2023-03-20 10:48:46,266 (pygeoprocessing.geoprocessing) geoprocessing.raster_calculator(486) INFO Waiting for raster stats worker result.
2023-03-20 10:48:46,529 (pygeoprocessing.geoprocessing) geoprocessing.convolve_2d(2745) INFO starting convolve
2023-03-20 10:48:46,530 (pygeoprocessing.geoprocessing) geoprocessing.convolve_2d(2793) INFO 96 sent to workers, wait for worker results
2023-03-20 10:48:46,785 (pygeoprocessing.geoprocessing) geoprocessing.convolve_2d(2859) INFO convolution worker 100.0% complete on farthest_from_edge_distance_agritoforest.tif
2023-03-20 10:48:47,220 (pygeoprocessing.geoprocessing) geoprocessing.raster_calculator(396) INFO starting stats_worker
2023-03-20 10:48:47,220 (pygeoprocessing.geoprocessing) geoprocessing.raster_calculator(402) INFO started stats_worker <Thread(Thread-7 (stats_worker), started daemon 13146583040)>
2023-03-20 10:48:47,388 (pygeoprocessing.geoprocessing) geoprocessing.raster_calculator(483) INFO 100.0% complete
2023-03-20 10:48:47,388 (pygeoprocessing.geoprocessing) geoprocessing.raster_calculator(486) INFO Waiting for raster stats worker result.
2023-03-20 10:48:47,554 (natcap.invest.scenario_gen_proximity) scenario_gen_proximity._convert_landscape(476) INFO convert 111199 pixels to lucode 41
2023-03-20 10:48:48,477 (natcap.invest.utils) utils.prepare_workspace(169) INFO Elapsed time: 4.18s
2023-03-20 10:48:48,477 (natcap.invest.utils) utils.prepare_workspace(172) INFO Execution finished

1 Like

A student just tried this with version 3.13 and it worked properly. So…perhaps that will be the fix!
Eric

1 Like

Hey @elonsdorf,

Thanks for posting the issue. That’s interesting… I don’t think we’ve had any scenario generator changes in awhile…

Let us know if folks are still experiencing this issue. If so, it’d be great to get some zipped data to recreate and test on our end.

Cheers,

Doug

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.