Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception "osgeo::proj::io::FactoryException" is emmited when using the QgsMapCanvas class. #57553

Open
2 tasks done
loftyscholar opened this issue May 24, 2024 · 2 comments
Open
2 tasks done
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter!

Comments

@loftyscholar
Copy link

What is the bug or the crash?

When I use the class like this "QgsMapCanvas* m_mapCanvas = new QgsMapCanvas;", I got many exceptions.
According invetigation, it occured when calling the following function and process the proj string "+proj=longlat +a=10000 +no_defs +type=crs"
"QgsEllipsoidUtils::EllipsoidParameters QgsEllipsoidUtils::ellipsoidParameters( const QString &e )"
Actually, it is because there are several celestial bodies that match the 10000 radius in proj.db.
How to resolve this problem?

Steps to reproduce the issue

QApplication a(argc, argv);
QString strAppDir = "./qgis";
QgsApplication::setPrefixPath(strAppDir, false);
QString strPluginDir = strAppDir + QString("/plugins/");    
QgsApplication::setPluginPath(strPluginDir);    
QString strPkgDir = strAppDir + QString("/share/data/");    
QgsApplication::setPkgDataPath(strPkgDir);
QString strProjDir = strAppDir + QString("/share/proj");
qputenv("PROJ_LIB", strProjDir.toStdString().c_str());   
/*loads providers*/
QgsApplication::initQgis();
spatialviz w;
QgsMapCanvas* m_mapCanvas = new QgsMapCanvas;
w.setCentralWidget(m_mapCanvas);

Versions

QGIS-final-3_36_0

Supported QGIS version

  • I'm running a supported QGIS version according to the roadmap.

New profile

Additional context

No response

@loftyscholar loftyscholar added the Bug Either a bug report, or a bug fix. Let's hope for the latter! label May 24, 2024
@rouault
Copy link
Contributor

rouault commented May 25, 2024

This is linked to OSGeo/PROJ#4148

@loftyscholar Your bug description is not clear. Do those exceptions percolate through QGIS, or are they caught before in PROJ? Noramlly that should be just the later, and if so then OSGeo/PROJ#4149 addresses the issue and there is no action on QGIS side

@loftyscholar
Copy link
Author

This is linked to OSGeo/PROJ#4148

@loftyscholar Your bug description is not clear. Do those exceptions percolate through QGIS, or are they caught before in PROJ? Noramlly that should be just the later, and if so then OSGeo/PROJ#4149 addresses the issue and there is no action on QGIS side

Thanks again for your help.
When I use the QgsMapcanvas object, the dialog "QgsProjectionSelectionTreeWidget" is always empty, i.e., no recently used srs or predefined crs, and I am wondering what cause this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter!
Projects
None yet
Development

No branches or pull requests

2 participants