[PROJ] Getting "proj" and "datum" for a CRS

Kristian Evers kreve at sdfe.dk
Thu May 2 23:52:18 PDT 2019


Nyall,

For 1, try giving proj_pj_info() a go. I am not sure that it will work in all situations (a compound CRS will probably not behave as you might want/expect). There’s currently not a similar function for retrieving the ellipsoid id, but it can be added to proj_pj_info() if needed. You are welcome to submit a PR with such a change (if you are quick it can be part of 6.1.0).

/Kristian

Fra: PROJ <proj-bounces at lists.osgeo.org> På vegne af Nyall Dawson
Sendt: 3. maj 2019 03:38
Til: PROJ <proj at lists.osgeo.org>
Emne: [PROJ] Getting "proj" and "datum" for a CRS

Hi list,

Next question:

If I have a crs created from a proj string like:

+proj=tmerc +lat_0=0 +lon_0=102 +k=0.9999 +x_0=500000 +y_0=0 +ellps=WGS84 +units=m +no_defs +type=crs

1. How can I get the "tmerc" acronym from the proj API? If I call proj_crs_get_coordoperation and then proj_coordoperation_get_method_info I can retrieve the method name, but this is a long version of this value (ie. ."Transverse Mercator", not the tmerc acronym)

2. How can I get the ellipsoid/datum value? Again, I can call proj_get_ellipsoid to get an ellipsoid, and from that I've been using proj_get_id_auth_name/proj_get_id_code. But this only sometimes gives a value, and ideally I'm trying to retrieve the "WGS84" value used in the original proj string.

(I'm trying to use the official proj methods to retrieve these values - without resorting to regex parsing)

3. Using proj_as_proj_string sometimes results in errors like: "proj_as_proj_string: Unsupported conversion method: Lambert Conic Conformal (West Orientated)". I'm guessing this indicates that there's NO way of representing that projection using proj strings, and I'm wasting my time if I try to work around this?

Nyall

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/proj/attachments/20190503/06873606/attachment-0001.html>


More information about the PROJ mailing list