-
Notifications
You must be signed in to change notification settings - Fork 791
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
Is this exception “osgeo::proj::io::FactoryException” a bug? in 9.4.0 #4148
Comments
This exception might be emitted by PROJ with such an unsual semi-major axis, but it should be caught, at least in the C function that QGIS uses: which is it? |
Thanks for your reply. |
@loftyscholar |
or use the WKT2 representation:
Alternatively you may define the PROJ_IGNORE_CELESTIAL_BODY=YES environment variable to avoid an error like
|
|
… name by using the ellipsoid name (fixes OSGeo#4148)
…stial bodies (fixes OSGeo#4148)
Improvements in PROJ queued in #4149 With those, |
…stial bodies (fixes OSGeo#4148)
Thanks for your reply, have all the changes been commited to the proj source code? Where should I get the changes? |
… name by using the ellipsoid name (fixes #4148)
This has just been committed in the master branch, and will be soon in the 9.4 branch as well. This will be in the 9.4.1 release |
When I compile and run the qgis project, I got this exception.
Acturally, the proj string is "+proj=longlat +a=10000 +no_defs +type=crs""
When debuging source code, I found this exception is triggered in the function:
std::string PROJStringParser::Private::guessBodyName(double a) {
}
When calling, variable a is 10000.000000000000.
Actually, another function was called, i.e.,
std::string
AuthorityFactory::identifyBodyFromSemiMajorAxis(double semi_major_axis,
double tolerance) const {
auto res =
d->run("SELECT name, (ABS(semi_major_axis - ?) / semi_major_axis ) "
"AS rel_error FROM celestial_body WHERE rel_error <= ?",
{semi_major_axis, tolerance});
if (res.empty()) {
throw FactoryException("no match found");
}
if (res.size() > 1) {
for (const auto &row : res) {
if (row[0] != res.front()[0]) {
throw FactoryException("more than one match found");
}
}
}
return res.front()[0];
}
When calling, res.size() is 3, and for the second row, FactoryException was thrown.
Example of problem
Demonstrate the problem you have found, either by using PROJ tools like
cs2cs
,cct
orprojinfo
or add a code snippet that highlights theproblem using the PROJ C/C++ API.
A "Minimal, Complete and Verifiable Example" will make it much easier for
maintainers to help you: http://matthewrocklin.com/blog/work/2018/02/28/minimal-bug-reports
# Your code here
Problem description
[this should explain why the current behavior is a problem and why the
expected output is a better solution.]
Expected Output
Environment Information
proj
)Installation method
The text was updated successfully, but these errors were encountered: