[OpenLayers-Users] OGC Filter problem

Räder, Michael Michael.Raeder at nlpv-wattenmeer.niedersachsen.de
Thu Jan 10 04:59:10 PST 2013


Hi,

we have the same problem as well. 
Try to do filter Request with __like. (ISLIKE)

.....
<ogc:PropertyIsLike wildCard="*" singleChar="." escapeChar="!">
<ogc:PropertyName>datetime</ogc:PropertyName>
<ogc:Literal>*2013*</ogc:Literal>
</ogc:PropertyIsLike>



Mit freundlichen Grüßen
Im Auftrag
Michael Räder
______________________________________________
 
Michael Räder
Nationalpark-Verwaltung Niedersächsisches Wattenmeer
Virchowstr. 1  /  26382 Wilhelmshaven
Tel.: +49 (0) 4421 911 295  /  Fax.: +49 (0) 4421 911 280 
Email: michael.raeder at nlpv-wattenmeer.niedersachsen.de
║ [NLPV] ║ [MDI - DE] ║
--------------------------------------------------------------------
 

-----Ursprüngliche Nachricht-----
Von: openlayers-users-bounces at lists.osgeo.org [mailto:openlayers-users-bounces at lists.osgeo.org] Im Auftrag von pask23
Gesendet: Donnerstag, 10. Januar 2013 13:32
An: openlayers-users at lists.osgeo.org
Betreff: [OpenLayers-Users] OGC Filter problem

Hi, I had a problem with ocg filter.

my layer in openlayer have this filter:

filter: new OpenLayers.Filter.Comparison({
		type: OpenLayers.Filter.Comparison.BETWEEN,
		property: "datetime",
		lowerBoundary: "2013-01-10T12:11:50.501Z",
		upperBoundary: "2013-01-10T12:11:55.501Z"
							})

and the post to server is:

<ogc:Filter xmlns:ogc="http://www.opengis.net/ogc">
<ogc:PropertyIsBetween>
<ogc:PropertyName>datetime</ogc:PropertyName>
<ogc:LowerBoundary>
<ogc:Literal>2013-01-10T12:11:50.501Z</ogc:Literal>
</ogc:LowerBoundary>
<ogc:UpperBoundary>
<ogc:Literal>2013-01-10T12:11:55.501Z</ogc:Literal>
</ogc:UpperBoundary>
</ogc:PropertyIsBetween>
</ogc:Filter>

but the reply is:
<wfs:FeatureCollection numberOfFeatures="0"
timeStamp="2013-01-10T12:11:15.100Z" xsi:schemaLocation="AidAssistant
http://localhost:8080/geoserver/wfs?service=WFS&version=1.1.0&request=DescribeFeatureType&typeName=AidAssistant%3Av_dati_sensori_geom_BNU1
http://www.opengis.net/wfs
http://localhost:8080/geoserver/schemas/wfs/1.1.0/wfs.xsd"
xmlns:ogc="http://www.opengis.net/ogc" xmlns:tiger="http://www.census.gov"
xmlns:cite="http://www.opengeospatial.net/cite"
xmlns:nurc="http://www.nurc.nato.int" xmlns:sde="http://geoserver.sf.net"
xmlns:wfs="http://www.opengis.net/wfs"
xmlns:topp="http://www.openplans.org/topp"
xmlns:it.geosolutions="http://www.geo-solutions.it"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:AidAssistant="AidAssistant"
xmlns:sf="http://www.openplans.org/spearfish"
xmlns:ows="http://www.opengis.net/ows"
xmlns:gml="http://www.opengis.net/gml"
xmlns:xlink="http://www.w3.org/1999/xlink">
<gml:featureMembers></gml:featureMembers>
</wfs:FeatureCollection>


I tried to use this filter:
filter: new OpenLayers.Filter.Logical({
	type: OpenLayers.Filter.Logical.AND,
	filters: [
		new OpenLayers.Filter.Comparison({
		    type: OpenLayers.Filter.Comparison.GREATER_THAN_OR_EQUAL_TO,
		    property: "datetime",
		    value: 2013-01-10T12:25:40.612Z
		}),
		new OpenLayers.Filter.Comparison({
		   type: OpenLayers.Filter.Comparison.LESS_THAN_OR_EQUAL_TO,
		   property: "datetime",
		  value: 2013-01-10T12:25:50.612Z
		})
	]
})

and post is:
<ogc:Filter xmlns:ogc="http://www.opengis.net/ogc">
<ogc:And>
<ogc:PropertyIsGreaterThanOrEqualTo>
<ogc:PropertyName>datetime</ogc:PropertyName>
<ogc:Literal>2013-01-10T12:25:40.612Z</ogc:Literal>
</ogc:PropertyIsGreaterThanOrEqualTo>
<ogc:PropertyIsLessThanOrEqualTo>
<ogc:PropertyName>datetime</ogc:PropertyName>
<ogc:Literal>2013-01-10T12:25:50.612Z</ogc:Literal>
</ogc:PropertyIsLessThanOrEqualTo>
</ogc:And>
</ogc:Filter>

and reply is the same, 0 features.

There are features in my layer, indeed if I do this request:
http://localhost:8080/geoserver/wfs?service=wfs&version=1.1.0&request=GetFeature&typeName=AidAssistant:v_dati_sensori_geom_BNU1&srsName=EPSG:404000&sortBy=datetime+D

i receive a lot of features, but if I try this:
http://localhost:8080/geoserver/wfs?service=wfs&version=1.1.0&request=GetFeature&typeName=AidAssistant:v_dati_sensori_geom_BNU1&srsName=EPSG:404000&filter=%3Cogc:Filter%20xmlns:ogc=%22http://www.opengis.net/ogc%22%3E%3Cogc:PropertyIsGreaterThanOrEqualTo%3E%3Cogc:PropertyName%3Edatetime%3C/ogc:PropertyName%3E%3Cogc:Literal%3E2013-01-10T12:25:40.612Z%3C/ogc:Literal%3E%3C/ogc:PropertyIsGreaterThanOrEqualTo%3E%3C/ogc:Filter%3E

I receive 0 feature.

Sorry for long post :(

can someone help me?thanks



--
View this message in context: http://osgeo-org.1560.n6.nabble.com/OGC-Filter-problem-tp5026627.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
_______________________________________________
Users mailing list
Users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/openlayers-users



More information about the Users mailing list