[PROJ] Check if a definition if a cartographic projection

José Luis García Pallero jgpallero at gmail.com
Fri Feb 21 07:19:32 PST 2020


Thank you for your answer, Kristian. I've made some tests, and I have
more questions in order to clarification the task of detecting pure
cartographic projections (I understand as pure cartographic projection
a definition such that in the FWD step transforms geodetic coordinates
into projected XY coordinates and vice verda for the INV stap, always
using the ellipsoid stated in the definition, i.e., in any case a
transformation between ellipsoids is performed):

1. If I use a definition based on the "plus" form ("+proj=utm
+lon_0=3w +ellps=GRS80", i.e., UTM30, ellipsoid GRS80):

In all cases I've checked, the proj_get_type() function always returns
the identifier PJ_TYPE_OTHER_COORDINATE_OPERATION. Then, I use the
function proj_angular_input() with the PJ_FWD argument in order to
check for radians. So the couple
(PJ_TYPE_OTHER_COORDINATE_OPERATION,1) identifies a definition as a
pure cartographic projection, i.e. geodetic coordinates as input and
XY projected as output in PJ_FWD, and vice versa in PJ_INV. Is this
correct? From your previous message I understand that I won't catch
all situations like that, but most of them, but the question is: can
exist any situation of (PJ_TYPE_OTHER_COORDINATE_OPERATION,1) does not
corresponding to a pure cartographic projection?

I've tried also the +pipeline form you suggested "+proj=pipeline +step
+unitconvert +xy_in=rad +xy_out=deg +step +proj=<projection>" as

"+proj=pipeline +step +unitconvert +xy_in=rad +xy_out=deg +step
+proj=utm +lon_0=3w +ellps=GRS80"

in order to work with UTM30 using the GRS80 ellipsoid. Using this
definition I understand that in the FWD step the input coordinates are
defined in radians, but for the INV step the output mus be in degrees.
But when I execute proj_create() with the previous definition I obtain
the message "proj_create: Error -4: projection not named". Is there
any error in the definition?

2. If I use a definition based on the EPSG code:

I've used for example the "EPSG:25830", corresponding to ETRS89 UTM30,
i.e., the same projection as the previously used ("+proj=utm +lon_0=3w
+ellps=GRS80"). The proj_get_type() function returns the identifier
PJ_TYPE_PROJECTED_CRS. Is this type the unique identificator for a
pure cartographic projection? But in this case the
proj_angular_input() for FWD returns 0, so it means that the input
angular coordinates units are not radians. Am I right? But if I try
the projection I obtain always (Inf,Inf), whether if I use the data in
radians or in degrees. I suppose I've made a mistake, but I can't
understand where

Best regards

El vie., 21 feb. 2020 a las 13:42, Kristian Evers (<kreve at sdfe.dk>) escribió:
>
> Hi José
>
> Congrats on taking the big step towards PRO 6! As you've already found out
> there are a few changes in how to work with projections. I'll try to answer your
> questions:
>
> 1. I don't think so if you are strictly using proj_create(), but you can use
> proj_angular_input() and proj_angular_output() to check if the operation
> you've created with proj_create() behaves as a projection usually do:
> angular in, non-angular out. You won't catch all situations like that, but
> most of them.
> Alternatively you can use proj_create_crs_to_crs() and define the input
> and output CRS's in terms of EPSG-codes or WKT(2) definitions. In that
> case you can use proj_get_type() to get an idea about what you are dealing
> with.
>
> 2. If your operation purely consist of "+proj=<projection", then yes. If you
> expand that into a pipeline like
> "+proj=pipeline +step +unitconvert +xy_in=rad +xy_out=deg +step +proj=<projection>",
> then you can use degress.
>
> 3. Yes, that phrasing is incorrect and could be improved by mentioning ellipsoids
> as well.
>
> /Kristian
>
> -----Original Message-----
> From: PROJ <proj-bounces at lists.osgeo.org> On Behalf Of José Luis García Pallero
> Sent: 21. februar 2020 12:39
> To: proj at lists.osgeo.org
> Subject: [PROJ] Check if a definition if a cartographic projection
>
> Hello:
>
> I'm porting an old PROJ4 code for strictly cartographic projections
> (forward and inverse steps) to version 6 and I'm a bit confused about
> the definition. I see that I must substitute the old pj_fwd() and
> pj_inv() by theproj_trans() function, where I set the forward or
> inverse step via the PJ_DIRECTION input argument. My questions are:
>
> 1. Is it possible (has PROJ6 any function or other method) to check
> the definition in order to guarantee it is strictly a cartographic
> projection?
>
> 2. Must be the geodesic coordinates for the forward cartographic
> problem always radians?
>
> On the other hand, I can read in https://proj.org/operations/index.html
>
> "
> Projections are purely cartographic mappings of the sphere onto the plane
> "
>
> But PROJ also works in the ellipsoid, so I suppose it is a mistake
>
> Best regards
>
> --
> *****************************************
> José Luis García Pallero
> jgpallero at gmail.com
> (o<
> / / \
> V_/_
> Use Debian GNU/Linux and enjoy!
> *****************************************
> _______________________________________________
> PROJ mailing list
> PROJ at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/proj



-- 
*****************************************
José Luis García Pallero
jgpallero at gmail.com
(o<
/ / \
V_/_
Use Debian GNU/Linux and enjoy!
*****************************************


More information about the PROJ mailing list