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

michael.smith.erdc at gmail.com michael.smith.erdc at gmail.com
Thu Oct 8 18:14:01 PDT 2020


You could convert to a json dict (pyprog has this) and the set the object and then reload the update json. Less fragile than the wkt. 

Mike Smith 
US Army Corps


> On Oct 8, 2020, at 8:50 PM, Nyall Dawson <nyall.dawson at gmail.com> wrote:
> 
> 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
> _______________________________________________
> PROJ mailing list
> PROJ at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/proj


More information about the PROJ mailing list