|
本人用osgEarth::SpatialReference::get方法定义epsg为4544的投影坐标系,想要转为WGS84坐标系,结果出问题了,希望大佬们不吝赐教,代码如下:
osgEarth::SpatialReference* utm =
//osgEarth::SpatialReference::get("epsg::4544");
osgEarth::SpatialReference::get("+proj=merc +epsg=4544 +units=m +no_defs");
osg::Vec3d outpoint;
osgEarth::GeoPoint wgspoint;
if(utm->isGeographic())
{
qDebug()<<"IS GEOGRAPHIC"<<endl;
}
else if(utm->isProjected())
{
qDebug()<<"IS PROJECTED"<<endl;
osg::Vec3d outXYZ(info.x, info.y, 0);
osgEarth::GeoPoint utmpoint(utm, outXYZ, osgEarth::AltitudeMode::ALTMODE_ABSOLUTE);
wgspoint = utmpoint.transform(s_mapNode->getMapSRS());
}
outpoint = wgspoint.vec3d();
double _x;
double _y;
double _z;
_x=outpoint.x();
_y=outpoint.y();
_z=info.z; |
|