-
Notifications
You must be signed in to change notification settings - Fork 7
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
Use the selected CRS as subsetting CRS #9
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately this solution leads to another problem. The crs of the SUBSET coordinates in the query (which are taken from the map canvas) will no longer match SUBSETTINGCRS. The user would have always to choose a crs that matches the one of the map canvas. Otherwise an error will occur ("Image extent does not intersect with desired region."). To prevent this you'll have to transform the coordinates if SUBSETTINGSCRS doesn't match the destination CRS (map canvas).
Sorry for the inactivity. Your assessment is correct. Proper solution would be to find a crs string from |
QGIS 3.30 added QgsCoordinateReferenceSystem.toOgcUri():
|
FYI I am working on this at the moment and will hopefully be able to present a nice solution soon-ish. |
Oh dear, this is overly complicated... Services might support more CRS for subsetting if they support the CRS extension I guess. But then you need to find out the axis labels for making subset requests somehow and that is so complicated it drained any motivation from me. For the native CRS of a coverage those labels are included in the DescribeCoverage response but it seems virtually impossible to get those of other CRS from the server without making three million requests including third-party servers. https://gis.stackexchange.com/questions/377221/where-do-i-find-crs-axis-names https://gis.stackexchange.com/questions/461135/axes-labels-names-of-qgscoordinatereferencesystem It would be possible to query QGIS' Proj's proj.db SQLite to get the names but that feels super icky (and hey, the server might have a different DB...) so I stopped there. I rewrote the |
It looks like it is fairly straightforward if we are ok with a subprocess run of projinfo. It can parse OGC URI strings and output nice PROJJSON which makes it easy to get the axis abbreviations. I'll see if I can get the time for writing something with that approach. Ref: https://gis.stackexchange.com/questions/461135/axes-labels-names-of-qgscoordinatereferencesystem/461311#461311 |
FYI I am still sitting on half-finished work for this, should receive funding to continue working on it and finally contribute it to the project in Q1/2024. I hope! |
Here's one solution to #8.
This is based on the assumption that the user would always select a CRS in the dialog that is equal to the current canvas CRS. This might not be the case.