booleanPointInPolygon()
给定一个坐标和一个面(或多面),如果点在面内返回true。
var pt = turf.point([-77, 44]);
var poly = turf.polygon([[
[-81, 41],
[-81, 47],
[-72, 47],
[-72, 41],
[-81, 41]
]]);
turf.booleanPointInPolygon(pt, poly);
//= true
参数
| 参数名 | 类型 | 描述 |
|---|---|---|
| point | double[] | |
| polygon | Feature <Polygon> | Feature <MultiPolygon> | |
| options | Object |
options
| 参数名 | 类型 | 默认值 | 描述 |
|---|---|---|---|
| ignoreBoundary | boolean | true | 是否忽略多边形边界 |
返回值
boolean