-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
add expression functions to create CRS from string definition and to get CRS authid (refs #58313) #60485
base: master
Are you sure you want to change the base?
Conversation
@nyalldawson what do you think? Another approach would be to evaluate parameter value for CRS parameter in the |
🪟 Windows buildsDownload Windows builds of this PR for testing. 🪟 Windows Qt6 buildsDownload Windows Qt6 builds of this PR for testing. |
Can you also add the expression function json documentation for these? |
@nirvn also keen to hear your thoughts |
0fff073
to
5e28726
Compare
Description
Processing batch mode allows to defined output name using expressions and all algorithm parameters are available as values in this context. However, CRS parameters when used in expression return nothing. This happens because when algorithm scope is populated we create variables using the values obtained from
parametersForRow()
method and these values are just uses as-isQGIS/python/plugins/processing/gui/BatchPanel.py
Lines 956 to 961 in 6b4ffb3
In case of CRS parameter, variable will be populated with the instance of
QgsCoordinateReferenceSystem
. Expression engine does not have support for variants containingQgsCoordinateReferenceSystem
and evaluating such variable returns nothing as reported in #58313.This PR adds two new expression functions:
make_crs(definition)
to create aQgsCoordinateReferenceSystem
from a definitioncrs_authid(crs)
to get a string with the CRS authidRefs #58313.