diff --git a/business/jxstore/report/report.go b/business/jxstore/report/report.go index b36b631da..34c09f10a 100644 --- a/business/jxstore/report/report.go +++ b/business/jxstore/report/report.go @@ -471,9 +471,11 @@ func CalculateCoverArea(coordinate []string, vendorID int) (area float64) { } var sum float64 for i := 0; i < len(xyList)-1; i++ { - sum += (xyList[i+1][0] - xyList[i][0]) * (xyList[i+1][1] + xyList[i][1]) + // sum += (xyList[i+1][0] - xyList[i][0]) * (xyList[i+1][1] + xyList[i][1]) + sum += xyList[i][0]*xyList[i+1][1] - xyList[i+1][0]*xyList[i][1] } - sum += (xyList[0][0] - xyList[len(xyList)-1][0]) * (xyList[0][1] + xyList[len(xyList)-1][1]) + // sum += (xyList[0][0] - xyList[len(xyList)-1][0]) * (xyList[0][1] + xyList[len(xyList)-1][1]) + sum += xyList[len(xyList)-1][0]*xyList[0][1] - xyList[0][0]*xyList[len(xyList)-1][1] sum /= float64(2) area, _ = decimal.NewFromFloat(sum).Round(3).Float64() return area