I've noticed that using a PropertyIsNotEqualTo filter ANDed to a BBOX
filter on a dataset in a GetFeature request will return no results for
features with null values for the provided attribute. For example, I
have a dataset that returns no features matching the following query:
<wfs:Query typeName="test:REF.PHOTO_POINTS">
<ogc:Filter>
<ogc:And>
<ogc:BBOX>
<ogc:PropertyName>GEOMETRY</ogc:PropertyName>
<gml:Box srsName="EPSG:42102">
<gml:coordinates>
947603.8790916872,818440.7660532445
947830.6364613016,818731.015486351
</gml:coordinates>
</gml:Box>
</ogc:BBOX>
<ogc:PropertyIsNotEqualTo>
<ogc:PropertyName>PHOTO_SUBSTANDARD_CODE</ogc:PropertyName>
<ogc:Literal>Y</ogc:Literal>
</ogc:PropertyIsNotEqualTo>
</ogc:And>
</ogc:Filter>
</wfs:Query>
But returns features matching the following query:
<wfs:Query typeName="test:REF.PHOTO_POINTS">
<ogc:Filter>
<ogc:And>
<ogc:BBOX>
<ogc:PropertyName>GEOMETRY</ogc:PropertyName>
<gml:Box srsName="EPSG:42102">
<gml:coordinates>
947603.8790916872,818440.7660532445
947830.6364613016,818731.015486351
</gml:coordinates>
</gml:Box>
</ogc:BBOX>
<ogc:Or>
<ogc:PropertyIsNotEqualTo>
<ogc:PropertyName>PHOTO_SUBSTANDARD_CODE</ogc:PropertyName>
<ogc:Literal>Y</ogc:Literal>
</ogc:PropertyIsNotEqualTo>
<ogc:PropertyIsNull>
<ogc:PropertyName>PHOTO_SUBSTANDARD_CODE</ogc:PropertyName>
</ogc:PropertyIsNull>
</ogc:Or>
</ogc:And>
</ogc:Filter>
</wfs:Query>
I would think that any PropertyIsNotEqualTo filter should return true
for those features having a null value in the queried attribute, but
this may be subject to debate. Is this behaviour by design? Note that
I haven't tested it on its own (i.e. not ANDed to a BBOX) so I don't
know under what additional circumstances the behaviour is observed, if
any.
Thanks in advance for any info.
John