[PROJ] CRS aliases

Even Rouault even.rouault at spatialys.com
Fri Jul 21 06:34:36 PDT 2023


>
> To list all the CRS names I am using  "getCRSInfoList". Great method.
> In some cases I would like to include also all the aliases (more than 
> 10000 for projected crs). So you can still find the CRS with the name 
> you used all your live. (I'm sure many people do not know that their 
> authority renamed a CRS).
>
> However I am not able to get them. The method 
> "IdentifiedObject::aliases()" for a CRS is returning an empty vector, 
> and the method "DatabaseContext::getAliases(...)" has a 
> "PROJ_INTERNAL" flag that makes it unlinkable.
>
> Am I doing something wrong with "IdentifiedObject::aliases()"? Is 
> there any other way to do it?

If I remember well, this part of the API was something I coded early in 
the PROJ 6 work, taking inspiration (and strugling to understand) from 
GeoAPI classes. Various classes GenericName, LocalName, NameFactory etc 
to deal with basically a string. So the API is there, there's minimum 
testing for it in test/unit/test_common.cpp, but it hasn't been really 
used for useful stuff.

DatabaseContext::getAliases() is used internally in situations where 
identification from the main name fails.

I guess the AuthorityFactory::createXXXX() methods, and more likely the 
AuthorityFactory::Private::createPropertiesSearchUsage() low level 
method they all use, could be used to query the database and set the 
aliases through the ALIAS_KEY property name during construction. There 
will obviously be some overhead. No idea if it will be significant or not.

An alternative would be to have a C function relying on 
DatabaseContext::getAliases() (or perhaps a helper method at the 
IdentifiedObject level) to load the aliases on demand and return them

Even


>
> Thanks.
> Javier.
>
> PS: EPSG:32766, projected, has an alias
> .___ ._ ..._ .. . ._.  .___ .. __ . _. . __..  ... .... ._ .__
>
> _______________________________________________
> PROJ mailing list
> PROJ at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/proj

-- 
http://www.spatialys.com
My software is free, but my time generally not.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/proj/attachments/20230721/fe428a7f/attachment.htm>


More information about the PROJ mailing list