<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.6000.20733" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=223144915-25022008><FONT face=Arial size=2>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:</FONT></SPAN></DIV>
<DIV><SPAN class=223144915-25022008><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=223144915-25022008><FONT face=Arial size=2>int
err;</FONT></DIV>
<DIV><FONT face=Arial size=2>double x, y, z;</FONT></DIV>
<DIV><FONT face=Arial size=2>OGRCoordinateTransformation* ctTrans;</FONT></DIV>
<DIV><FONT face=Arial size=2>OGRSpatialReference* srFeet = new
OGRSpatialReference();</FONT></DIV>
<DIV><FONT face=Arial size=2>OGRSpatialReference* srMeter = new
OGRSpatialReference();</FONT></DIV>
<DIV><FONT face=Arial size=2>srFeet->SetStatePlane(3200, 1, SRS_UL_US_FOOT,
atof(SRS_UL_US_FOOT_CONV)); //NAD83 North Carolina</FONT></DIV>
<DIV><FONT face=Arial size=2>srMeter->SetStatePlane(3200, 1, SRS_UL_METER,
1.0); //NAD83 North Carolina</FONT></DIV>
<DIV><FONT face=Arial size=2>ctTrans = OGRCreateCoordinateTransformation(srFeet,
srMeter);</FONT></DIV>
<DIV><FONT face=Arial size=2>x = 618067.37752800086;</FONT></DIV>
<DIV><FONT face=Arial size=2>y = 248532.06376793334;</FONT></DIV>
<DIV><FONT face=Arial size=2>z = 1210.7631359994411;</FONT></DIV>
<DIV><FONT face=Arial size=2>err = ctTrans->Transform(1, &x, &y,
&z);</FONT></DIV>
<DIV><FONT face=Arial size=2>//Results from function call</FONT></DIV>
<DIV><FONT face=Arial size=2>//x = 188387.31344515912 <-Correct</FONT></DIV>
<DIV><FONT face=Arial size=2>//y = 75752.724541875374 <-Correct</FONT></DIV>
<DIV><FONT face=Arial><FONT size=2>//z = 1210.7631359994411 <-<SPAN
class=223144915-25022008>Unchanged and I therefore I think w</SPAN>rong<SPAN
class=223144915-25022008> </SPAN></FONT></FONT></DIV>
<DIV><FONT face=Arial size=2>//err = 1</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><SPAN class=223144915-25022008><FONT face=Arial size=2>Thanks for the
help,</FONT></SPAN></DIV>
<DIV><SPAN class=223144915-25022008><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=223144915-25022008><FONT face=Arial
size=2>Christiaan</FONT></SPAN></SPAN></DIV></BODY></HTML>