wfs attribute filtering
Huub Fleuren
hfl at HOME.NL
Tue Aug 23 09:01:27 PDT 2005
I see. Thanks .
I might experiment with
gml_include_items "all"
to retrieve all data with a proxy that i use for the CONNECTION if
that's not too mapserverspecific, and filter it in there with XSL, but
that would be quite a workaround
variable substitution would be good though!
let's see...
mapserv.c ln. 274 in *loadMap
/* check for any %variable% substitutions here, also do any map_
changes, we do this here so WMS/WFS */
/* services can take advantage of these "vendor specific" extensions */
for(i=0;i<msObj->request->NumParams;i++) {
if(strncasecmp(msObj->request->ParamNames[i],"map_",4) == 0) { /*
check to see if there are any additions to the mapfile */
if(msLoadMapString(map, msObj->request->ParamNames[i],
msObj->request->ParamValues[i]) == -1) writeError();
}
Seems to me that it should work.
Maybe file a bug.
Huub
Bart van den Eijnden wrote:
>Huub,
>
>1: add gml_include_items "all" to your LAYER's METADATA section
>2: I don't expect this to work with variable subsitution
>3: You can set the wfs_filter METADATA with Mapscript, I don't think you can do this with normal CGI
>
>Best regards,
>Bart
>
>Bart van den Eijnden
>Syncera IT Solutions
>Postbus 270
>2600 AG DELFT
>
>tel.nr.: 015-7512436
>email: BEN at Syncera-ITSolutions.nl
>
>
>
>>>>Huub Fleuren <hfl at HOME.NL> 08/23/05 1:55 pm >>>
>>>>
>>>>
>Hi List
>
>I'm happily getting images from a wfs_filtered WFS client layer from my
>map-WFS-server and i was accumulating the following questions.
>
>1. Why are there no attributes in the response to
>
> http://localhost/cgi-bin/mapserv/bin/mapserv.exe?map=mapserv/bin/chameleon.map&version=1.0.0&service=wfs&request=getfeature&typename=park
> http://localhost/cgi-bin/mapserv/bin/mapserv.exe?map=mapserv/bin/chameleon.map&version=1.0.0&service=wfs&request=getfeature&typename=park&Filter=<Filter><PropertyIsEqualTo><PropertyName>PARK_</PropertyName><Literal>10</Literal></PropertyIsEqualTo></Filter>
>
>2. I'm trying variable substitution in the to <ogc:filter/> but the
>expression % + variable + % is interpreted litterally
>
> http://localhost/cgi-bin/mapserv/bin/mapserv.exe?map=mapserv/bin/wfs_park.map&PARK_=10&service=wms&request=getmap&version=1.1.1&layers=wfs_park&styles=&srs=EPSG:42304&bbox=-2600000,-700000,3500000,3840000&width=610&height=450&format=png&transparent=true&exceptions=text/xml&bgcolor=0xffffff
>
>3. How can I filter dynamically?
>
>Regards, Huub
>===
>
>WFS Server layerdefinition
>LAYER
> NAME park
> DUMP TRUE
> METADATA
> DESCRIPTION "Park"
> END
> TYPE POLYGON
> STATUS ON
> DATA park
> CLASS
> NAME "Parks"
> COLOR 200 255 0
> OUTLINECOLOR 120 120 120
> END
> TOLERANCE 5
>END # Layer
>
>
>WFS Client layerdefinition
>
>LAYER
> NAME wfs_park
> TYPE POLYGON
> STATUS ON
> CONNECTIONTYPE WFS
> CONNECTION
>"http://localhost/cgi-bin/mapserv/bin/mapserv.exe?map=mapserv/bin/chameleon.map"
> #adding a Filterkeyword works, but also not applicable to variable
>substitution
>
>#&Filter=<Filter><PropertyIsEqualTo><PropertyName>PARK_</PropertyName><Literal>%PARK_%</Literal></PropertyIsEqualTo></Filter>"
> METADATA
> "wfs_typename" "park"
> "wfs_version" "1.0.0"
> "wfs_request_method" "GET"
> "wfs_connectiontimeout" "60"
> "wfs_maxfeatures" "50"
> "wfs_filter"
>"<PropertyIsEqualTo><PropertyName>PARK_</PropertyName><Literal>%PARK_%</Literal></PropertyIsEqualTo>"
># "wfs_filter"
>"<PropertyIsEqualTo><PropertyName>PARK_</PropertyName><Literal>10</Literal></PropertyIsEqualTo>"
>
> END
> PROJECTION
> "init=epsg:42304"
> END
> CLASS
> STYLE
> COLOR 0 255 0
> END
> END
>END
>
>
>
>
>
More information about the MapServer-users
mailing list