qgis / QGIS

QGIS is a free, open source, cross platform (lin/win/mac) geographical information system (GIS)
https://qgis.org
GNU General Public License v2.0
10.52k stars 2.99k forks source link

Potential WFS filtering issue #17496

Closed qgib closed 5 years ago

qgib commented 11 years ago

Author Name: Jeffrey Bostoen (Jeffrey Bostoen) Original Redmine Issue: 8795 Affected QGIS version: master Redmine category:qgis_server Assignee: René-Luc ReLuc


I've taken this as an example: http://demo.3liz.com/wfst/wfs-filter.html

I'm using QGis Server 2, also tried upgrading to the master branch. For some reason, using this code below (adapted from the example above), I get a "RequestNotWellFormed"-issue without any further details (would be nice to have those, if I'm doing something wrong?) It works if I remove the filter-part. "ADRES" is a valid field.

In QGis Desktop, this layer source works. Only noticeable differences are no BBox here and different wildcard (%, *) and 'escapeChar' instead of 'escape'.

http://10.210.0.87/cgi-bin/crab/qgis_mapserv.fcgi?SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&TYPENAME=crab2&SRSNAME=EPSG:4326&FILTER=<ogc:Filter>
 <ogc:PropertyIsLike wildCard="%" singleChar="?" escapeChar="!">
  <ogc:PropertyName>ADRES</ogc:PropertyName>
  <ogc:Literal>Korenmarkt%</ogc:Literal>
 </ogc:PropertyIsLike>
</ogc:Filter>
wfs84 = new OpenLayers.Layer.Vector("WFS", {
    strategies: [new OpenLayers.Strategy.BBOX()],
            protocol: new OpenLayers.Protocol.WFS({
                version: '1.0.0',
                url: "http://10.210.0.87/cgi-bin/crab/qgis_mapserv.fcgi",
                featureType: "crab2",
                featureNS: "http://www.qgis.org/gml",
                geometryName: "geometry"

            }),

            styleMap: new OpenLayers.StyleMap({
                fill: true,
                fillColor: "#333333",
                fillOpacity: 0.7,
                stroke: true,
                strokeWidth: 3,
                strokeColor: "#333333",
                graphic: true,
                graphicName: "circle",
                pointRadius: 6
            }),

           filter: new OpenLayers.Filter.Logical({
                type: OpenLayers.Filter.Logical.OR,
                filters: [
                    new OpenLayers.Filter.Comparison({
                        type: OpenLayers.Filter.Comparison.LIKE,
                        property: "ADRES",
                        value: 'M*'
                    }),

                    new OpenLayers.Filter.Comparison({
                        type: OpenLayers.Filter.Comparison.LIKE,
                        property: "ADRES",
                        value: 'L*'
                    })

                ]

            })

        })
qgib commented 10 years ago

Author Name: Paolo Cavallini (@pcav)


qgib commented 10 years ago

Author Name: René-Luc ReLuc (@rldhont)


Have you tested again ? If yes and that the bug persists, can you give me accessibility to examples ?


qgib commented 10 years ago

Author Name: René-Luc ReLuc (@rldhont)


Fixed with c9a88c147c20b09fd8b0287aafd9811ac314bbe0