panlei
2019-11-07 5ae97eebd0dfcaad32e92f9df7b7f73caad922bf
ruleserver/geoPolygon.go
@@ -53,7 +53,11 @@
}
//GetLocation 将一个给定起始坐标,宽度长度的矩形区域均分为n方份并返回中心坐标(n为单边平分数值)和面积
<<<<<<< HEAD
func getLocation(rect structure.Rect, n int) ([]structure.Pointfloat, float64) {
=======
func getLocation(rect structure.Rect, n int) ([]Pointfloat, float64) {
>>>>>>> master
   xArr := make([]float64, n) // 用切片不用数组,数组不能用变量定义长度
   yArr := make([]float64, n)
   pointArr := make([]structure.Pointfloat, 0, n*n)
@@ -86,7 +90,11 @@
}
//PgsInterPercent calculate percent of two polygon intersection  计算两个多边形的重叠占比
<<<<<<< HEAD
func PgsInterPercent(pgpts []structure.Point, box structure.Rect, widthScale float64, heightScale float64) (percent float64) {
=======
func PgsInterPercent(pgpts []Point, box structure.Rect, widthScale float64, heightScale float64) (percent float64) {
>>>>>>> master
   areapts, areaBox := getLocation(box, 10)
   var count = 0