Adding a new projection to the database: SurrogateDB

Hi,

I am trying to generate surrogates for a domain that covers parts of both Canada and the US. I got the test case running in the surrogateDB tool. Now that our domain is defined in lat-lon projection (GRIDDESC is shown below) I wonder how I can generate a script similar to create_900921.sql.
I found projected coordinate system info here Projected Coordinate Systems. But I have no clue which suits us.

Please help me figure this out. Thanks a lot.

Sham

PS: I also tried to use the new shapefiles in the previous surrogate tool and it all failed.

‘QC27km’ ! 2 lines: name; xorig,yorig,xcell,ycell,ncols,nrows,nthik
‘LATLON’,-81.07825, 39.88733, 0.347359, 0.242817, 42, 45, 1
‘QC9km’
‘LATLON’,-78.46176, 42.307766, 0.116012, 0.080939, 82, 83, 1
‘QC3km’
‘LATLON’,-76.45407, 43.52049, 0.038758, 0.02698, 156, 173, 1
‘MO1km’
‘LATLON’, -74.091009999999997, 45.210844999999999, 0.012979, 0.008993, 60, 60, 1
‘QC1km’
‘LATLON’, -71.417335999999992, 46.685696999999998, 0.012979, 0.008993, 22, 24, 1
’ ’ ! end grids.

Make sure that the “LATLON” entry in the projection section of your GRIDDESC file looks like:
“‘LATLON’

1, 0, 0, 0, 0, 0”

In proj4 you can simply put:

“+proj=latlon” or use EPSG 4326

We’ve run the surrogate tool for lat/lon domains and did not need to add the 4326 EPSG using a script like create_900921.sql.

We simply defined the proj variable as 4326 when we edited the generate_modeling_grid.sh script.

Thanks for the help. This suggestion worked for me.

When I am running the load_shapefile_reproject_multi.2017.csh script I am receiving the following error

ERROR: could not form projection (LWPROJ) from ‘srid=4269’ to ‘srid=94326’

Can you please help me out fixing this issue as well? thanks a lot.
Sham

I had the same error while running the example as well. Even though the script finished okay the surrogates were empty. I am using GDAL 3.3.3 version and postgresql 14.

Hi,

I ended up reinstalling everything. I did not use a sql script to add the lat/lon grid. Instead, I edited the generate_modeling_grid.sh script and insert SRID = 4326. Then I received the following notice


MH-XPS1:~/SurrogateToolsDB/util> ./load_shapefile_reproject_multi.quickstart.csh
cb_2017_us_county_500k
Finished loading shapefile: /home/sham/SurrogateToolsDB/data/emiss_shp2017/Census/cb_2017_us_county_500k.shp
NOTICE: index “cb_2017_us_county_500k_geom_4326_idx” does not exist, skipping
MultiPolygon
acs2016_5yr_bg
Finished loading shapefile: /home/sham/SurrogateToolsDB/data/emiss_shp2017/Census/acs2016_5yr_bg.shp
NOTICE: index “acs2016_5yr_bg_geom_4326_idx” does not exist, skipping

Please help me to figure out this issue.

Thanks
Sham

Can you confirm the value of the srid variable at the top of the load_shapefile_reproject_multi.2017.csh script? It should be 4326 and not 94326.

yeah i have 4326 in there. In my previous version only i had it as 94326. sorry for the confusion.

Sorry, so are you still having the problem with that?

yes. when running the load shapefile script I receive the following notice.

NOTICE: index “acs2016_5yr_bg_geom_4326_idx” does not exist, skipping

Thanks.

The NOTICE messages when loading shapefiles are normal; the script tries to drop any existing indexes before creating them.

I see. thanks a lot. I managed to get it working :slight_smile: