燕山石化溯源三维电子沙盘-【后端】-服务
13693261870
2023-06-05 c65f8b4b17fe859580252c59b75e4e03ed85b6c8
修改溯源势力图的层级
已修改1个文件
33 ■■■■ 文件已修改
src/main/java/com/yssh/utils/CalculateUtils.java 33 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yssh/utils/CalculateUtils.java
@@ -7,13 +7,13 @@
public class CalculateUtils {
    /**
     * @Title: getLon
     * @Description: 计算经度
     * @param @param x
     * @param @param y
     * @param @return 参数
     * @return double 返回类型
     * @throws
     * @Title: getLon
     * @Description: 计算经度
     */
    public static double getLon(int x, int y) {
        double lon = 115.9165227 + 0.000116732 * (x - 0.5) + 0.00000116862 * (y - 0.5);
@@ -24,13 +24,13 @@
    }
    /**
     * @Title: getLat
     * @Description: 计算维度
     * @param @param x
     * @param @param y
     * @param @return 参数
     * @return double 返回类型
     * @throws
     * @Title: getLat
     * @Description: 计算维度
     */
    public static double getLat(int x, int y) {
        double lat = 39.77250000 + 0.000001000 * (x - 0.5) - 0.00009000000 * (y - 0.5);
@@ -41,12 +41,12 @@
    }
    
    /**
     * @Title: assembleId
     * @Description: 组装id
     * @param @param checkPoints
     * @param @return 参数
     * @return List<String> 返回类型
     * @throws
     * @Title: assembleId
     * @Description: 组装id
     */
    public static List<String> assembleId(List<MonitorPointPosition> checkPoints){
        List<String> ids2d = new ArrayList<String>();
@@ -57,13 +57,13 @@
    }
    
    /**
     * @Title: aloneCrosswiseScope
     * @Description: 单独点位横向范围扩展
     * @param @param checkPoint
     * @param @param range
     * @param @return 参数
     * @return List<String> 返回类型
     * @throws
     * @Title: aloneCrosswiseScope
     * @Description: 单独点位横向范围扩展
     * @backup 强制将层级改为 0
     */
    public static List<String> aloneCrosswiseExtend(MonitorPointPosition checkPoint, int range){
        List<String> ids = new ArrayList<String>();
@@ -71,7 +71,8 @@
        Integer y = checkPoint.getY();
        for (int i = x - range/2; i <= x + range/2; i++) {
            for (int j = y - range/2; j <= y + range/2; j++) {
                ids.add(i + "_" + j + "_" + checkPoint.getZ());
                // ids.add(i + "_" + j + "_" + checkPoint.getZ());
                ids.add(i + "_" + j + "_" + 0);
            }
        }
        return ids;
@@ -93,24 +94,24 @@
    }
    
    /**
     * @Title: getWindSpeed
     * @Description: 计算风速
     * @param @return 参数
     * @return Double 返回类型
     * @throws
     * @Title: getWindSpeed
     * @Description: 计算风速
     */
    public static Double getWindSpeed(double v, double u){
        return Math.sqrt(v * v + u * u);
    }
    
    /**
     * @Title: getWindDirection
     * @Description: 计算风向
     * @param @param v
     * @param @param u
     * @param @return 参数
     * @return double 返回类型
     * @throws
     * @Title: getWindDirection
     * @Description: 计算风向
     */
    public static double getWindDirection(double v, double u){
        double result = Math.atan(u / (v + Math.pow(10, -5))) / Math.PI * 180;
@@ -123,14 +124,14 @@
    }
    
    /**
     * @Title: sort
     * @Description: 排序
     * @param @param list 排序对象
     * @param @param property 排序参数
     * @param @param order 排序顺序
     * @param @return 参数
     * @return List<Map<String,Object>> 返回类型
     * @throws
     * @Title: sort
     * @Description: 排序
     */
    public static List<Map<String, Object>> sort(List<Map<String, Object>> list,final String property,final boolean order){
        if(list == null || property == null){