[gdal-dev] Question in orthographic projection usage with PROJ4

Niels.vonFestenberg-Packisch.ext at rohde-schwarz.com Niels.vonFestenberg-Packisch.ext at rohde-schwarz.com
Tue Jan 31 08:46:15 PST 2017


Hi all, 
I would like to transform local cartesian coordinates into longitude and 
latitude. According to all the documentation I could find, I tried doing 
this (in C++, specifying a center for the orthographic projection at 56 N 
15 E): 

projPJ cSourceProjection = pj_init_plus("+proj=ortho +ellps=WGS84 
+datum=WGS84 +lat_0=56 +lon_0=15 +no_defs");
projPJ cTargetProjection = pj_init_plus("+proj=longlat +ellps=WGS84 
+datum=WGS84 +no_defs");
projXY pt;
// 1
pt.u = 0; pt.v = 0; 
pj_transform( cSourceProjection, cTargetProjection, 1, 0, &pt.u, &pt.v, 0 
);
printf ("Result 1: %2.6f %2.6f", pt.u, pt.v); 
// 2
pt.u = 0; pt.v = 111120; 
pj_transform( cSourceProjection, cTargetProjection, 1, 0, &pt.u, &pt.v, 0 
);
printf ("Result 2: %2.6f %2.6f", pt.u, pt.v); 

--> Delivers : 
Result 1: 0.26180 0.97738 
Result 2: 0.29295 0.97716
 
However, I would like to get something like 
"Result 1: 56.0.. 15.0.." (i.e. the projection center itself, no matter 
what scaling there might be) and 
"Result 2: 57.0.. 15.." (if pt is interpreted in meters) 
- at least anything that resembles reasonable longitude and latitude 
values, but I don't...

Could you maybe give me a hint what is going wrong here? 

Thank you in advance for any help!

Regards
Niels







-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20170131/a3a345eb/attachment.html>


More information about the gdal-dev mailing list