From 26c94c20dc2a8b78a12c2fae9ce7110fe075ef51 Mon Sep 17 00:00:00 2001 From: Piyush Agram Date: Fri, 30 Oct 2015 17:34:17 -0700 Subject: Order of lat/lon is interpreted correctly for SCH --- src/PJ_sch.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/PJ_sch.c b/src/PJ_sch.c index 5571deb3..9a0120fe 100644 --- a/src/PJ_sch.c +++ b/src/PJ_sch.c @@ -79,8 +79,8 @@ INVERSE3D(inverse3d); temp, temp+1, temp+2); - lpz.lam = temp[0] ; - lpz.phi = temp[1] ; + lpz.lam = temp[1] ; + lpz.phi = temp[0] ; lpz.z = temp[2]; // printf("INVERSE: \n"); @@ -93,11 +93,13 @@ FORWARD3D(forward3d); double temp[3]; double pxyz[3]; + //Convert lat lon to geocentric coordinates - if( pj_Convert_Geodetic_To_Geocentric( &(P->elp_0), lpz.lam, lpz.phi, lpz.z, + if( pj_Convert_Geodetic_To_Geocentric( &(P->elp_0), lpz.phi, lpz.lam, lpz.z, temp, temp+1, temp+2 ) != 0 ) F3_ERROR; + //Adjust for offset temp[0] -= P->xyzoff[0]; temp[1] -= P->xyzoff[1]; @@ -113,6 +115,7 @@ FORWARD3D(forward3d); pj_Convert_Geocentric_To_Geodetic( &(P->sph), pxyz[0], pxyz[1], pxyz[2], temp, temp+1, temp+2); + //Scale by radius xyz.x = temp[1] * P->rcurv / P->a; xyz.y = temp[0] * P->rcurv / P->a; -- cgit v1.2.3