[PROJ] Why do I have a exception: NoSuchAuthorityCodeException?

Even Rouault even.rouault at spatialys.com
Fri Apr 17 07:38:25 PDT 2020


On jeudi 16 avril 2020 14:21:46 CEST Евгений Соболев wrote:
> Hi.
>  
> I use function proj_create_crs_to_crs for create PJ* for transform:
>     C = proj_context_create();
>     char** paths = new char*[1];
>     QString pathapp = QApplication::applicationDirPath()+ "/proj4_data" ; 
>     paths[0] = _strdup(pathapp.toUtf8().constData());
>     proj_context_set_search_paths(C, 1, paths);
>     P = proj_create_crs_to_crs(C, "EPSG:4326", "EPSG:4923", NULL);
>  
> I have exception:  osgeo::proj::io::NoSuchAuthorityCodeException.

You mean that proj_create_crs_to_crs() throws a C++ exception that is propagated down 
though your code ? That shouldn't happen, as at the worse case they are caught by 
proj_create_crs_to_crs() itself. Or there's something really wrong with your build (or some 
situations like 
https://github.com/OSGeo/gdal/issues/2394 where a third-party library messes up with 
libstdc++)

But, internally, indeed proj_create_crs_to_crs(C, "EPSG:4326", "EPSG:4923", NULL) will at 
some point try to instanciate a projectedCRS and throw an exception, but it will be caught 
immediately by other PROJ code, so you shouldn't worry about that.

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


More information about the PROJ mailing list