From: Rahkonen J. <Juk...@mm...> - 2009-12-26 09:59:03
|
Hi, Perhaps you just cannot use IsLike filter with wildcard against numeric field. The query itself looks OK to me but I am not good in reading xml. I add to the bottom of my message a valid request that is created by a GIS software so you can compare it. Otherwise I suggest you to - make a IsLike with wildcard first against a string attribute - when it works have a try with a numeric attribute - if it fails make a new pair of filters </ogc:PropertyIsLessThan> <ogc:PropertyIsGreaterThanOrEqualTo> And here is an IsLike filter which should work. <?xml version="1.0" encoding="ISO-8859-1"?> <wfs:GetFeature xmlns:ogc="http://www.opengis.net/ogc" xmlns:gml="http://www.opengis.net/gml" xmlns:wfs="http://www.opengis.net/wfs" service="WFS" version="1.0.0" maxFeatures="1000" outputFormat="GML2"> <wfs:Query xmlns:topp="http://www.openplans.org/topp" srsName="EPSG:4326" typeName="topp:states"> <ogc:Filter> <ogc:PropertyIsLike wildCard="*" singleChar="#" escape="!" matchCase="true"> <ogc:PropertyName xmlns:topp="http://www.openplans.org/topp"> topp:LAND_KM</ogc:PropertyName> <ogc:Literal> <![CDATA[2000*]]> </ogc:Literal> </ogc:PropertyIsLike> </ogc:Filter> </wfs:Query> </wfs:GetFeature> -Jukka Rahkonen- -----Alkuperäinen viesti----- Lähettäjä: Nosaj [mailto:jt...@ya...] Lähetetty: to 24.12.2009 17:04 Vastaanottaja: geo...@li... Aihe: [Geoserver-users] Getting started with WFS As a GIS profesional but not a programmer, I am slowly learing to use Geoserver and OpenLayers, and learning some javascipt. I have learned to add shapefiles and display in a webmap map and make the GetFeatureInfo work in an html page so that a user can click on a feature and get information about it. However, I am stuck at trying to learn WFS so that I create queries to filter for certain data that can be displayed inmy maps. I have gone through the Penn State Open Web Mapping course that somene recommended in an earlier post. It explains how to create a query filter in general but I can't seem to figure out how to use a filter within the context of the whole code for a web map. In other workds, where is the query filter to be placed. I am also stuck on figuring out how to use the Geoserver WFS sample requests. Basically what I would like to be able to is use a shapefile which has several polygon features (lakes and ponds) of various sizes, and be able to query for features with of a certain size using an area (in acres) field. Here is the filter that I came up with that I think I want to use to find a polygon feature of a certain size. I used the wildcard so I could be less specific since the acres field data has 4 digits past the decimal point. I just don't know where to put it and what else must be included in order for the filter to work. <wfs:GetFeature service="WFS" version="1.0.0" outputFormat="GML2" xmlns:topp="http://www.openplans.org/topp" xmlns:wfs="http://www.opengis.net/wfs" xmlns:ogc="http://www.opengis.net/ogc" xmlns:gml="http://www.opengis.net/gml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/WFS-basic.xsd"> <wfs:Query typeName="topp:water_trial"> <ogc:PropertyName>topp:water_trial</ogc:PropertyName> <ogc:Filter> <ogc:PropertyIsLike wildCard="*" singleChar="." escape="!"> <ogc:PropertyName>topp:ACRES</ogc:PropertyName> <ogc:Literal>2249494*</ogc:Literal> </ogc:PropertyIsLike> </ogc:Filter> </wfs:Query> Thanks, Jason -- View this message in context: http://old.nabble.com/Getting-started-with-WFS-tp26914714p26914714.html Sent from the GeoServer - User mailing list archive at Nabble.com. ------------------------------------------------------------------------------ This SF.Net email is sponsored by the Verizon Developer Community Take advantage of Verizon's best-in-class app development support A streamlined, 14 day to market process makes app distribution fast and easy Join now and get one step closer to millions of Verizon customers http://p.sf.net/sfu/verizon-dev2dev _______________________________________________ Geoserver-users mailing list Geo...@li... https://lists.sourceforge.net/lists/listinfo/geoserver-users |