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

Needs a better way to select the CRS #47

Closed
AlisterH opened this issue Jan 24, 2019 · 10 comments
Closed

Needs a better way to select the CRS #47

AlisterH opened this issue Jan 24, 2019 · 10 comments
Assignees
Labels
enhancement New feature or request

Comments

@AlisterH
Copy link

AlisterH commented Jan 24, 2019

If I want to load e.g. the Auckland Lidar DEM WMS (not WMTS), there is apparently a vast number of CRSs available (perhaps this is an error though, because they seem too many).
They are all in a list with just the EPSG numbers (not ideal, but people can probably cope with it), but the list isn't sorted, so it is impossible to find the one you want - see screenshot.

@AlisterH
Copy link
Author

image

@AlisterH
Copy link
Author

there is apparently a vast number of CRSs available (perhaps this is an error though, because they seem too many).

I think there are fewer if you try in QGIS 2.18.x rather than 3.x, but it still seems quite a lot.

@SPlanzer
Copy link

Thanks @AlisterH

The WMS capabilities document lists all these as "All supported EPSG projections".
With WMTS and WFS only one or two are ever available.

The purpose of the EPSG combo-box is to show the user which crs's the data is served by the server (if they are in the list they are stored in this project and do not need to be reprojected - This is useful for the user to understand as the user can then understand when QGIS will reporject on the fly. (this statement is true for WMTS and WFS though considering the number for WMS I will need to investigate this for further for WMS)) .

Currently the plugin:

  • Ensures the projects current crs is selected in the combo-box. I expect In most cases the user will not alter this (?)

Will do to improve the plugin:

  • Ensure the list is ordered

Consider:

  • how to reduce the number
  • Consider adding a 'search and filter' text box in the combo-box

@SPlanzer SPlanzer self-assigned this Jan 24, 2019
@SPlanzer SPlanzer added the enhancement New feature or request label Jan 24, 2019
@AlisterH
Copy link
Author

Currently the plugin: Ensures the projects current crs is selected in the combo-box

Ah, I see it does do this in QGIS 2, but it doesn't in QGIS 3.

@SPlanzer
Copy link

SPlanzer commented Mar 8, 2019

Custom combobox widget built with text filtering of items.

However, when promoting the custom combobox widget, the plugin fails at start up.

The below test results in the same error when Service_dialog_base.ui is extended by the custom combo box error. related to https://issues.qgis.org/issues/8760?

import sys, os
from PyQt5 import QtCore, QtGui, uic


FORM_CLASS, _ = uic.loadUiType(os.path.join(
    os.path.dirname(__file__), "/home/splanzer/git/linz-data-importer/linz-data-importer/gui/Service_dialog_base.ui"))
class MyWindowClass(QtGui.QMainWindow, form_class):
    def __init__(self, parent=None):
        QtGui.QMainWindow.__init__(self, parent)
        self.setupUi(self)
app = QtGui.QApplication(sys.argv)
myWindow = MyWindowClass(None)
myWindow.show()
app.exec_()

@SPlanzer
Copy link

The above was related to bad import paths

@SPlanzer
Copy link

using python sort() on the wms wspg list returned from the server each time is to slow

with ordering
2019-03-12T11:03:25     INFO    loaded: data.linz.govt.nz wmts in 0.013724803924560547secs
2019-03-12T11:03:28     INFO    loaded: data.linz.govt.nz wms in 2.6306211948394775secs
2019-03-12T11:03:29     INFO    loaded: data.linz.govt.nz wfs in 0.014017581939697266secs
2019-03-12T11:03:29     INFO    loaded: data.mfe.govt.nz wmts in 0.002277374267578125secs
2019-03-12T11:03:29     INFO    loaded: data.mfe.govt.nz wfs in 0.004220724105834961secs
2019-03-12T11:03:31     INFO    loaded: data.linz.govt.nz wmts in 0.0039033889770507812secs

without ordering
2019-03-12T11:04:32     INFO    loaded: data.linz.govt.nz wmts in 0.009961366653442383secs
2019-03-12T11:04:32     INFO    loaded: data.linz.govt.nz wms in 0.0009458065032958984secs
2019-03-12T11:04:33     INFO    loaded: data.linz.govt.nz wfs in 0.0087432861328125secs
2019-03-12T11:04:33     INFO    loaded: data.mfe.govt.nz wmts in 0.0012078285217285156secs
2019-03-12T11:04:33     INFO    loaded: data.mfe.govt.nz wfs in 0.0025501251220703125secs
2019-03-12T11:04:35     INFO    loaded: data.linz.govt.nz wmts in 0.002384185791015625secs

The server has a predefined espg list for all wms layers. Therefore it will be ordered once and applied as the crs espg option for all layers.

@SPlanzer
Copy link

Applying order to WMS ESPG list for each domain is obviously much faster

2019-03-12T11:48:08     INFO    loaded: data.linz.govt.nz wmts in 0.01619410514831543secs
2019-03-12T11:48:09     INFO    loaded: data.linz.govt.nz wms in 0.007515907287597656secs
2019-03-12T11:48:10     INFO    loaded: data.linz.govt.nz wfs in 0.017155885696411133secs
2019-03-12T11:48:10     INFO    loaded: data.mfe.govt.nz wmts in 0.003507852554321289secs
2019-03-12T11:48:10     INFO    loaded: data.mfe.govt.nz wfs in 0.00481867790222168secs

SPlanzer pushed a commit that referenced this issue Mar 12, 2019
order and filter srs as per #47
@SPlanzer
Copy link

resolved via pull request #52

Still to be released

SPlanzer pushed a commit that referenced this issue Mar 21, 2019
SPlanzer pushed a commit that referenced this issue Mar 21, 2019
@SPlanzer
Copy link

New version (2.0.1) released with enhancement

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

No branches or pull requests

2 participants