- 开始使用
- MEASUREMENT
- COORDINATE MUTATION
- TRANSFORMATION
- FEATURE CONVERSION
- MISC
- HELPER
- RANDOM
- DATA
- INTERPOLATION
- JOINS
- GRIDS
- CLASSIFICATION
- AGGREGATION
- META
- ASSERTIONS
- BOOLEANS
- UNIT CONVERSION
文章来源于网络收集而来,版权归原创者所有,如有侵权请及时联系!
空间连接
Takes a set of points and a set of polygons and performs a spatial join.
取一组点和一组多边形,并执行空间连接。
参数
参数 | 类型 | 描述 |
---|---|---|
points | FeatureCollection <Point> | input points |
polygons | FeatureCollection <Polygon> | input polygons |
field | string | property in polygons to add to joined { } features |
outField | string | property in points in which to store joined property from polygons |
返回
FeatureCollection <Point> - points with containingPolyId property containing values from polyId
示例
var pt1 = turf.point([-77, 44]);
var pt2 = turf.point([-77, 38]);
var poly1 = turf.polygon([[
[-81, 41], // 注意:polygon首尾坐标要一致
[-81, 47],
[-72, 47],
[-72, 41],
[-81, 41]
]], {pop: 3000});
var poly2 = turf.polygon([[
[-81, 35],
[-81, 41],
[-72, 41],
[-72, 35],
[-81, 35]
]], {pop: 1000});
var points = turf.featureCollection([pt1, pt2]);
var polygons = turf.featureCollection([poly1, poly2]);
var tagged = turf.tag(points, polygons, 'pop', 'population');
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论