v.20.5New Feature
Make pointInPolygon Compatible with Non-Constant Polygon Arrays
Make pointInPolygon work with non-constant polygon. PointInPolygon now can take Array(Array(Tuple(..., ...))) as second argument, array of polygon and holes. #10623 (Alexey Ilyukhov) #11421 (Alexey Ilyukhov).Why it matters
This enhancement allows users to pass dynamic and complex polygon structures (including holes) as the second argument ofpointInPolygon, enabling more flexible and accurate geospatial queries where polygon definitions vary per row rather than being fixed constants.How to use it
Use thepointInPolygon function with the second argument as Array(Array(Tuple(..., ...))), where each inner array represents a polygon and its holes. For example:SELECT pointInPolygon(<point_column>, <polygon_array_column>)
FROM <table>Here,
<polygon_array_column> is a column of type Array(Array(Tuple(Float64, Float64))) representing one or multiple polygons with holes.