OpenLayers.Filter.Function with property parameter ?

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

OpenLayers.Filter.Function with property parameter ?

brking
Hello, I'm trying to create a WFS filter which uses a custom GeoServer function we created. It consumes a property as a parameter and I can't figure out how to generate this in OpenLayers. The docs indicate only strings and numbers can be used as function arguments. How are functions to be used with feature properties ? Thanks
Reply | Threaded
Open this post in threaded view
|

Re: OpenLayers.Filter.Function with property parameter ?

Bart van den Eijnden
Can you show us the Filter XML that you want to write out?

Best regards,
Bart

-- 
Bart van den Eijnden
OpenGeo - http://opengeo.org
Expert service straight from the developers.



On Jul 10, 2013, at 2:35 PM, brking <[hidden email]> wrote:

Hello, I'm trying to create a WFS filter which uses a custom GeoServer
function we created. It consumes a property as a parameter and I can't
figure out how to generate this in OpenLayers. The docs indicate only
strings and numbers can be used as function arguments. How are functions to
be used with feature properties ? Thanks



--
View this message in context: http://osgeo-org.1560.x6.nabble.com/OpenLayers-Filter-Function-with-property-parameter-tp5065405.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
_______________________________________________
Users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/openlayers-users


_______________________________________________
Users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/openlayers-users
Reply | Threaded
Open this post in threaded view
|

Re: OpenLayers.Filter.Function with property parameter ?

brking
Thank you for the quick response. I actually have a couple of different scenarios, but basically if the example below from the OGC 1.1 encoding spec is possible I should be in good shape:

<Filter>
  <PropertyIsEqualTo>
    <Function name="SIN">
      <PropertyName>DISPERSION_ANGLE</PropertyName>
    </Function>
    <Literal>1</Literal>
  </PropertyIsEqualTo>
</Filter>

So what I need is a way to pass feature property values as parameters to filter functions, and use the function output in comparisons, or combined with logical filters if the function returns a boolean.
Reply | Threaded
Open this post in threaded view
|

Re: OpenLayers.Filter.Function with property parameter ?

Bart van den Eijnden
Looking at the code this doesn't seem currently possible.

The following syntax is supported:

            '<ogc:Filter xmlns:ogc="http://www.opengis.net/ogc">' +
                '<ogc:Intersects>' +
                    '<ogc:PropertyName>the_geom</ogc:PropertyName>' +
                    '<ogc:Function name="querySingle">' +
                        '<ogc:Literal>sf:restricted</ogc:Literal>' +
                        '<ogc:Literal>the_geom</ogc:Literal>' +
                        '<ogc:Literal>cat=3</ogc:Literal>' +
                    '</ogc:Function>' +
                '</ogc:Intersects>' +
            '</ogc:Filter>';

Best regards,
Bart

-- 
Bart van den Eijnden
OpenGeo - http://opengeo.org
Expert service straight from the developers.



On Jul 10, 2013, at 2:59 PM, brking <[hidden email]> wrote:

Thank you for the quick response. I actually have a couple of different
scenarios, but basically if the example below from the OGC 1.1 encoding spec
is possible I should be in good shape:

<Filter>
 <PropertyIsEqualTo>
   <Function name="SIN">
     <PropertyName>DISPERSION_ANGLE</PropertyName>
   </Function>
   <Literal>1</Literal>
 </PropertyIsEqualTo>
</Filter>

So what I need is a way to pass feature property values as parameters to
filter functions, and use the function output in comparisons, or combined
with logical filters if the function returns a boolean.



--
View this message in context: http://osgeo-org.1560.x6.nabble.com/OpenLayers-Filter-Function-with-property-parameter-tp5065405p5065416.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
_______________________________________________
Users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/openlayers-users


_______________________________________________
Users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/openlayers-users
Reply | Threaded
Open this post in threaded view
|

Re: OpenLayers.Filter.Function with property parameter ?

brking
That is useful information and a possible workaround. Is there any way to inject a raw XML filter into the WFS request as text with OpenLayers ?