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

Евгений Соболев evgen_sobolev at mail.ru
Thu Apr 16 04:21:46 PDT 2020


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. But transform coordinate work correctly.
I found the exception generate this code:
 
crs::ProjectedCRSNNPtr
AuthorityFactory::createProjectedCRS(const std::string &code) const {
    const auto cacheKey(d->authority() + code);
    auto crs = d->context()->d->getCRSFromCache(cacheKey);
    if (crs) {
        auto projCRS = std::dynamic_pointer_cast<crs::ProjectedCRS>(crs);
        if (projCRS) {
            return NN_NO_CHECK(projCRS);
        }
        throw NoSuchAuthorityCodeException("projectedCRS not found",
                                           d->authority(), code);
    }
 
Why I have the exception?
 
--
Sobolev Evgeny
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/proj/attachments/20200416/fb82c21c/attachment.html>


More information about the PROJ mailing list