Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Openlayers3中,如何判断多边形点坐是否为连续的面 #18

Closed
abbysiqi opened this issue Dec 19, 2018 · 2 comments
Closed

Openlayers3中,如何判断多边形点坐是否为连续的面 #18

abbysiqi opened this issue Dec 19, 2018 · 2 comments
Labels
question Further information is requested

Comments

@abbysiqi
Copy link

如下图所示,需要左侧效果,如果是右测效果该如何判断
123

@ParnDeedlit ParnDeedlit added the question Further information is requested label Dec 20, 2018
@ParnDeedlit
Copy link
Member

Turfjs

Turfjs是前端空间分析脚本,与任何第三方地图脚本如openlayers,leaflet,mapboxgl可以共用

问题描述

Turfjs在线帮助文档
该问题的本质实际上是自相交问题 intersection,在turfjs中使用kinks判断自相交的点的数量既可以判断是否自相交
tim 20181220182946

示例代码

var poly = turf.polygon([[
  [-12.034835, 8.901183],
  [-12.060413, 8.899826],
  [-12.03638, 8.873199],
  [-12.059383, 8.871418],
  [-12.034835, 8.901183]
]]);

var kinks = turf.kinks(poly);

@abbysiqi
Copy link
Author

已按照提示解决,感谢~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants