Andrea Aime wrote: > 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? > Andrea we literally *cannot* have a default geometry palceholder expression (the specification is not open); the concept of default geometry is just how the renderer chooses to handle the case where a NULL geometry is provided (that is the user has not specified a specific geometry to renderer so we are expected to look at the data schema and figure out what to do - some of our models happen to mark out which geometry they would like the renderer to choose).
I think for the spatial operators we are expected to filter against *all* geometries ... if you look at Justin's email that was more the direction he was leaning. Cheers, Jody ------------------------------------------------------------------------- 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
