Function pointInPolygon() judges whether a 2D coordinate locates in (not outside or on ) the boundary of a polygon, and returns 1 for true, 0 for false.
Arguments:
Returns:

Exalmple: Direct calculate
UQLuncollect [[1.5,0.5],[2,2]] as point uncollect [[[1,0],[3,0],[3,1],[1,1]],[[1,0],[2,1],[1,2],[0,1]]] as polygon return table(toString(point), toString(polygon), pointInPolygon(point, polygon))
Result| toString(point) | toString(polygon) | pointInPolygon(point, polygon) | |-----------------|---------------------------|--------------------------------| | [1.5,0.5] | [[1,0],[3,0],[3,1],[1,1]] | 1 | | [2,2] | [[1,0],[2,1],[1,2],[0,1]] | 0 |
Exalmple: Multiply and calculate
UQLuncollect [[1.5,0.5],[2,2]] as point uncollect [[[1,0],[3,0],[3,1],[1,1]],[[1,0],[2,1],[1,2],[0,1]]] as polygon with pointInPolygon(point, polygon) as result return table(toString(point), toString(polygon), result)
Result| toString(point) | toString(polygon) | result | |-----------------|---------------------------|--------| | [1.5,0.5] | [[1,0],[3,0],[3,1],[1,1]] | 1 | | [1.5,0.5] | [[1,0],[2,1],[1,2],[0,1]] | 0 | | [2,2] | [[1,0],[3,0],[3,1],[1,1]] | 0 | | [2,2] | [[1,0],[2,1],[1,2],[0,1]] | 0 |