Fix pointInPolygon with nan

This commit is contained in:
Alexey Ilyukhov 2020-06-04 03:59:07 +03:00
parent 7c83679a37
commit 1daf1146e1
3 changed files with 5 additions and 0 deletions

View File

@ -358,6 +358,9 @@ bool PointInPolygonWithGrid<CoordinateType>::contains(CoordinateType x, Coordina
if (has_empty_bound)
return false;
if (std::isnan(x) || std::isnan(y))
return false;
CoordinateType float_row = (y + y_shift) * y_scale;
CoordinateType float_col = (x + x_shift) * x_scale;

View File

@ -0,0 +1 @@
0

View File

@ -0,0 +1 @@
SELECT pointInPolygon((nan, 10.000100135803223), [(39.83154, 21.41527), (2., 1000.0001220703125), (39.90033, 21.37195), (1.000100016593933, 10.000100135803223), (39.83051, 21.42553), (39.82898, 21.41382), (39.83043, 21.41432), (39.83154, 21.41527)]);