Opened 15 years ago

Closed 10 years ago

#2704 closed defect (invalid)

Error in transforming NAD27 - NAD83

Reported by: dmalav Owned by: warmerdam
Priority: high Milestone:
Component: OGR_SRS Version: 1.4.2
Severity: critical Keywords:
Cc:

Description

Hi,

I am trying to use close to the following code for transforming from Lat-Long NAD27 to NAD83.

OGRSpatialReference oSource, oTarget;

OGRCoordinateTransformation *poC;

double x, y;

oSource.SetWellKnownGeogCS( "EPSG:4267" );

oTarget.importFromEPSG(26954);

char *projWk;

oSource.exportToWkt((char ) &projWk); if(projWk) printf("\nSource Projection: %s\n", projWk); free(projWk);

oTarget.exportToWkt((char ) &projWk); if(projWk) printf("\nTarget Projection: %s\n", projWk); free(projWk);

poC = OGRCreateCoordinateTransformation( &oSource, &oTarget );

x = -108.754049; y = 39.374959;

if( poC == NULL
!poC->Transform( 1, &x, &y ) )

printf( "Transformation failed.\n" );

else

printf( "(-108.754049,39.374959) -> (%f,%f)\n", x, y );

double x1 = -108.620719; double y1= 39.499970;

if( poC == NULL
!poC->Transform( 1, &x1, &y1 ) )

printf( "Transformation failed.\n" );

else

printf( "(-108.620719,39.499970) -> (%f,%f)\n", x1, y1 );

/

This does not fail but gives me wrong answer. Notice how it converts two different LL to same values. Some times when I transform from Nad27 to Nad83 it gives error: failed to load NAD27-83 correction file

Source Projection: GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.9786982139006,AUTHORITY["EPSG","7008"]],AUTHORITY["EPSG","62 67"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.01745329251 994328,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4267"]]

Target Projection: PROJCS["NAD83 / Colorado Central",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101,AUTHORITY["EPSG","7019"]],AUTHORITY["EPSG","6269"]], PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.01745329251994328 ,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4269"]],PROJECTION["Lambert_Conform al_Conic_2SP"],PARAMETER["standard_parallel_1",39.75],PARAMETER["standard_parall el_2",38.45],PARAMETER["latitude_of_origin",37.83333333333334],PARAMETER["centra l_meridian",-105.5],PARAMETER["false_easting",914401.8289],PARAMETER["false_nort hing",304800.6096],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AUTHORITY["EPSG","26 954"]] (-108.754049,39.374959) -> (12397693.447586,3319416.339373) (-108.620719,39.499970) -> (12397693.447586,3319416.339373)

Any help is much appreciated. Thanks, Dinesh

Change History (4)

comment:1 by dmalav, 15 years ago

Hi,

The actual error I am getting is "failed to load NAD27-83 correction file". I see this is an error returned by pfn_pj_transform but I am not sure why I am getting this error. It transforms NAD27-NAD27 just fine.

Thanks for help.

comment:2 by Kyle Shannon, 14 years ago

This isn't a GDAL issue, it is proj. See:

http://trac.osgeo.org/proj/

under datum shift grids. Follow the instructions there.

comment:3 by Jukka Rahkonen, 10 years ago

Perhaps this can be closed as invalid if the reason for the trouble was in a wrong path of the datum shift file.

comment:4 by Even Rouault, 10 years ago

Resolution: invalid
Status: newclosed
Note: See TracTickets for help on using tickets.