参考网页
https://proj.org/operations/conversions/topocentric.html
经纬度,WGS84基准
const char* latlon="+proj=latlong +datum=WGS84";
地心坐标系,WGS84基准
const char* geoccs="+proj=geocent +datum=WGS84";
站心坐标系
const char* topoccs="+proj=topocentric +ellps=WGS84 +X_0=3652755.3058 +Y_0=319574.6799 +Z_0=5201547.3536";
注意:+X_0=3652755.3058 +Y_0=319574.6799 +Z_0=5201547.3536需要修改成自已想要的值
projPJ pjGeoccs, pjLatlon, pjTopoccs;
if(!(pjGeoccs= pj_init_plus(geoccs)))
return FALSE;
if(!(pjLatlon= pj_init_plus(latlon)))
return FALSE;
if(!(pjTopoccs= pj_init_plus(topoccs)))
return FALSE;
int iRev = pj_transform(pjLatlon, pjGeoccs, nPointCount, 1, x, y, z);
int iRev = pj_transform(pjGeoccs, pjTopoccs, nPointCount, 1, x, y, z);