[gdal-dev] Coordinate Transformation problems

Christiaan Janssen cjanssen at iavo-rs.com
Mon Feb 25 16:43:33 EST 2008


I realize that PROJ.4's datum shift is only two dimensional with respect to a NAD27 to NAD83 shift but what this case is doing is really just a unit conversion. Both spatial reference systems are the same except for the linear unit, one is in feet the other meters. The conversion is resulting in the horizontal components being translated but the z component is left unchanged. Shouldn't it at least be converted to the appropriate units (1210ft -> 369m) to conform with the other two dimensions? Or is this something I will have to handle on my own?

Christiaan


-----Original Message-----
From: Frank Warmerdam [mailto:warmerdam at pobox.com] 
Sent: Monday, February 25, 2008 4:15 PM
To: Christiaan Janssen
Cc: gdal-dev at lists.osgeo.org
Subject: Re: [gdal-dev] Coordinate Transformation problems

Christiaan Janssen wrote:
> I've been having a problem with coordinate transformation that I 
> truely hope is a mistake on my part, if anyone can help it would be 
> greatly appreciated. The issue is that when doing a translation from 
> one system to another the z-component is not being transformed 
> correctly (or at least not how I would expect it). The transformation 
> is between two identical systems but with different linear units. I 
> have attached a snippet of code the examples my problem:
>  
> int err;
> double x, y, z;
> OGRCoordinateTransformation* ctTrans;
> OGRSpatialReference* srFeet = new OGRSpatialReference();
> OGRSpatialReference* srMeter = new OGRSpatialReference();
> srFeet->SetStatePlane(3200, 1, SRS_UL_US_FOOT,
> atof(SRS_UL_US_FOOT_CONV)); //NAD83 North Carolina
> srMeter->SetStatePlane(3200, 1, SRS_UL_METER, 1.0); //NAD83 North 
> srMeter->Carolina
> ctTrans = OGRCreateCoordinateTransformation(srFeet, srMeter); x = 
> 618067.37752800086; y = 248532.06376793334; z = 1210.7631359994411; 
> err = ctTrans->Transform(1, &x, &y, &z); //Results from function call 
> //x = 188387.31344515912 <-Correct //y = 75752.724541875374 <-Correct 
> //z = 1210.7631359994411 <-Unchanged and I therefore I think wrong 
> //err = 1

Christiaan,

Can you explain what change you are expecting in Z and why?

PROJ.4 uses NAD27/NAD83 datum grid shift files to go from NAD27 to NAD83, but this is strictly a 2D transformation.  There is no Z component.

If, instead, we were using a 3/7 parameter towgs84= value to transform, the opreration would be done in "geocentric space" and would also affect the Z coordinate.  But I doubt that would really be desirable in this case.

Best regards,
-- 
---------------------------------------+--------------------------------
---------------------------------------+------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | President OSGeo, http://osgeo.org





More information about the gdal-dev mailing list