zoukankan      html  css  js  c++  java
  • 根据折线经纬度获取的折线平行线

    /** 
    * @Title: main 
    * @Description: TODO(经纬度根据获取折线的平行线) 
    * @param list 平行线
    * @param angle (公里数)距离真实线范围 经纬度大概按照0.0011为100米进行计算
    * @return List<Double[]> 平行线坐标数组{0:lon,1:lat}
    * @throws 
    */ 
    public static List<Double[]> getParallelLine(List<Map<String, Object>> list, double angle) {
    List<Double[]> listd = new ArrayList<>();
    for (int i = 1; i < list.size() - 1; i++) {
    
    /*后一个点*/
    Map<String, Object> map_1 = list.get(i + 1);
    Double[] result_1 = getTrueGrod(map_1);
    Double lon_1 = result_1[0];
    Double lat_1 = result_1[1];
    
    /*中间一个点*/
    Map<String, Object> map = list.get(i);
    Double[] result = getTrueGrod(map);
    Double lon = result[0];
    Double lat = result[1];
    
    /*前一个点*/
    Map<String, Object> map_2 = list.get(i - 1);
    Double[] result_2 = getTrueGrod(map_2);
    Double lon_2 = result_2[0];
    Double lat_2 = result_2[1];
    //System.out.println(angle * 1000 / 100 * 0.00105+"经纬度");
    Double[] result_t = getResuleGrod(lon, lat, lon_1, lat_1, lon_2, lat_2, angle * 10 * 0.0011);
    listd.add(result_t);
    }
    return listd;
    
    }
    
    /** 
    * @Title: getResuleGrod 
    * @Description: TODO(根据三个点获取顶点经纬度位置) 
    * @return Double[] 
    * @throws 
    */ 
    private static Double[] getResuleGrod(double x, double y, double x1, double y1, double x2, double y2, double t) {
    if (y2 - y == 0 || y - y == 0)
    y = y - 0.0000001;
    double angle1 = Math.atan(x2 - x / y2 - y);
    double angle2 = Math.atan(x - x1 / y - y1);
    
    double angle3 = 0.5 * (angle2 - angle1 - Math.PI);
    double angle4 = angle1 + angle3;
    double distance = t / Math.sin(angle3);
    x = x + distance * Math.cos(angle4);
    y = y + distance * Math.sin(angle4);
    Double[] result = new Double[] { x , y };
    return result;
    }
  • 相关阅读:
    pip安装flask问题解决
    GRE新东方推荐学习方法(2010年左右)
    使用eclipse IDE遇到的问题
    2014年互联网大会(商业价值,北京,7月)
    Indexing the World Wide Web: the Journey So Far阅读笔记
    Big Data Opportunities and Challenges(by周志华)论文要点
    spark常用算子总结
    使用Faster R-CNN做目标检测
    Oracle 性能调优 SQL_TRACE
    Oracle 性能调优 10053事件
  • 原文地址:https://www.cnblogs.com/seeyou1993/p/11474082.html
Copyright © 2011-2022 走看看