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

Alan Snow alansnow21 at gmail.com
Thu Oct 8 18:54:06 PDT 2020


For reference: proj_as_projjson -
https://github.com/OSGeo/PROJ/blob/d83c7af5eea59eae366d61ea76d76118a8a505a0/src/proj.h#L1103

On Thu, Oct 8, 2020, 8:14 PM <michael.smith.erdc at gmail.com> wrote:

> 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
> _______________________________________________
> PROJ mailing list
> PROJ at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/proj
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/proj/attachments/20201008/d6e6be22/attachment.html>


More information about the PROJ mailing list