Error running SA (generate_surrogates.csh)

Hi.
I want to run the MIMS spatial allocator for smoke (movesmerge).
what exactly input file I need to?
I have GRIDDESC and a shapefile.
And when I run the MIMS spatial allocator script, I get the below error :

>source generate_surrogates.csh
Writing surrogates to file /home/farzad/Spatial-Allocator/output/srg_SMOKE_CROSS.txt

GENERATING HIGHWAYS SURROGATE - category = 6
ERROR in /home/farzad/Spatial-Allocator/bin/64bits/srgcreate.exe: Error reading poly-data file, or no intersection with output grid exists. Exiting...
0.017u 0.004s 0:00.08 12.5%	0+0k 1024+0io 5pf+0w
Error generating surrogate for category 6

could anyone help me?

And when I run SA with java

java -classpath SurrogateTools.jar gov.epa.surrogate.SurrogateTool control_variables_grid.csv

I receive errors and this is my log.
srg_grid.log.txt (2.3 KB)

Are you trying to create a particular type of spatial surrogate? We have been pointing users to surrogatetoolsDB instead of the older spatial allocator because the DB version seems to do better with large input data. Not sure if this might work for you.

However your error says that your grid doesn’t overlap the input data files. What is your grid description? Perhaps it is misaligned. Have you tried to plot it in a GIS or similar? Do you have any data files on this grid that you could plot with VERDI or another tool?

Is your grid different from the grids EPA provides for spatial surrogates? If it is 4, 12, or 36km and has the same Lambert conformal projection you could use EPA’s surrogates and SMOKE will subset the data when it runs.

Also, from your log file is says this file does not exist:

…/data/shapefile/us/4SURG.shp

NO, the 4SURG.shp file there is in that location.

Thanks for your response.
I have 2 shapefiles, one of them has lines and their weight and another one has county information.
They match in the arcGIS software correctly. My grid is diffrent from the grids EPA provides. I have my own griddesk and other data is based on it.(so I have a diffrent map projection)
My question is the second shapefile(county information) should has been grided or not in arcGIS software.
Second qustion is can I have one shapefile (counties and lines together) to use for spatial allocator?

The “DATA SHAPEFILE” does not need to be gridded.

The “WEIGHT SHAPEFILE” is often not gridded, but in the case of some land use data it sometimes is – at a finer scale than your modeling grid cells.

Typically the weight file would have either line data (e.g., railroad lines) or county data (e.g., census tracts for population), but not both.

Have you looked at EPA’s surrogate files and how they are configured prior to starting this? There are links to the distributions of the latest EPA surrogate input files, including the configuration files that point to the data and weight shapefiles through the surrogate specification portion of the surrogate tool scripts.

There is a link to the EPA configuration available from the SurrogateToolsDB Github:

https://github.com/CEMPD/SurrogateToolsDB/blob/v1.0/README.md

1 Like

This folder has the latest surrogate Shapefile and scripts packages:

https://drive.google.com/drive/folders/1idGoi6I3GvKFCcf87O_8zMirM7Gtd0_E

Thanks again for your response.
I think I prepare shapefile wrongly as input for spatial allocator. I downloaded the NEI 2017 v1 Platform.
Could you tell me which of them is used as DATA SHAPEFILE for SA and which of them is WEIGHT SHAPEFILE ?
I want to compare my shapefile with them.

If you download this file for 2017 it has a surrogate specification file, which shows you in a table the data and weight polygons used for each surrogate:

https://drive.google.com/file/d/1YtKlbAIyyLqTxVsfwDIOGL-CHz7j_QOb/view?usp=sharing

If you use the Java Surrogate Tool to set up your inputs, then it will generate the appropriate scripts to run the Spatial Allocator. That should be described in the Spatial Allocator documentation.

1 Like

This is helpful for me. :+1: