# Spatial Surrogate codes 6831, 6832, and 6833

**URL:** https://forum.cmascenter.org/t/spatial-surrogate-codes-6831-6832-and-6833/2179
**Category:** Spatial Allocator
**Created:** [March 22, 2021, 7:49pm UTC](https://forum.cmascenter.org/t/spatial-surrogate-codes-6831-6832-and-6833/2179 "2021-03-22T19:49:40Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![ali.mousavi.nezhad90](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.cmascenter.org/ali.mousavi.nezhad90/32/1527_2.png) [@ali.mousavi.nezhad90](https://forum.cmascenter.org/u/ali.mousavi.nezhad90)
#### Post date: [March 22, 2021, 7:49pm UTC](https://forum.cmascenter.org/t/spatial-surrogate-codes-6831-6832-and-6833/2179/1 "2021-03-22T19:49:40Z")

</div>

Hi,

I’m running the Spatial Allocator program to make the spatial surrogates needed for SMOKE for a domain other than what EPA has been prepared. I have two problems:

1. Although I need spatial surrogate codes 6831, 6832, and 6833, I couldn’t find the “_surrogate specification_” for the above-mentioned codes in the Spatial Allocator software.
2. I found some spatial surrogates included in the EPA NEI platform, which have been gapfilled from ERG data. How can I gapfill those surrogate files using ERG data?

Your help is much appreciated.

Regards,  
Ali

---

<div class="post-metadata">

### Author: ![eyth.alison](https://avatars.discourse-cdn.com/v4/letter/e/7ab992/32.png) [@eyth.alison](https://forum.cmascenter.org/u/eyth.alison)
#### Post date: [March 23, 2021, 8:26pm UTC](https://forum.cmascenter.org/t/spatial-surrogate-codes-6831-6832-and-6833/2179/2 "2021-03-23T20:26:47Z")

</div>

Here are the specifications for 6831/6832/6833, including the gapfilling hierarchy for these 2017 platform surrogates. Note that the shapefile names vary from year to year. These are new for 2017 plaftorm and only impact produced water emissions. I’m not sure if those exist in 2016 platform (I can’t recall if you are trying to do 2016 or 2017-based work)

“USA”,“Produced water at CBM wells”,6831,tl2019Counties\_LCC\_WRF,GEOID,PRODUCED\_WATER\_CBM\_CONUS\_2016,ACTIVITY,“Well count - CBM wells”,“Well count - all wells”,“NLCD Open + Low”,“New for 2017 platform”

“USA”,“Produced water at gas wells”,6832,tl2019Counties\_LCC\_WRF,GEOID,PRODUCED\_WATER\_GAS\_CONUS\_2016,ACTIVITY,“Well count - gas wells”,“Well count - all wells”,“NLCD Open + Low”,“New for 2017 platform”

“USA”,“Produced water at oil wells”,6833,tl2019Counties\_LCC\_WRF,GEOID,PRODUCED\_WATER\_OIL\_CONUS\_2016,ACTIVITY,“Well count - oil wells”,“Well count - all wells”,“NLCD Open + Low”,“New for 2017 platform”

---

<div class="post-metadata">

### Author: ![ali.mousavi.nezhad90](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.cmascenter.org/ali.mousavi.nezhad90/32/1527_2.png) [@ali.mousavi.nezhad90](https://forum.cmascenter.org/u/ali.mousavi.nezhad90)
#### Post date: [March 25, 2021, 1:02am UTC](https://forum.cmascenter.org/t/spatial-surrogate-codes-6831-6832-and-6833/2179/3 "2021-03-25T01:02:19Z")

</div>

Thanks.  
I’m working on NEI2017. I downloaded the “pg\_srgtools” scripts for NEI2017 from google drive ([https://drive.google.com/drive/u/0/folders/1tQViUa6b\_GAVxgK4hG60ZuWDlSzS-omw](https://drive.google.com/drive/u/0/folders/1tQViUa6b_GAVxgK4hG60ZuWDlSzS-omw)). The problem is that I couldn’t find the “/util/” folder within the provided pg\_srgtools 2017 platform. Since the “load\_shapefile\_reproject\_multi.csh” and “load\_shapefile.csh” are different for 2014 and 2017, would you please send me the “/util/” folder including those script for shapefile2017?

---

<div class="post-metadata">

### Author: ![eyth.alison](https://avatars.discourse-cdn.com/v4/letter/e/7ab992/32.png) [@eyth.alison](https://forum.cmascenter.org/u/eyth.alison)
#### Post date: [March 25, 2021, 3:13am UTC](https://forum.cmascenter.org/t/spatial-surrogate-codes-6831-6832-and-6833/2179/4 "2021-03-25T03:13:11Z")

</div>

Here are two files that might help if they get attached properly.

[load\_shapefile.2017\_csh.txt](https://forum.cmascenter.org/uploads/short-url/cC0WPTYmMTSWwM8emwZeccAHDlO.txt) (9.42 KB)

[load\_shapefile\_reproject\_multi.2017\_csh.txt](https://forum.cmascenter.org/uploads/short-url/gdhO3zxle0fnoeopPDGv3nUSa5W.txt) (11 KB)

---

<div class="post-metadata">

### Author: ![ali.mousavi.nezhad90](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.cmascenter.org/ali.mousavi.nezhad90/32/1527_2.png) [@ali.mousavi.nezhad90](https://forum.cmascenter.org/u/ali.mousavi.nezhad90)
#### Post date: [March 25, 2021, 5:38pm UTC](https://forum.cmascenter.org/t/spatial-surrogate-codes-6831-6832-and-6833/2179/5 "2021-03-25T17:38:21Z")

</div>

Thank you so much.  
I could not find “ntad\_2017\_county\_pol” shapefile. Would you mind letting me know where can I find it?

---

<div class="post-metadata">

### Author: ![eyth.alison](https://avatars.discourse-cdn.com/v4/letter/e/7ab992/32.png) [@eyth.alison](https://forum.cmascenter.org/u/eyth.alison)
#### Post date: [March 25, 2021, 7:53pm UTC](https://forum.cmascenter.org/t/spatial-surrogate-codes-6831-6832-and-6833/2179/6 "2021-03-25T19:53:23Z")

</div>

At the current time, the ntad\_2017\_county\_pol is not packaged with 2017. It is available as part of the 2016 surrogates as NTAD\_2014.

The NTAD\_2017\_County\_Pol table was directly created as a table in the PostgreSQL database based on the NTAD\_2014\_County\_Pol shapefile, which had been loaded as part of the 2016 platform.

The current SurrogateToolsDB GitHub page is based on the 2016 platform, so the [util/load\_shapefile\_reproject\_multi.csh](https://gcc02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FCEMPD%2FSurrogateToolsDB%2Fblob%2Fmaster%2Futil%2Fload_shapefile_reproject_multi.csh&data=04%7C01%7CEyth.Alison%40epa.gov%7Cde5f4b95d82b4471bd3608d8d2b5f0e3%7C88b378b367484867acf976aacbeca6a7%7C0%7C0%7C637491026161828392%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=SauiNqhHqoucHZjlR%2FgZZEkpd6cJJ%2B%2FYw%2FJFGLLVMbo%3D&reserved=0) script can be used to load the NTAD\_2014\_County\_Pol shapefile. Uncomment “source load\_shapefile.csh” at line 57.

The archive pg\_srgcreate\_2020.tar.gz has the updated scripts for the 2017 platform. In pg\_srgcreate/pg\_srgtools/CONUS/util/load\_shapefile\_reproject\_multi.csh, uncomment line 92. When load\_shapefile.csh runs, it won’t try to read a shapefile from disk, instead it will create a new table from the ntad\_2014\_county\_pol table, with updated FIPS codes for 2017.

There were two FIPS changes from 2014/2016 platforms to 2017:

46113 Shannon, SD à 46102 Oglala Lakota, SD

02270 Wade Hampton, AK à 02158 Kusilvak, AK

You don’t necessarily need to take the above approach – if you have a Shapefile editor you could instead make the two substitutions to the NTAD 2014 Shapefile.

Or you can use the 2014 Shapefile as is and just substitute the FIPS in the output of the surrogate tool.

---

<div class="post-metadata">

### Author: ![ali.mousavi.nezhad90](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.cmascenter.org/ali.mousavi.nezhad90/32/1527_2.png) [@ali.mousavi.nezhad90](https://forum.cmascenter.org/u/ali.mousavi.nezhad90)
#### Post date: [April 16, 2021, 12:35am UTC](https://forum.cmascenter.org/t/spatial-surrogate-codes-6831-6832-and-6833/2179/7 "2021-04-16T00:35:45Z")

</div>

I couldn’t find “tl2019Counties\_LCC\_WRF” and “PRODUCED\_WATER\_CBM\_CONUS\_2016” shapefiles and their shapefile catalog characteristics. Would you please post them here or let me know where I can find them?

---

<div class="post-metadata">

### Author: ![eyth.alison](https://avatars.discourse-cdn.com/v4/letter/e/7ab992/32.png) [@eyth.alison](https://forum.cmascenter.org/u/eyth.alison)
#### Post date: [April 16, 2021, 3:25am UTC](https://forum.cmascenter.org/t/spatial-surrogate-codes-6831-6832-and-6833/2179/8 "2021-04-16T03:25:32Z")

</div>

Check here:

ftp://newftp.epa.gov/Air/emismod/2016/alpha/spatial\_surrogates/shapefiles/

or here:

[https://drive.google.com/drive/folders/1idGoi6I3GvKFCcf87O\_8zMirM7Gtd0\_E](https://drive.google.com/drive/folders/1idGoi6I3GvKFCcf87O_8zMirM7Gtd0_E)

---

<div class="post-metadata">

### Author: ![ali.mousavi.nezhad90](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.cmascenter.org/ali.mousavi.nezhad90/32/1527_2.png) [@ali.mousavi.nezhad90](https://forum.cmascenter.org/u/ali.mousavi.nezhad90)
#### Post date: [April 16, 2021, 6:46pm UTC](https://forum.cmascenter.org/t/spatial-surrogate-codes-6831-6832-and-6833/2179/9 "2021-04-16T18:46:20Z")

</div>

Thank you for your response. I could find the “ProducedWater\_CBM” shapefile using the links you provided. However, I still cannot find the “tl2019Counties\_LCC\_WRF” shapefile.

---

<div class="post-metadata">

### Author: ![eyth.alison](https://avatars.discourse-cdn.com/v4/letter/e/7ab992/32.png) [@eyth.alison](https://forum.cmascenter.org/u/eyth.alison)
#### Post date: [April 19, 2021, 1:15pm UTC](https://forum.cmascenter.org/t/spatial-surrogate-codes-6831-6832-and-6833/2179/10 "2021-04-19T13:15:33Z")

</div>

The tl2019Counties is available from [https://www.census.gov/geographies/mapping-files/time-series/geo/tiger-line-file.2019.html](https://gcc02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.census.gov%2Fgeographies%2Fmapping-files%2Ftime-series%2Fgeo%2Ftiger-line-file.2019.html&data=04%7C01%7CEyth.Alison%40epa.gov%7C2fa64c516e2642116a9508d903349b3b%7C88b378b367484867acf976aacbeca6a7%7C0%7C0%7C637544346740733373%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=54zfqGvJfB8fp0hmFvWHyauqGMdHQmKl0WnSoF776go%3D&reserved=0)

Although that version is not projected to LCC\_WRF. This shouldn’t matter if you properly describe the file’s map projection to the surrogate generation tool – either when you load it to Postgres for the PostgreSQL version, or properly set the PROJ.4 string in the Shapefile catalog file.

---

<div class="post-metadata">

### Author: ![eyth.alison](https://avatars.discourse-cdn.com/v4/letter/e/7ab992/32.png) [@eyth.alison](https://forum.cmascenter.org/u/eyth.alison)
#### Post date: [April 21, 2021, 7:41pm UTC](https://forum.cmascenter.org/t/spatial-surrogate-codes-6831-6832-and-6833/2179/11 "2021-04-21T19:41:23Z")

</div>

If you haven’t found this file yet based on the previous info, I’ve uploaded the Shapefile to here:

[https://gaftp.epa.gov/air/emismod/2016/alpha/spatial\_surrogates/shapefiles/tl2019Counties\_LCC\_WRF.zip](https://gaftp.epa.gov/air/emismod/2016/alpha/spatial_surrogates/shapefiles/tl2019Counties_LCC_WRF.zip)

---

<div class="post-metadata">

### Author: ![ali.mousavi.nezhad90](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.cmascenter.org/ali.mousavi.nezhad90/32/1527_2.png) [@ali.mousavi.nezhad90](https://forum.cmascenter.org/u/ali.mousavi.nezhad90)
#### Post date: [April 21, 2021, 7:50pm UTC](https://forum.cmascenter.org/t/spatial-surrogate-codes-6831-6832-and-6833/2179/12 "2021-04-21T19:50:35Z")

</div>

It would be helpful, thank you!

---

<div class="post-metadata">

### Author: ![ali.mousavi.nezhad90](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.cmascenter.org/ali.mousavi.nezhad90/32/1527_2.png) [@ali.mousavi.nezhad90](https://forum.cmascenter.org/u/ali.mousavi.nezhad90)
#### Post date: [June 7, 2021, 3:14pm UTC](https://forum.cmascenter.org/t/spatial-surrogate-codes-6831-6832-and-6833/2179/13 "2021-06-07T15:14:17Z")

</div>

Hi @eyth.alison

I have a question regarding the new Spatial Allocator tool. I’m running the Postgres SA to make spatial surrogates for an arbitrary domain. The issue is that surrogates 321, 340, and 350 take a huge time to be made (for domain grid size 394\*322, it took more than two weeks!). Is it normal? Is it possible to run the tool with multiple processors?  
My system’s CPU configuration is Intel(R) Xeon(R) Silver 4214 CPU @ 2.20GHz.

---

<div class="post-metadata">

### Author: ![eyth.alison](https://avatars.discourse-cdn.com/v4/letter/e/7ab992/32.png) [@eyth.alison](https://forum.cmascenter.org/u/eyth.alison)
#### Post date: [June 7, 2021, 8:46pm UTC](https://forum.cmascenter.org/t/spatial-surrogate-codes-6831-6832-and-6833/2179/14 "2021-06-07T20:46:07Z")

</div>

On our computer it takes about two days to run each of those surrogates. You may want to investigate your Postgres configuration. Did you try to run them concurrently or at the same time? (I’m not sure off-hand if the tool kicks off more than one surrogate at a time).

Do you have multiple processors available? I can ask around about how to access additional processors.

---

<div class="post-metadata">

### Author: ![ali.mousavi.nezhad90](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.cmascenter.org/ali.mousavi.nezhad90/32/1527_2.png) [@ali.mousavi.nezhad90](https://forum.cmascenter.org/u/ali.mousavi.nezhad90)
#### Post date: [June 7, 2021, 9:55pm UTC](https://forum.cmascenter.org/t/spatial-surrogate-codes-6831-6832-and-6833/2179/15 "2021-06-07T21:55:19Z")

</div>

Once I used the former Spatial Allocator tool, it took 2 days, but now it takes much longer and I have no idea why!  
I’m running SA to make surrogates one by one. And, yes, I can use multiple processors if applicable.

---

<div class="post-metadata">

### Author: ![eyth.alison](https://avatars.discourse-cdn.com/v4/letter/e/7ab992/32.png) [@eyth.alison](https://forum.cmascenter.org/u/eyth.alison)
#### Post date: [June 10, 2021, 6:18pm UTC](https://forum.cmascenter.org/t/spatial-surrogate-codes-6831-6832-and-6833/2179/16 "2021-06-10T18:18:46Z")

</div>

Hi, It is not a problem to use the old tool if it is working on your computer.

However, here are some postgres configuration updates we made to give PG access to more RAM and some of these may help you:

**_shared\_buffers = 1280MB # min 128kB - the appropriate value depends on your system configuration_**

_# (change requires restart)_

_#huge\_pages = try # on, off, or try_

_# (change requires restart)_

_#temp\_buffers = 8MB # min 800kB_

_#max\_prepared\_transactions = 0 # zero disables the feature_

_# (change requires restart)_

_# Caution: it is not advisable to set max\_prepared\_transactions nonzero unless_

_# you actively intend to use prepared transactions._

**_work\_mem = 24MB # min 64kB_**

**_maintenance\_work\_mem = 256MB # min 1MB_**

_#autovacuum\_work\_mem = -1 # min 1MB, or -1 to use maintenance\_work\_mem_

_#max\_stack\_depth = 2MB # min 100kB_

_#shared\_memory\_type = mmap # the default is the first option_

_# supported by the operating system:_

_# mmap_

_# sysv_

We’d be interested to know if you find changing some of these helps improve performance.

We will be doing some tests on our systems over the next couple of weeks.

---

<div class="post-metadata">

### Author: ![ali.mousavi.nezhad90](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.cmascenter.org/ali.mousavi.nezhad90/32/1527_2.png) [@ali.mousavi.nezhad90](https://forum.cmascenter.org/u/ali.mousavi.nezhad90)
#### Post date: [September 16, 2022, 3:31pm UTC](https://forum.cmascenter.org/t/spatial-surrogate-codes-6831-6832-and-6833/2179/17 "2022-09-16T15:31:16Z")

</div>

@eyth.alison  
I couldn’t find the “gpw-v4-popcount2015-mexico” shapefile on google drive. Could you please upload it?

---

<div class="post-metadata">

### Author: ![eyth.alison](https://avatars.discourse-cdn.com/v4/letter/e/7ab992/32.png) [@eyth.alison](https://forum.cmascenter.org/u/eyth.alison)
#### Post date: [September 16, 2022, 3:47pm UTC](https://forum.cmascenter.org/t/spatial-surrogate-codes-6831-6832-and-6833/2179/18 "2022-09-16T15:47:32Z")

</div>

Unfortunately we cannot find this Shapefile. At some point it will be recreated, but probably not until later in the fall.

This is the data source if you want to try to make one yourself:

[https://sedac.ciesin.columbia.edu/data/set/gpw-v4-population-count-rev11](https://gcc02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fsedac.ciesin.columbia.edu%2Fdata%2Fset%2Fgpw-v4-population-count-rev11&data=05%7C01%7CEyth.Alison%40epa.gov%7Caf61bbbde36a410f7f2508da81fac91b%7C88b378b367484867acf976aacbeca6a7%7C0%7C0%7C637965211382951303%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=FcnZ3RIAR9YZNesViCSB3we%2BxzjOzRwjBaI7rdzkJ1M%3D&reserved=0)

---

<div class="post-metadata">

### Author: ![copycky28](https://avatars.discourse-cdn.com/v4/letter/c/3be4f8/32.png) [@copycky28](https://forum.cmascenter.org/u/copycky28)
#### Post date: [October 11, 2023, 10:18pm UTC](https://forum.cmascenter.org/t/spatial-surrogate-codes-6831-6832-and-6833/2179/20 "2023-10-11T22:18:57Z")

</div>

Hi Alison, I also found that I need these files, do you happen to have these files uploaded to google drive?

---

<div class="post-metadata">

### Author: ![eyth.alison](https://avatars.discourse-cdn.com/v4/letter/e/7ab992/32.png) [@eyth.alison](https://forum.cmascenter.org/u/eyth.alison)
#### Post date: [October 12, 2023, 12:25am UTC](https://forum.cmascenter.org/t/spatial-surrogate-codes-6831-6832-and-6833/2179/21 "2023-10-12T00:25:54Z")

</div>

Apologies but we do not have this Shaepefile – we looked for it. As I mention in the other email it could be recreated.

[Next page](https://forum.cmascenter.org/t/spatial-surrogate-codes-6831-6832-and-6833/2179.md?page=2)
