<DIV>hi Eric Lemoine: <BR> Thank you very much. It may be may be that my problem is caused by the bound conflict of the bounds. But after I set the filter to get all the features of the layer, the wfs layer cannot appear either, and if I remove the filter parameter, the wfs layer will appear on the map. I'm very confused with this. So thank you very much for replying.<BR> <BR> Best Regards. <BR> <BR> <BR> </DIV>
<DIV><BR>ÔÚ2008-08-26£¬"Eric Lemoine" <<A href="mailto:eric.c2c@gmail.com">eric.c2c@gmail.com</A>> дµÀ£º<BR>>Hi. Layer.WFS already sets a bbox param in the GetFeature request, and<BR>>bbox is incompatible with filter. I'm not familiar enough with<BR>>GeoServer to be sure, but it may be that the bbox param takes<BR>>precedence over the filter one. With MapServer 4 filter takes<BR>>precedence over bbox, while MapServer 5 returns an error. Hope this<BR>>helps. Eric<BR>><BR>>2008/8/25, lorkyo :<BR>>> Hi,<BR>>> I have come accross the layer when I use add Filter parameters to request<BR>>> features. part of my codes are below and the features are not shown in the<BR>>> map:<BR>>> ***********code**********<BR>>> layer = new OpenLayers.Layer.WFS(<BR>>> "Analyze (WFS)",<BR>>> "<A href="http://192.168.6.140:8080/geoserver/wfs">http://192.168.6.140:8080/geoserver/wfs</A>",<BR>>> {<BR>>> request: 'GetFeature',<BR>>> typeName:'topp:analyze',<BR>>><BR>>> FILTER:'%3Cogc:Filter%20xmlns:ogc=%22http://www.opengis.net/ogc%22%3E%3Cogc:PropertyIsGreaterThan%3E%3Cogc:PropertyName%3EId%3C/ogc:PropertyName%3E%3Cogc:Literal%3E0%3C/ogc:Literal%3E%3C/ogc:PropertyIsGreaterThan%3E%3C/ogc:Filter%3E'<BR>>> },<BR>>> {maxExtent: bounds, maxResolution: 3.986275569928255E-5, projection:<BR>>> "EPSG:4326", buffer: 0},<BR>>> { featureClass: OpenLayers.Feature.WFS}<BR>>> );<BR>>> map.addLayer(layer);<BR>>> ***********code**********<BR>>> The feature is not shown on the map. However, after remove the parameter<BR>>> Filter like below, the wfs layer then appear on the map:<BR>>> ***********code**********<BR>>> layer = new OpenLayers.Layer.WFS(<BR>>> "Analyze (WFS)",<BR>>> "<A href="http://192.168.6.140:8080/geoserver/wfs">http://192.168.6.140:8080/geoserver/wfs</A>",<BR>>> {<BR>>> request: 'GetFeature',<BR>>> typeName:'topp:analyze'},<BR>>> {maxExtent: bounds, maxResolution: 3.986275569928255E-5, projection:<BR>>> "EPSG:4326", buffer: 0},<BR>>> { featureClass: OpenLayers.Feature.WFS});<BR>>> map.addLayer(layer);<BR>>> **********code****************<BR>>> And I'm sure with the value filter because I can get the result through<BR>>> browser with following url which is copied from the former js code:<BR>>><BR>>> <A href="http://192.168.6.140:8080/geoserver/wfs?request=GetFeature&typeName=topp:analyze&FILTER=%3Cogc:Filter%20xmlns:ogc=%22http://www.opengis.net/ogc%22%3E%3Cogc:PropertyIsGreaterThan%3E%3Cogc:PropertyName%3EId%3C/ogc:PropertyName%3E%3Cogc:Literal%3E0%3C/ogc:Literal%3E%3C/ogc:PropertyIsGreaterThan%3E%3C/ogc:Filter%3E">http://192.168.6.140:8080/geoserver/wfs?request=GetFeature&typeName=topp:analyze&FILTER=%3Cogc:Filter%20xmlns:ogc=%22http://www.opengis.net/ogc%22%3E%3Cogc:PropertyIsGreaterThan%3E%3Cogc:PropertyName%3EId%3C/ogc:PropertyName%3E%3Cogc:Literal%3E0%3C/ogc:Literal%3E%3C/ogc:PropertyIsGreaterThan%3E%3C/ogc:Filter%3E</A><BR>>> the result appear on my browser after I typed this url is:<BR> *******************<BR><?xml version="1.0" encoding="UTF-8" ?> <BR>- <wfs:FeatureCollection xmlns="<A href="http://www.opengis.net/wfs">http://www.opengis.net/wfs</A>" xmlns:wfs="<A href="http://www.opengis.net/wfs">http://www.opengis.net/wfs</A>" xmlns:topp="<A href="http://www.openplans.org/topp">http://www.openplans.org/topp</A>" xmlns:gml="<A href="http://www.opengis.net/gml">http://www.opengis.net/gml</A>" xmlns:xsi="<A href="http://www.w3.org/2001/XMLSchema-instance">http://www.w3.org/2001/XMLSchema-instance</A>" xsi:schemaLocation="<A href="http://www.openplans.org/topp">http://www.openplans.org/topp</A> <A href="http://192.168.6.140:8080/geoserver/wfs/DescribeFeatureType?typeName=topp:analyze">http://192.168.6.140:8080/geoserver/wfs/DescribeFeatureType?typeName=topp:analyze</A> <A href="http://www.opengis.net/wfs">http://www.opengis.net/wfs</A> <A href="http://192.168.6.140:8080/geoserver/schemas/wfs/1.0.0/WFS-basic.xsd">http://192.168.6.140:8080/geoserver/schemas/wfs/1.0.0/WFS-basic.xsd</A>"><BR>- <gml:boundedBy><BR>- <gml:Box srsName="<A href="http://www.opengis.net/gml/srs/epsg.xml#4326">http://www.opengis.net/gml/srs/epsg.xml#4326</A>"><BR> <gml:coordinates xmlns:gml="<A href="http://www.opengis.net/gml">http://www.opengis.net/gml</A>" decimal="." cs="," ts="">97.51721382,0.00470831 97.52223518,0.00781349</gml:coordinates> <BR> </gml:Box><BR> </gml:boundedBy><BR>- <gml:featureMember><BR>- <topp:analyze fid="analyze.1"><BR>- <topp:the_geom><BR>- <gml:MultiLineString srsName="<A href="http://www.opengis.net/gml/srs/epsg.xml#4326">http://www.opengis.net/gml/srs/epsg.xml#4326</A>"><BR>- <gml:lineStringMember><BR>- <gml:LineString><BR> <gml:coordinates xmlns:gml="<A href="http://www.opengis.net/gml">http://www.opengis.net/gml</A>" decimal="." cs="," ts="">97.51721382,0.00540555 97.51963792,0.00542299</gml:coordinates> <BR> </gml:LineString><BR> </gml:lineStringMember><BR> </gml:MultiLineString><BR> </topp:the_geom><BR> <topp:Id>1</topp:Id> <BR> </topp:analyze><BR> </gml:featureMember><BR> </wfs:FeatureCollection> <BR> <BR> <BR> So have anyone encountered this problem or can help me find out why?<BR><BR> Best regards!</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>