0 results when radius < 1
wujekbogdan opened this issue · comments
When radius
is between 0
and 1
then the query doesn't give any results. Is it a bug, or is it a desired behavior?
Thanks @wujekbogdan,
Currently there's an integer parsing for the radius, with:
$groupby .= $this->db->prepare(
" HAVING distance_value <= %d ",
$this->radius
);
but we can support floating point radius with:
$groupby .= $this->db->prepare(
" HAVING distance_value <= %f ",
$this->radius
);
I will update this in the next version, with corresponding integration tests.
@birgire
It would be great. At the moment it's a bit misleading because GeoQueryHaversine->setup
uses floatval
to parse lat/lng/radius so it looks like floats are valid values not only for lat/lng but for the radius as well.
@birgire
Thanks a lot for a quick update!