Opened 12 years ago

Last modified 12 years ago

#3875 new defect

[PATCH] WFS request on Postgis layer only works if spatial condition is specified

Reported by: rouault Owned by: mapserverbugs
Priority: normal Milestone:
Component: WFS Server Version: 6.0
Severity: normal Keywords: postgis wfs
Cc:

Description

The following request doesn't retrieve a result :

http://127.0.0.1:8080/mapserv.cgi?map=pg.map&SERVICE=WFS&VERSION=1.1.0&REQUEST=GetFeature&TYPENAME=world&FILTER=%3CFilter%20%20xmlns:gml=%22http://www.opengis.net/gml%22%3E%3CPropertyIsEqualTo%3E%3CPropertyName%3Ename%3C/PropertyName%3E%3CLiteral%3EFrance%3C/Literal%3E%3C/PropertyIsEqualTo%3E%3C/Filter%3E"  ./mapserv

but the following one works:

http://127.0.0.1:8080/mapserv.cgi?map=pg.map&SERVICE=WFS&VERSION=1.1.0&REQUEST=GetFeature&TYPENAME=world&FILTER=%3CFilter%20%20xmlns:gml=%22http://www.opengis.net/gml%22%3E%3CAnd%3E%3CPropertyIsEqualTo%3E%3CPropertyName%3Ename%3C/PropertyName%3E%3CLiteral%3EFrance%3C/Literal%3E%3C/PropertyIsEqualTo%3E%3CBBOX%3E%3CPropertyName%3EmsGeometry%3C/PropertyName%3E%3Cgml:Box%3E%3Cgml:coordinates%3E-90,-180%2090,180%3C/gml:coordinates%3E%3C/gml:Box%3E%3C/BBOX%3E%3C/And%3E%3C/Filter%3E

The data to reproduce is the world.shp injected in a postgis instance, coming from http://tinyows.org/trac/browser/trunk/demo

Attached a patch that fixes the issue, but there's perhaps a prettier one...

Attachments (2)

pg.map (568 bytes ) - added by rouault 12 years ago.
mapfile used to reproduce
ticket_3875.patch (1.4 KB ) - added by rouault 12 years ago.

Download all attachments as: .zip

Change History (3)

by rouault, 12 years ago

Attachment: pg.map added

mapfile used to reproduce

by rouault, 12 years ago

Attachment: ticket_3875.patch added

comment:1 by rouault, 12 years ago

Hum, I've fixed the issue without the patch, by modifying the mapfile as such (moving EXTENT to MAP level and adding a PROJECTION block) :

MAP
    NAME "Test"

        WEB
         METADATA
            "ows_onlineresource" "http://example.com"
            "ows_enable_request" "*"
         END
        END

        EXTENT -180 -90 180 90
        PROJECTION
            '+proj=longlat +datum=WGS84'
        END

    LAYER
        NAME 'world'
        TYPE POLYGON
        CONNECTIONTYPE postgis
        CONNECTION "dbname=autotest port=5432"
        DATA "wkb_geometry from world using unique ogc_fid using srid=4326"

        METADATA
            "wfs_srs" "EPSG:4326"
            'wfs_title' 'world'
            'wfs_featureid' 'ogc_fid'
            "gml_include_items" "all"
        END
        DUMP TRUE
    END
END

Wondering if my first mapfile was really incorrect ?

Note: See TracTickets for help on using tickets.