# Error in pg\_srgtools

**URL:** <https://forum.cmascenter.org/t/error-in-pg-srgtools/1973>\
**Category:** Spatial Allocator\
**Created:** [December 8, 2020, 5:37pm UTC](https://forum.cmascenter.org/t/error-in-pg-srgtools/1973 "2020-12-08T17:37:00Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![haohe.umcp](https://avatars.discourse-cdn.com/v4/letter/h/b19c9b/32.png) [@haohe.umcp](https://forum.cmascenter.org/u/haohe.umcp)\
**Post date:** [December 8, 2020, 5:37pm UTC](https://forum.cmascenter.org/t/error-in-pg-srgtools/1973/1 "2020-12-08T17:37:01Z")

</div>

Dear all,

I followed the instruction and set-up the postgres. I tried to generate the 100 surrogate. The program runs (please see the attached file), but shows some errors like

psql:./output/EUS4k\_502x418/temp\_files/100\_create\_wp\_cty\_cell.sql:9: ERROR: relation “public.wp\_cty\_cell\_100\_EUS4k” does not exist

I think I didn’t set-up something correct. I also attached the ‘surrogate\_generation’ and ‘surrogate\_specification’ files. Any comments or suggestions are welcome.

Hao

[srg\_EUS4k.txt](https://forum.cmascenter.org/uploads/short-url/5eeA5ImK98cQ7ioVwVCVBkdsgxu.txt) (6.2 KB) [surrogate\_generation\_pg.csv](https://forum.cmascenter.org/uploads/short-url/p8svkc4QOcumQh2VsPK9wbJ6Xus.csv) (7.8 KB) [surrogate\_specification\_pg.csv](https://forum.cmascenter.org/uploads/short-url/1BXldPnZ7VsJFbsZqOiAkGPN91T.csv) (21.3 KB)

---

<div class="post-metadata">

**Author:** ![haohe.umcp](https://avatars.discourse-cdn.com/v4/letter/h/b19c9b/32.png) [@haohe.umcp](https://forum.cmascenter.org/u/haohe.umcp)\
**Post date:** [December 9, 2020, 11:44pm UTC](https://forum.cmascenter.org/t/error-in-pg-srgtools/1973/2 "2020-12-09T23:44:32Z")

</div>

forgot to mention that. the ‘pg-srgtools’ was ok to generate the consu12 surrogate of 100 with the default code and surrogate inputs. I create my own Eastern US 4-km domain, and it should be something needs to be modified in these csv files, which caused the problem.

Hao

---

<div class="post-metadata">

**Author:** ![dyang](https://avatars.discourse-cdn.com/v4/letter/d/dbc845/32.png) [@dyang](https://forum.cmascenter.org/u/dyang)\
**Post date:** [December 10, 2020, 2:01am UTC](https://forum.cmascenter.org/t/error-in-pg-srgtools/1973/3 "2020-12-10T02:01:45Z")

</div>

Did you import your new domain to database by modifying script generate\_modeling\_grid.sh under util directory?

---

<div class="post-metadata">

**Author:** ![dyang](https://avatars.discourse-cdn.com/v4/letter/d/dbc845/32.png) [@dyang](https://forum.cmascenter.org/u/dyang)\
**Post date:** [December 10, 2020, 2:02am UTC](https://forum.cmascenter.org/t/error-in-pg-srgtools/1973/4 "2020-12-10T02:02:44Z")

</div>

For domain name in database, it better to use lower cases.

---

<div class="post-metadata">

**Author:** ![haohe.umcp](https://avatars.discourse-cdn.com/v4/letter/h/b19c9b/32.png) [@haohe.umcp](https://forum.cmascenter.org/u/haohe.umcp)\
**Post date:** [December 10, 2020, 10:42pm UTC](https://forum.cmascenter.org/t/error-in-pg-srgtools/1973/5 "2020-12-10T22:42:29Z")

</div>

Thanks for these two comments. I changed the domain name to lower cases, and here is my ‘generate\_modeling\_grid.sh’ set-up.

######################################################################

# ‘EUS4k\_502x418’

# ‘EUS4k’ 304000.000 -848000.000 4000.000 4000.000 502 418 1

tblname=‘eus4k’ # name of table in schema

proj=900921 # value of srid in spatial\_ref\_sys data table  
xorig=304000 # x-coordinate of lower-left corner (LLC) of grid  
yorig=-848000 # y-coordinate of LLC of grid  
xcellsize=4000 # cell size in x-direction  
ycellsize=4000 # cell size in y-direction  
cols=502 # number of columns (x)  
rows=418 # number of rows (y)
