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

Chris Waigl cwaigl at alaska.edu
Tue Jan 31 12:02:05 PST 2017




> On Jan 31, 2017, at 7:46 AM, Niels.vonFestenberg-Packisch.ext at rohde-schwarz.com wrote:
> 
> 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 


Your Result 1 is 15.0° and 56.0° respectively, in radians. 

Chris

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


More information about the gdal-dev mailing list