lizmap-web-client icon indicating copy to clipboard operation
lizmap-web-client copied to clipboard

Permalink with filter

Open rmarzocchi84 opened this issue 3 years ago • 11 comments

II try to add a permalink filtering a layer, but the function it is not supported using filter and permalink.

I try adding the filter properties in the WMS request

https:\\url?...&filter=layername:field+IN+(+filedvalue+)+

but it seems to do not work (the layer disappear from map!!)

Any idea? It can be a nice option for users..

rmarzocchi84 avatar Oct 21 '21 12:10 rmarzocchi84

I did not try but it seems like an enhancement :) Maybe someone achieved this behavior so I let 'question' label.

nboisteault avatar Oct 22 '21 07:10 nboisteault

@nboisteault from my test it seems a security problem https://docs.qgis.org/3.16/en/docs/server_manual/services.html#filter

When I add a filter

https://MYURL/mappe/lizmap/www/index.php/view/map/?repository=repo1&project=transitabilita_grafo&bbox=983223.135660956%2C5529467.9215975%2C989152.933212883%2C5539166.51443928&crs=EPSG%3A3857&filter=v_grafo_incongruenze%3A%22UT%3A%22id%22%2BIN%2B%28%2B12%2B%29

filter=v_grafo_incongruenze:UT:id+IN(+12+) filter=v_grafo_incongruenze%3A%22UT%3A%22id%22%2BIN%2B%28%2B12%2B%29

this i sthe error:

<ServiceExceptionReport xmlns="http://www.opengis.net/ogc" version="1.3.0">
<ServiceException code="Security">The filter string "id"+IN+(+12+) has been rejected because of security reasons. Note: Text strings have to be enclosed in single or double quotes. A space between each word / special character is mandatory. Allowed Keywords and special characters are IS,NOT,NULL,AND,OR,IN,=,<,>=,>,>=,!=,',',(,),DMETAPHONE,SOUNDEX. Not allowed are semicolons in the filter expression.</ServiceException>
</ServiceExceptionReport>

rmarzocchi84 avatar Nov 02 '21 11:11 rmarzocchi84

Did you respect A space between each word / special character is mandatory?

nboisteault avatar Nov 05 '21 18:11 nboisteault

Did you respect A space between each word / special character is mandatory?

Adding spaces filter=v_grafo_incongruenze+:+UT:id+IN(+12+)+ the request works, but not the filter

rmarzocchi84 avatar Nov 10 '21 10:11 rmarzocchi84

Sorry filter=v_grafo_incongruenze:+"id"+IN(+12+)+ it works! where: filter=layername:+"field_name"+OPERATOR+'string variable'+ or filter=layername:+"field_name"+OPERATOR+number+

The permalink from filter can be a nice enhancement but just now user can create a script to have the correct URL request

rmarzocchi84 avatar Nov 15 '21 09:11 rmarzocchi84

I've tried to implement this nice feature, but I don't get it to work. See also my post on gis.stackexchange.com. Features are not filtered on the map, but only in the data menu.

The url we are using is: https://ourserver.com/lizmap/index.php/view/map/?repository=xfn&project=xfn_lizmap&filter=v_parcels%3A%22id%22%20IN%20(%2054%20,%2055%20,%2056%20,%2053%20,%2052%20,%20516%20), so that the filter part looks like &filter=v_parcels:"id" IN ( 54 , 55 , 56 , 53 , 52 , 516 ) v_parcels is the original layer name from PostGIS, not the alias given in the Lizmap plugin. For the layer both are configured in the Lizmap plugin in QGIS, the form filter and the attribute table with id as primary key field. The Lizmap version is 3.4.7.

Are there any other prerequisites that I miss to get it to work?

geomoes avatar Dec 03 '21 19:12 geomoes

Meanwhile I'm working with Lizmap version 3.5.3. But still I'm unable to get this filtering by URL to work. &filter=gebiete:"gid" IN ( 11 , 12 ) The PostGIS layer 'gebiete' has identifier 'gid' and the features 11 and 12 exist in the database. In QGIS the layer is published as WFS and in Lizmap-Plugin the layer is set up in the attribute table and the form filter.
I do not find this 'filtering by url' in the documentation.

When I look at the lizmap log-file I get the following error: error 2022-05-09 15:22:00 [0] syntax error, unexpected ')' /var/www/lizmap-web-client-3.5.3/lizmap/modules/filter/controllers/service.classic.php 89

Any idea how to get this to work or where to find documentation about this topic?

geomoes avatar May 09 '22 14:05 geomoes

Is this covered by #3074 @nboisteault and others ?

Gustry avatar Aug 08 '22 08:08 Gustry

@geomoes @rmarzocchi84 Could you test https://github.com/3liz/lizmap-web-client/pull/3074 and give us feedback please?

nboisteault avatar Aug 31 '22 09:08 nboisteault

~So it's included in latest 3.6 releases~

Gustry avatar Aug 31 '22 09:08 Gustry

This issue is missing some feedbacks. 👻 Please have a look to the discussion, thanks. 🦎

3liz-bot avatar Oct 11 '22 05:10 3liz-bot

This issue is missing some feedbacks. 👻 Please have a look to the discussion, thanks. 🦎

3liz-bot avatar Nov 22 '22 04:11 3liz-bot

Hi, it took me a time to wait until the final release of the 3.6.0 version of Lizmap. Then I had issues to get the required qgis-server-plugin up and running. Now I want to test the new possibility to filter by passing filter conditions via URL. I'm trying the following syntax as noted already above: &filter=gebiete:"gid" IN ( 11 , 12 ) &filter=gebiete:"gid"=12 but I don't get it to work.

Could You please provide the right syntax that is needed?

geomoes avatar Dec 15 '22 21:12 geomoes