python - 如何获得一组二维点的每个 voronoi 区域的多边形?
问题描述
我有一组 2D 点和一些限制所有点的框。我想将每个点的最近邻区域作为多边形(匀称)对象,没有多边形超出边界框。可能吗?
buffer = 10
points = np.random.rand(1,100, (20,2))
# bounding box
xmin, ymin = points.min(axis=0) - buffer
xmax, ymax = points.max(axis=0) + buffer
vor = scipy.spatial.Voronoi(points)
# scipy.spatial.voronoi_plot_2d(vor) # <- How to get each region as shapely polygon??
解决方案
推荐阅读
- npm - Azure Devops 预定义变量 - 作为参数传递
- ruby-on-rails - Rails 6.1 出现 Wkhtmltopdf libpng15.so 错误
- sas - Proc 格式 do-loop SAS
- javascript - JavaScript 在第一次执行后不执行(WordPRess Gravity Forms 插件)
- java - 返回给定索引 i 处子列表中的项目数(如果有),否则为 0;
- kubernetes - Kubernetes@1 在 azure devops 管道中失败
- python - 如何以异步方式将函数的结果用于另一个函数
- java - 什么是 Spring ApplicationContextAware?
- php - 在登录用户所在的位置插入值并使用内部联接
- javascript - 如何使用javascript制作静音按钮