Justin Deoliveira ha scritto: > Hi all, > > I have run into a situation I am not sure how to solve. What happens > when a binary operator runs into a null value. Right now the null value > gets converted to the string "null" and the comparison proceeds, this > leads to strange results. > > So what is one to do. I can think of a couple of options: > > 1. throw an exception > 2. evaluate the filter to false
I'd like this one. But this makes me think about default geometries and Jody's example in the "geometry assumption" thread. What do you do if the binary operation is a spatial operator and one of the argument is null? The current geotools approach seems to be, to take the default geometry, (at least that's what I see in GeometryFilterImpl in 2.2.x/2.3.x branch). Well, I guess that instead of having an Expression.NULL, we should have a default geometry expression (Expression.DEFAULT_GEOMETRY?, AttributeExpression.DEFAULT_GEOMETRY?), and if the user sets an Expression.NULL or plain null, false should be returned... am I making sense? Cheers Andrea PS: the DEFAULT_GEOMETRY expression could be implemented as suggested by Justin in fact... ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Geotools-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/geotools-devel
