mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 15:12:02 +00:00
Fix pointInPolygon with nan
This commit is contained in:
parent
7c83679a37
commit
1daf1146e1
@ -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;
|
||||
|
||||
|
@ -0,0 +1 @@
|
||||
0
|
1
tests/queries/0_stateless/00500_point_in_polygon_nan.sql
Normal file
1
tests/queries/0_stateless/00500_point_in_polygon_nan.sql
Normal 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)]);
|
Loading…
Reference in New Issue
Block a user