-
Notifications
You must be signed in to change notification settings - Fork 45
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
Search plugin not working for QGIS Server #882
Comments
We had a look at this and have managed to get back results from textual search. The spatial search needs more work though. In addition, we've found that there seems to be some issues with how different coordinates are handled: QGIS seems to return Lon/Lat even if we as for e.g. EPSG:3008. Perhaps there are some options that need to be made in the QGS file? If you're ready to work on this together, let me know. It'd be nice if you have some public QGIS Server that we can access for testing purposes, feel free to PM me with details. |
…GIS Server and GeoServer accept. Part of #882.
@WCarlsson, I've pushed what I've got so far to |
Hi! If this can wait a week or so, I would be happy to provide access to a public QGIS 3.20 server that I set up yesterday. |
@matself It would be great with some open data from QGIS server so that we could run some more tests! |
Ok. Jag hör av mig nästa vecka om ni inte hittar någon annan dessförinnan. |
I've made some progress again. But it's a dead end. It turns out that will always return geometries in WGS84, no matter the srsName value provided in the request. This means that we must rewrite substantial chunks of the search model. More info on the limitation here: qgis/QGIS#25171. And here are my results. Only the value of
|
Interesting discussion on the Qgis gh… I guess we’ll port it to gml instead then? That or transforming the returned features to the map-projection. |
@WCarlsson Oh, I almost forgot: I did some major changes to how search works yesterday and you should be able to check out this branch and get the textual search going. Let me know if you want some guidance on how to checkout another branch and build locally (I think you've already done it though, but I'll help you out in case you need!) |
Just some more work to do in order to get the spatial search going. QGIS Server seems to be very formal in which request bodies are allowed: if the polygon sent in the request has duplicate points, QGIS won't give any response at all. See below, in the first screen shot the first and last points are duplicates and there is no response. As soon as I remove the duplicate, I get the correct response. DuplicateNo duplicate |
- This works both for WFS search sources added in Admin UI, as well as WMS layers selected as search sources in Admin UI->Map settings->Search tool options. - There is a quirk that I can not understand, see #882 (comment). - This pretty much closes #882, if it works for everyone. Please test with different search sources. - Also, remember to set server type to 'qgis' in Admin UI for layers that are served via QGIS!
I'm ready to merge it to Make sure to select the appropriate settings, I've tested both GML2/3 and GeoJSON with QGIS Server and GeoServer. |
I can´t seem to get it to work properly. |
The first error is interesting. What happens if you disable the StreetView plugin in Admin UI for the current map and try again? |
This is totally unexpected. Let's take a look together! |
Turns out the previous errors where due to typos in config files. I've merged this feature into |
Fantastic work getting the search working for QGIS-server-data! @jacobwod |
Edit
This became quite big as we realised that what we really want to do is rewrite how search results are handled inside Hajk. Currently the entire search result flow is built around – and expects – GeoJSON objects. A better, and more format independent solution, would be to accept any standard geo format as response and convert that to a common ground (i.e. OpenLayer's
Feature
s) before going further down the flow.So what we'll be doing now is exactly that. Search will be rewritten to work around OpenLayer's features, and it will accept both GML and JSON responses.
As it is a quite substantial rewrite, I'm creating a separate feature branch from here: https://github.com/hajkmap/Hajk/tree/feature/882-search-uses-ol-features.
Original issue
Describe the bug
When using the search plugin with a QGIS Server layer there is no result shown in the search bar. The response from the server is in gml-format but it seems Hajk expects json-format.
We have tried to add outputFormat=application/vnd.geo+json to the request URL but the response is still in gml-format.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The search bar should be populated with the expected values.
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: