Closed GioF closed 11 months ago
Hello @GioF, my understanding is that functions like that are working properly only in case parameters are not null, otherwise, in case any geometry is NULL it will return NULL, which is kind of unexpected anyway and comparison with FALSE anyway will be failed.
Here is an example of requests and results:
select ST_DWithin(track, track, 0) from laps;
result:
st_dwithin|
----------+
false |
true |
select ST_DWithin(track, null, 0) from laps;
result with nulls:
st_dwithin|
----------+
|
|
And another example with result = 0:
select count(*) from laps where ST_DWithin(track, null, 0);
Maybe it is possible to check the null value on code level and pass only not null geometries? But also maybe it should be supported like it is supported on PG side, with nullable parameters and nullable result, I will think about how to do that, or you can create a PR for that.
Functions which support nullable parameters are implemented in separate module functions_nullable, this is done because return type should have also being changed and it could lead to backward incompatible changes. Example of usage in d_within_test
Implemented in v2.3.0.
Sadly i couldn't take a look on how to implement this because i was busy with personal matters, but i will look into the code to learn a bit. Either way, thanks!
This is great! Also a big thank you from me.
The error above appears when attempting to call st_d_within with a column of type Nullable.