如何划分不规则的多边形插入谷歌地图V2相等的面积 [英] How to divide irregular polygon into equal areas on Google map V2

查看:353
本文介绍了如何划分不规则的多边形插入谷歌地图V2相等的面积的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发采样旱田农业用途的应用程序。在那,用户可以通过点击地图,这将根据抽头的数目创建多边形选择氨基酸旱田。我能够创建多边形和能够获得多边形的面积。但现在我需要把它分成面积相等。

I am developing an application for sampling Glebe for agriculture purpose. In That a user can select a a Glebe by tapping on map which will create a polygon according to the number of taps. I am able to create that polygon and able to get the area of the polygon. But Now I need to divide it into equal areas.

例如,如果多边形的面积为50m ^ 2,那么它会被划分为1平方公尺50区。相同的功能已在 农业precision应用 。请看下面的图像。我需要划分多边形下同图像,并显示它里面的点。

For example, If the polygon's area is 50m^2 then it'll be divided into 50 areas of 1 m^2. Same functionality has been done in Agri Precision App. Find below image. I need to divide the polygon same as below image and show the points inside it.

有关获得区,我使用谷歌地图Utilty库它的算法中也为网格集群。我想同样喜欢上面的图片。在上面的图片,他们每5公顷划分区域。由于所有面积85公顷,因此总积分应显示将是17。这就是它是如何工作的。

For getting Area, I am using Google Map Utilty Lib It has an algo also for Grid Clustering. I want same like above image. In above image, they have divided area per 5 Hectares. Since all area is 85 Hectares, so total points should be shown will be 17. That is what How it works.

所以我的问题是:

如何根据地图上的多边形的面积,这样我可以在地图上绘制这些点找到这些点?

推荐答案

没有约束已给出的glebes的形状,所以这里是将履行问题陈述通过建立一个星形分解的解决方案。它假定多边形是凸的:

No constraint has been given on the shape of the glebes, so here is a solution that will fulfill the problem statement by building a star-shaped decomposition. It assumes that the polygon is convex:

  • 任意选择一个主顶点。

  • Arbitrarily select a main vertex.

由加盟主顶点依次逢缘,给人区三角形三角测量多边形 A1 A2 A3 ...

Triangulate the polygon by joining the main vertex to every edge in turn, giving triangles of areas A1, A2, A3...

开始围绕多边形之旅,从主顶点。如果第一三角形是比期望的面积大( A 1>一种),发现沿着边缘点,使得其将细分三角形中的子三角形的所需的区域。继续从这里就行,其余子三角形(其面积 A1-A )。否则,从期望的区域减去第一个三角形的面积,并继续行程( A 现在 A-A1

Start a trip around the polygon, from the main vertex. If the first triangle is larger than the desired area (A1 > A), find the point along the edge such that it will subdivide the triangle in a sub-triangle of the desired area. Continue the trip from here with the remaining sub-triangle (having area A1-A). Otherwise, subtract the area of the first triangle from the desired area and continue the trip (A now A-A1).

这是非常相似的分裂对实线 N 的间隔序列插入 K 等长的间隔

This is very similar to splitting a sequence of N intervals on the real line into K intervals of equal length.

我的猜测是,星形分解不会适合你。

My guess is that a star-shape decomposition will not suit you.

这篇关于如何划分不规则的多边形插入谷歌地图V2相等的面积的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆