[PROJ] Anyway to set a CRS object's name via c api?

Nyall Dawson nyall.dawson at gmail.com
Thu Oct 8 17:50:40 PDT 2020


Hi list,

Using the C api "proj_get_name" method I'm able to retrieve the
descriptive name of a CRS object.

This works well for CRS obtained from the Proj database, or for CRS
defined from WKT with a name embedded: ...PROJCRS["my CRS name",
BASEGEOGCRS[...

But if I have a CRS object created using a different method (say, from
a proj string), is there any way I can manually set a name for this
CRS so that subsequent calls to proj_as_wkt will include the manually
set CRS name?

While it would be possible to get the WKT returned from proj_as_wkt
and then try to insert the custom name, this would be a lot of fragile
string manipulation which I'd rather avoid!

Nyall


More information about the PROJ mailing list