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

Filter Function Vector layer #1432

Open
MartinThorn opened this issue Nov 6, 2023 · 1 comment
Open

Filter Function Vector layer #1432

MartinThorn opened this issue Nov 6, 2023 · 1 comment

Comments

@MartinThorn
Copy link

MartinThorn commented Nov 6, 2023

I have tried out the "Filter function" on a Vector layer on our data and its a great as is but I miss a few tweaks.
I found in our data, its a bit fussy, both it is Case sensitive. I coud convert the db info to Lowercase and it wont be a problem, however if using an dynamic API call (later to come) directly to a db that will be more tricky to achive.

Also I miss a way to filter out the "blanks" Null in a Field? I think I have tried averything with no luck. Possible?
[myField] EQUAL TO " " or [myField] NOT EQUAL TO NULL and so on.
https://lf-webbapp.goteborg.se/img/blanks.JPG

Another good thing would be to be able to build a longer multi field CQL string to get a more complex analysis selection
something like

"Markingenjör" EQUAL TO 'Fredrik' and "Verksamhet" EQUAL TO 'Förskola' and "Potential" EQUAL TO '2'
or a "CQL freetext button" where you just write the actual CQL string could be good with a little education af the users.
like a blank textbox you can write the CQL query directly.

Markingenjör = 'Fredrik' AND Verksamhet = 'Förskola' and Potential = '2'

Would this be possible somehow? we do have some trycky users that use MapInfo today and with all the users and all their intrestpoints it would be tons of layers to achieve, so this function really has potential to take Hajk a bit further for the user and become a more dynamic GIS "out of the box".

@jacobwod
Copy link
Member

Hi @MartinThorn and welcome to the community!

The CQL function is one of those functions that were implemented for a very specific reason. In this case, if I recall correctly, we needed to find a way to only show a certain library building in a layer with all libraries and get it working in an embedded map. Hence, the functionality you find is very basic:

  • no complex queries were needed so they were never implemented
  • the filtering UI in LayerSwitcher was only meant to be an internal tool, used by admins when preparing the embed URLs.

Both points are valid and improvements are welcome.


As I've mentioned, the CQL filters get encoded into the f parameter (check out the Anchor plugin). Even though the UI can't produce complex queries, it is possible that the internal model is capable of parsing them. Give it a go if possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants