| | |
| | | import cn.flightfeather.supervision.common.utils.ExcelUtil |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Scense |
| | | import cn.flightfeather.supervision.domain.ds1.mapper.ScenseMapper |
| | | import org.springframework.stereotype.Component |
| | | import tk.mybatis.mapper.entity.Example |
| | | import kotlin.math.PI |
| | | |
| | | /** |
| | | * 路段周边查询 |
| | | */ |
| | | @Component |
| | | class LocationRoadNearby(private val scenseMapper: ScenseMapper) { |
| | | |
| | | private val utilFile = UtilFile() |
| | |
| | | } |
| | | utilFile.index = 1 |
| | | } |
| | | utilFile.outPutToFile() |
| | | utilFile.outPutToFile(distance) |
| | | } |
| | | |
| | | /** |
| | | * 根据圆心和半径查询范围内监测点(当前简化操作,改为以直径为边长的正方形范围) |
| | | * @param center 圆心 |
| | | * @param radius 半径(单位:米) |
| | | * @return 场景列表 |
| | | */ |
| | | fun searchByRadius(center: Pair<Double, Double>, radius: Double): List<Scense> { |
| | | // 求经度的最小值 |
| | | val minLng = CoordinateUtil.getPointByLen(center, radius, PI * 1.5).first |
| | | // 求经度的最大值 |
| | | val maxLng = CoordinateUtil.getPointByLen(center, radius, PI * 0.5).first |
| | | // 求纬度的最小值 |
| | | val minLat = CoordinateUtil.getPointByLen(center, radius, PI).second |
| | | // 求纬度的最大值 |
| | | val maxLat = CoordinateUtil.getPointByLen(center, radius, .0).second |
| | | |
| | | val list = listOf(minLng, maxLng, minLat, maxLat) |
| | | return getSceneFromDb(list) |
| | | } |
| | | |
| | | /** |
| | |
| | | .orIsNull("extension1")) |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * 精确计算 |
| | | */ |
| | | // private fun checkDistance(scense: Scense):Boolean { |
| | | // |
| | | // } |
| | | } |