1

My question is about the best way to convert from NAD 83 to WGS 84 in PostGIS.

I have a PostGIS DB containing National Elevation Data rasters. The rasters are in NAD 83 and I would like to convert them to WGS 84 but PostGIS treats NAD 83 and WGS 84 as the same (see here and here) even though they may differ by over a meter.

I figure that I can just add a new spatial reference identifier with non-zero values for the transformation to WGS 84. So basically this below except with TOWGS84[0,0,0,0,0,0,0] replaced with the correct values.

INSERT INTO "spatial_ref_sys" ("srid","auth_name","auth_srid","srtext","proj4text") VALUES (9999,'EPSG',4269,'GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101,AUTHORITY["EPSG","7019"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY["EPSG","6269"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4269"]]','+proj=longlat +datum=NAD83 +no_defs ');

The problem is that I can't find what those values should be, as in both what the values should refer to and what the value of the values are.

Ellis Valentiner
  • 393
  • 4
  • 18
  • It's going to depend on which NAD83 and which ITRF (WGS84) you're using. You can find some possibilities on the NGS CORS site. – mkennedy Jun 22 '15 at 16:29
  • @mkennedy Thanks. I think I want to use something comparable to ESRI's 'NAD_1983_To_WGS_1984_5' since that seems to be the latest. I should be able to track those values down but do you know what the correct ordering of the parameters are for PostGIS? I don't want to screw up my projections because I had the right numbers in the wrong order. – Ellis Valentiner Jun 22 '15 at 17:28
  • I'm assuming that TOWGS84 matches PROJ.4's definition. The latter uses Position Vector aka EPSG:9606. #5 which came from the CORS site, uses Coordinate Frame, EPSG:9607. Anyway, TOWGS84=-0.991,1.9072,0.5129,0.0257899,0.0096501,0.01165994,0.0 – mkennedy Jun 22 '15 at 18:18
  • Thanks again. These values are different from what I saw on the NGS CORS site above but perhaps I was looking in the wrong place. – Ellis Valentiner Jun 22 '15 at 18:21
  • They're older, based on ITRF96. The ones from the current CORS site are using NAD83(2011) and ITRF2008 and would be: -0.99343, -1.90331,-0.52655, 0.02591467, 0.00942645, 0.01159935, 0.00171504 – mkennedy Jun 22 '15 at 18:28
  • 1
    Note that you'll want the to_wgs84 into in both the proj4text and srtext or things won't work as you want. – Paul Ramsey Jun 24 '15 at 12:44
  • Thanks @PaulRamsey I noticed this when inserting a new SRID. I'm now trying to think of a way to validate that the transformation is "correct". – Ellis Valentiner Jun 24 '15 at 14:53

0 Answers0