[PROJ] proj_angular_input

Kristian Evers kreve at sdfe.dk
Sat Feb 16 11:09:50 PST 2019



> On 16 Feb 2019, at 19:04, Even Rouault <even.rouault at spatialys.com> wrote:
> 
> On samedi 16 février 2019 06:57:10 CET Paul Ramsey wrote:
>> So, I create a PJ thusly:
>> 
>> pj = proj_create_crs_to_crs(NULL, "EPSG:4326", "EPSG:3005", NULL);
>> 
>> The from is clearly angular, the to is an albers projection in NAD83.
>> 
>> But
>> 
>> proj_angular_input(pj, PJ_FWD)
>> 
>> Does not return true?
>> 
>> Am I misunderstanding the meaning of proj_angular_input or of
>> forward/backward?
> 
> Hum, I guess we have some confusion here about the semantics of 
> proj_angular_input() and what the "new code" I added those months does.
> 
> proj_angular_input() returns true if the expected values are in radian, but 
> the pipeline returned by your above proj_create_crs_to_crs() invokation is
> 
> +proj=pipeline +step +proj=axisswap +order=2,1 +step +proj=unitconvert 
> +xy_in=deg +xy_out=rad +step +proj=aea +lat_0=45 +lon_0=-126 +lat_1=50 
> +lat_2=58.5 +x_0=1000000 +y_0=0 +ellps=GRS80
> 
> so it does the deg -> rad conversion, which causes the pipeline to not expect 
> radians, and thus return false in proj_angular_input()
> 
> Kristian, any idea what we should do ? The doc mentions "Check if a operation 
> expects angular input.", but we have code we really expect angular to mean 
> radian, such as in the proj utility that uses is to to deg to rad conversions.
> 

Yes. The documentation just need a bit of rewording and a history lesson:

Returns 1 if input is in radians. The name is silly because previous to PROJ 6
ALL angular units returned by PROJ was in radians - this is no longer the
case from version 6 and onwards.


> Even
> 
> -- 
> Spatialys - Geospatial professional services
> http://www.spatialys.com



More information about the PROJ mailing list