//points 格式[{ lon: '', lat:'', data: { ... }, }] //planepositions格式[ [ [ lon,lat ], [ lon,lat ], ... ], [ [ lon,lat ], [ lon,lat ], ... ], ] 核心代码: points.forEach((point) => { planepositions.forEach((poly) => { if (turf.booleanPointInPolygon(turf.point([point.lon, point.lat]), turf.polygon([poly]))) { console.log(point, "范围内", point.data.name); point.inpolybox = true//标记范围内点位 } else { } }) }) console.log(points)
cesium 通过turf 计算点位是否在面内
于 2024-04-24 16:24:44 首次发布