-
Notifications
You must be signed in to change notification settings - Fork 55
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 filterType
source param and use QGIS EXP_FILTER
when param is qgis
#1536
Add filterType
source param and use QGIS EXP_FILTER
when param is qgis
#1536
Conversation
I have pretty much the same comment as on #1535 that the double implementation in both getFeature() and WfsSource can be avoided by making getFeature() a wrapper to WfsLayer. In addition I wonder if it is even possible to test the offline implementation, as to my understanding the offline functionality is dead code that is not included anywhere. |
I thought about it while writing this PR and #1535 but settled on handling the removal/wrapping of getFeature() separately. For one, I didn't feel confident about catching all occurences (e g I wasn't aware of its use in the API) and, secondly, if anything were to break I thought it would be better not to have to roll back any commits needed for this PR at the same time. I do agree with you about purging getFeature() but would prefer it to be a separate PR. Just to add to the complexities:
|
I see, so maybe I changed those parts unnecessarily. Would you prefer that we don't touch them, that I revert that specific commit? |
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.
Tested with geoserver only as I don't have qgis. It works as before for Geoserver, so it does not break anything.
Apart from that I have not tested offline, as it would not work anyway. Leave that code, it might be a heads up if someone picks up development later.
Regarding making getFeature() into a wrapper I would have no problems with just making it for WFS. The api experience would still be the same. But as you point out, it possibly should be another issue. But considering the amount of double work it would have been nice to have it done before more features are added to the source as it already is inconsistent behavior between the layer source and getFeature.
src/getfeature.js
Outdated
} | ||
} else if (filterType === 'qgis') { | ||
queryFilter = `&featureId=${layer.get('name')}.${id}`; |
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.
This won't work when using double underscore notation or the 'id'-option on the layer. 'id' should be used instead of 'name' if it really is necessary to prepend the layername. Geoserver can handle with or without layername, but it may be dangerous to assume that it always shall be prepended, When calling from search the search result would most likely not not have layername prepended, but if calling from some arbitrary code it will probably already be prepended.
@MattiasSp Is this still a work in progress or outdated? Otherwise can you solve the conflicts and we can have another look at it. |
@MattiasSp Is this PR still relevant now that getFeature() has been completely rewritten? The parts in WfsSource is probably still relevant but probably hard to merge. Please review this PR and update it if possible or remove it. |
…o wfs-qgis-filter-support
The gist of the PR is that the Both the integrated query filter and the Thus, the WfsSource is also ready to have further filter types such as OGC filters added - which to my knowledge is supported by both GeoServer and QGIS Server and possibly other map servers as well. Some background to explain the changes;
|
I'll have a look soon, missed the notification. Don't think the commit history matters, it will be squashed when the PR is merged. |
Tested on Geoserver only as I don't have access to a Qgis server. Seems to work as expected on Geoserver so at least it doesn't break anything when I tested related tables, MultiSelect and plain Wfs. Some issues that are not related to functionality, but bugs me:
Other than that it seems like a stellar upgrade for the ever increasing Qgis server following! Edit: First version stated that it was not possible to configure for qgis. My bad I put the configuration at layer level. |
Thanks for the review @steff-o! I'll respond to your feedback and edit this comment as I adjust the PR:
|
There @steff-o, I think I have addressed all of your comments now - ready for another look :) |
Surely layer configuration should override source configuration, right? Seems more logical to me. Other than that it looks OK. I'm totally fine with dangling underscores, In fact OpenLayers rely on it and up until recently it was the best we had. In the future we may decide to allow hash-privates as it has been along for quite a while now. Yes, editing is a completely different beast and should be kept out of this PR. |
I considered that initially. Setting a default on the source and a more specific override on the layer would definitely feel more logical in the general case. However, a single source can not handle multiple different filterTypes, so overriding a source value on the layer level with a different filterType must mean that one of the values are incorrect and will not work. Either the overriding layer or all the other layers using that source will be incorrectly configured. Allowing |
A single source COULD be able to support different filters for different layers. At least Geoserver also supports the OGC filter parameter Having the possibility to use different filter types on same source would be the reason to call the setting "filterType" instead of having a server type setting on the source, which could be used for more vendor specific features without having to specify each vendor specific feature. For instance WMS sources have a ```type`` `setting that can be used to utilize different vendor specific features (probably not documented). I think the simplest solution would be removing the possibility to configure it at layer level for now. If someone actually implements more filter types it can be added at layer level to override source setting if desired. |
This reverts commit 6c5055b.
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.
LGTM. I will merge soon unless anyone objects.
Completely agree and I think what was part of my original thinking even though I seem to have forgotten xD
Thank you @steff-o! And thanks again for all the constructive feedback along the way. |
Fixes #1139.
Adds support for QGIS Server's
EXP_FILTER
parameter wherever GeoServer'sCQL_FILTER
is currently used.QGIS Server layers now need to specify the
filterType
config option on the source to make use of layer filters:WFS layers now create a WfsSource with
filterType: 'cql'
by default to preserve current behaviour.