[PROJ] Efficiently obtaining all known ellipsoid details

Even Rouault even.rouault at spatialys.com
Mon May 18 16:13:08 PDT 2020


On mardi 19 mai 2020 08:00:50 CEST Nyall Dawson wrote:
> Hi list,
> 
> In QGIS we need to obtain a list of all known ellipsoid definitions
> from proj. Currently we do this via the approach:
> 
>   if ( PROJ_STRING_LIST authorities =
> proj_get_authorities_from_database( context ) )
>   {
>     PROJ_STRING_LIST authoritiesIt = authorities;
>     while ( char *authority = *authoritiesIt )
>     {
>       if ( PROJ_STRING_LIST codes = proj_get_codes_from_database(
> context, authority, PJ_TYPE_ELLIPSOID, 0 ) )
>       {
>         PROJ_STRING_LIST codesIt = codes;
>         while ( char *code = *codesIt )
>         {
>           proj_create_from_database( context, authority, code,
> PJ_CATEGORY_ELLIPSOID, 0, nullptr ) );
>            proj_get_name(...)
>            proj_ellipsoid_get_parameters(...)
>          }
>      }
>    }
> }

Nyall,

how slow is that exactly ? There are just 303 ellipsoids in the DB, and those are relatively 
simple objects, so that's a bit surprising.

We have proj_get_crs_info_list_from_database() (which was justified given that there are 
close to 10K CRS and those are more complex objects) that could serve as an inspiration for 
similar functionality for ellipsoids, but I think it could be worth finding if there is an obvious 
bottleneck with the existing infrastructure.

Even

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/proj/attachments/20200519/03e13aeb/attachment.html>


More information about the PROJ mailing list