Andrea Aime wrote:
> On Tue, Dec 21, 2010 at 6:57 AM, Miles Jordan
> <[email protected]> wrote:
>> Hmm.. trying to use the PropertyExists function and not sure how to
> reference the feature. I would have thought that it would only take
> one argument, the propertyName, but the docs say:
>>
>> Name - PropertyExists Arguments - f:Feature, propertyName:String
>> Description - Returns true if f has a property named propertyName
>>
>  All functions get the current feature as an implicit argument. I
> guess the documentation is wrong :-p
>
> The function would have to be called like:
>
> <ogc:Function name="PropertyExists">
>   <ogc:Literal>MY_PROPERTY</ogc:Literal>
> </ogc:Function>

That's what I thought, in fact I tried it, but got a NPE. Digging deeper, it 
works fine by itself but not inside of a boolean operation. i.e. this works:

<ogc:Filter>
  <ogc:PropertyExists>
    <ogc:Literal>MY_PROPERTY</ogc:Literal>
  </ogc:PropertyExists>
</ogc:Filter>

But this does not:

<ogc:Filter>
        <ogc:And>
                <ogc:PropertyExists>
                        <ogc:Literal>MY_PROPERTY</ogc:Literal>
                </ogc:PropertyExists>
                <ogc:PropertyIsEqualTo>
                        <ogc:PropertyName>MY_PROPERTY</ogc:PropertyName>
                        <ogc:Literal>1</ogc:Literal>
                </ogc:PropertyIsEqualTo>
        </ogc:And>
</ogc:Filter>

In fact, the Boolean operation will work with other functions, just not with 
PropertyExists. Any final thoughts before I head over to JIRA? I haven't tried 
this on the latest Beta.

Log excerpt: http://pastebin.com/82KWWkpu

Regards,

Miles



___________________________________________________________________________

    Australian Antarctic Division - Commonwealth of Australia
IMPORTANT: This transmission is intended for the addressee only. If you are not 
the
intended recipient, you are notified that use or dissemination of this 
communication is
strictly prohibited by Commonwealth law. If you have received this transmission 
in error,
please notify the sender immediately by e-mail or by telephoning +61 3 6232 
3209 and
DELETE the message.
        Visit our web site at http://www.antarctica.gov.au/
___________________________________________________________________________
------------------------------------------------------------------------------
Forrester recently released a report on the Return on Investment (ROI) of
Google Apps. They found a 300% ROI, 38%-56% cost savings, and break-even
within 7 months.  Over 3 million businesses have gone Google with Google Apps:
an online email calendar, and document program that's accessible from your 
browser. Read the Forrester report: http://p.sf.net/sfu/googleapps-sfnew
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to