Tuesday 18 October 2011

Nothing to see here

A couple new abilities for the GeoTools filter system.
WFS2 includes two ways to check if an attribute does not have a value.
  • PropertyIsNull can be used to check that a property exists; and that the value is empty.
  • PropertyIsNil is used to check if a property exists at all
A quick example makes this difference easier to see:
    // test if "approval" equals "null"
    filter = ff.isNull("approved"));
    // this example checks if approved exists at all
    filter = ff.isNil("approved"),"no approval available");

I also found that I had missed documenting how FeatureId can be used to look up a feature by name; or at least identifier.
The example makes use of a Set of FeatureId to construct the appropriate Filter:

    Set selected = new HashSet();
    filter =;

Documentation harmed in the making of this post:

No comments: