Added osgTerrain::EllipsodeTransform helper class for converting to and from

lat, long, height to geocentric X,Y,Z and back.
This commit is contained in:
Robert Osfield
2004-03-31 15:50:30 +00:00
parent 663801c0c8
commit b67858f388
3 changed files with 88 additions and 18 deletions

View File

@@ -78,6 +78,24 @@ char *SanitizeSRS( const char *pszUserInput )
}
void ellipsodeTransformTest(double latitude, double longitude, double height)
{
osgTerrain::EllipsodeTransform transform;
double X,Y,Z;
double newLat, newLong, newHeight;
transform.convertLatLongHeightToXYZ(latitude,longitude,height,
X,Y,Z);
transform.convertXYZToLatLongHeight(X,Y,Z,
newLat,newLong,newHeight);
std::cout<<"lat = "<<osg::RadiansToDegrees(latitude)<<"\tlong="<<osg::RadiansToDegrees(longitude)<<"\t"<<height<<std::endl;
std::cout<<"X = "<<X<<"\tY="<<Y<<"\tZ="<<Z<<std::endl;
std::cout<<"lat = "<<osg::RadiansToDegrees(newLat)<<"\tlong="<<osg::RadiansToDegrees(newLong)<<"\t"<<newHeight<<std::endl;
}
int main( int argc, char **argv )
{