浏览代码

dev1.1版本: 修改了用原点处理漫游点坐标,只是改漫游点使用

wuweihao 3 年之前
父节点
当前提交
f46e25f459

+ 13 - 8
laser/src/main/java/com/fdkankan/indoor/base/convert/ConvertToVision.java

@@ -64,31 +64,32 @@ public class ConvertToVision {
 
 
 	/**
-	 * 初始化vision数据
+	 * 初始化vision数据 漫游点数据
 	 * @param sceneCode
 	 * @param panoInfos
 	 * @param from web(手动控制点), null(默认控制点)
 	 * @param isMerge 是否合并
+	 * @param sp 特殊点
 	 * @return
 	 */
-	private  JSONArray createVisionToFilter(String sceneCode, JSONArray panoInfos,  ControlPointCalculateEntity calculateEntity, String from, boolean isMerge) {
+	private  JSONArray createVisionToFilter(String sceneCode, JSONArray panoInfos, ControlPointCalculateEntity calculateEntity, String from, boolean isMerge, SpecialPointEntity sp) {
 
 		JSONArray laserPanos = new JSONArray();
 		int visionSize = panoInfos.size();
 		log.info("漫游点位数量: {}", visionSize);
 		log.info("from: {}", from);
+		Double[] originalPoint = sp.getPoi();
+		log.info("原点: {}", sp.getPoi());
 		for(int i=0;i< visionSize;++i) {
 			JSONObject item = panoInfos.getJSONObject(i);
 			JSONObject laserPano = new JSONObject();
 			int id = item.getInt("id");
 			laserPano.put("camera_head_id", 12);
 			laserPano.put("dataset_id", 1);
-//			laserPano.put("file_path", "data/chunk1");
 			// 2021-8-26
 			laserPano.put("file_path", "data/" + sceneCode);
 			laserPano.put("hidden", false);
 			laserPano.put("id", id);
-//			laserPano.put("site_model_entity_id", 12);
 			// 2021-09-06改用floor类型的id
 			laserPano.put("site_model_entity_id", 11);
 
@@ -106,13 +107,17 @@ public class ConvertToVision {
 			floor_location[1] = position2.getDouble("y");
 			floor_location[2] = position2.getDouble("z");
 			//gis坐标
-			double[] _location = GisCoordinateUtil.transformLocationToBL(location[0], location[1], calculateEntity);
+//			double[] _location = GisCoordinateUtil.transformLocationToBL(location[0], location[1], calculateEntity);
+			// 2021-12-30
+			double[] _location = GisCoordinateTransform.convertByProj4ToGps(location[0], location[1],originalPoint);
 			if (_location == null) {
 				String msg = "_location坐标转换异常";
 				log.error(msg);
 				throw new BaseRuntimeException(msg);
 			}
-			double[] _floor_location = GisCoordinateUtil.transformLocationToBL(floor_location[0], floor_location[1], calculateEntity);
+//			double[] _floor_location = GisCoordinateUtil.transformLocationToBL(floor_location[0], floor_location[1], calculateEntity);
+			// 2021-12-30
+			double[] _floor_location = GisCoordinateTransform.convertByProj4ToGps(floor_location[0], floor_location[1], originalPoint);
 			if (_floor_location == null) {
 				String msg = "_floor_location坐标转换异常";
 				log.error(msg);
@@ -198,14 +203,14 @@ public class ConvertToVision {
 
 
 
-	public  JSONArray createFilter(String sceneCode, String path, ControlPointCalculateEntity calculateEntity, String from, boolean isMerge){
+	public  JSONArray createFilter(String sceneCode, String path, ControlPointCalculateEntity calculateEntity, String from, boolean isMerge, SpecialPointEntity sp){
 		if (!cn.hutool.core.io.FileUtil.isFile(path)) {
 			log.error("文件路径不存在: {}", path);
 			throw new RuntimeException("文件路径不存在");
 		}
 		try {
 			JSONArray panoInfos = readVisionTxt(path);
-			return createVisionToFilter(sceneCode, panoInfos, calculateEntity, from, isMerge);
+			return createVisionToFilter(sceneCode, panoInfos, calculateEntity, from, isMerge, sp);
 		} catch (IOException e) {
 			e.printStackTrace();
 		}

+ 3 - 159
laser/src/main/java/com/fdkankan/indoor/base/convert/FixRouteMap.java

@@ -63,7 +63,6 @@ public class FixRouteMap {
     public static List<String> updateRouteMap(double orientation, double[] gpsLocation, ControlPointCalculateEntity controlPoint, String path) throws Exception {
 
         // dataSet.location的gps坐标转本地坐标
-//        double[] ageLocation = GisCoordinateUtil.convertGpsToLocation(gpsLocation, controlPoint);
         double[] ageLocation = GisCoordinateUtil.transformBLToLocation(gpsLocation[0], gpsLocation[1], controlPoint);
 
         // 新的本地坐标, 转出来应该是原点, 很接近0
@@ -124,7 +123,6 @@ public class FixRouteMap {
     public static  List<JSONObject> getRotate(double orientation, double[] gpsLocation, ControlPointCalculateEntity controlPoint, String path)  {
 
         // dataSet.location的gps坐标转本地坐标
-//        double[] ageLocation = GisCoordinateUtil.convertGpsToLocation(gpsLocation, controlPoint);
         double[] ageLocation = GisCoordinateUtil.transformBLToLocation(gpsLocation[0], gpsLocation[1], controlPoint);
 
         // 新的本地坐标, 转出来应该是原点, 很接近0
@@ -191,161 +189,7 @@ public class FixRouteMap {
 
     }
 
-//    /**
-//     * 旋转平移
-//     * @param orientation
-//     * @param gpsLocation
-//     * @param controlPoint
-//     * @param path
-//     * @return
-//     * @throws Exception
-//     */
-//    public static  List<JSONObject> getRotate(double orientation, double[] gpsLocation, ControlPointEntity controlPoint, String path)  {
-//
-//        // dataSet.location的gps坐标转本地坐标
-//        double[] ageLocation = GisCoordinateUtil.convertGpsToLocation(gpsLocation, controlPoint);
-//
-//        // 新的本地坐标, 转出来应该是原点, 很接近0
-//        JSONObject newLocation = new JSONObject();
-//        newLocation.put("x", ageLocation[0]);
-//        newLocation.put("y", ageLocation[1]);
-//        newLocation.put("z", gpsLocation[2]);
-//        log.info("newLocation: {}", newLocation );
-//
-//
-//        double[] newMatrix = getTransfromMatrix(orientation, newLocation);
-//
-//
-//        // 读取棋盘的坐标,读文件final_freespace.csv,不要读数据库,最初的坐标
-//        String routePath = path + "/final_freespace.csv";
-//        log.info("routePath: {}", routePath);
-//        if (!cn.hutool.core.io.FileUtil.isFile(routePath)){
-//            log.info("输入路径有误, path: {}", routePath);
-//            throw new BaseRuntimeException(MsgCode.e3001, "final_freespace.csv路径有误,文件不存在");
-//        }
-//        List<String> list = null;
-//        try {
-//            list = FileUtil.readFileByLines2(routePath);
-//            log.info("数据读取成功");
-//
-//            // 修改棋盘每个顶点坐标,然后再入库
-//            List<JSONObject> newRoute = new ArrayList<>();
-//            for (String line : list) {
-//                // 将每一行的坐标值获取处理进行修改
-//                String[] split = line.split(" ");
-//
-//                double[] oldPoint = {Double.valueOf(split[0]), Double.valueOf(split[1]), Double.valueOf(split[2])};
-//                double[] newPoint =  applyMatrix4(oldPoint,newMatrix);
-//
-//                StringBuilder lineBuffer = new StringBuilder();
-//
-//                for (int i = 0; i < split.length; i++) {
-//                    if (i>3) {
-//                        lineBuffer.append(split[i]);
-//                        if (i != split.length-1){
-//                            lineBuffer.append(" ");
-//                        }
-//                    }
-//
-//                }
-//                JSONObject linkedIds = new JSONObject();
-//                linkedIds.put("linkedIds", lineBuffer.toString());
-//
-//                linkedIds.put("x", newPoint[0]);
-//                linkedIds.put("y", newPoint[1]);
-//                linkedIds.put("z", newPoint[2]);
-//                linkedIds.put("k", split[3]);
-//                newRoute.add(linkedIds);
-//
-//
-//            }
-//            log.info("数据解析成功");
-//            return newRoute;
-//        } catch (Exception e) {
-//            e.printStackTrace();
-//        }
-//
-//        return null;
-//
-//    }
-
-//    /**
-//     * 本地测试 修改 Route数据
-//     * @param args
-//     * @throws Exception
-//     */
-//    public static void main(String[] args) throws Exception {
-////        FixRouteMap fixRouteMap = new FixRouteMap();
-//
-//        //对应的是datasets表里的orientation
-//        double newOrientation = 0;
-//
-//        //需要转换,将gis坐标转换本地坐标
-//        //将datasets表里location的坐标还原成本地坐标
-////        double[] gpsLocation = {113.595719800031, 22.3666054020125, 0.0};
-//        double[] gpsLocation = {113.59571980003058, 22.36660540201251, 0};
-//        // 将 gps 同 age
-//
-//        // 控制点
-//        ControlPointEntity controlPoint = new ControlPointEntity();
-//        double[] controlCoordinate1 = {113.595725873337,22.366579193007}; //gps坐标
-//        double[] controlCoordinate2 = {113.595757230122,22.3666213677456};  //gps坐标
-//
-//        double[] controlLocation1 = {0.617759,-2.904041};  // 四维看看坐标
-//        double[] controlLocation2 = {3.859914,1.75765}; // 四维看看坐标
-//
-//
-//        controlPoint.setGpsControlCoordinate1(controlCoordinate1);
-//        controlPoint.setGpsControlCoordinate2(controlCoordinate2);
-//        controlPoint.setAgeControlLocation1(controlLocation1);
-//        controlPoint.setAgeControlLocation2(controlLocation2);
-//        double[] ageLocation = GisCoordinateUtil.convertGpsToLocation(gpsLocation, controlPoint);
-//
-//        // 新的本地坐标
-//        JSONObject newLocation = new JSONObject();
-//        newLocation.put("x", ageLocation[0]);
-//        newLocation.put("y", ageLocation[1]);
-//        newLocation.put("z", gpsLocation[2]);
-//        log.info("ageLocation: {}", newLocation );
-//
-//
-//
-//        double[] newMatrix = getTransfromMatrix(newOrientation, newLocation);
-//
-//
-//        // 读取棋盘的坐标,读文件final_freespace.csv,不要读数据库,最初的坐标
-//
-//        String path = "F:\\test\\project\\age_laser\\laserData";
-//        String routePath = path + "/final_freespace.csv";
-//        log.info("routePath: {}", routePath);
-//        if (!cn.hutool.core.io.FileUtil.isFile(routePath)){
-//            log.info("输入路径有误, path: {}", routePath);
-//            throw new BaseRuntimeException(MsgCode.e3001, "final_freespace.csv路径有误,文件不存在");
-//        }
-//        List<String> list = FileUtil.readFileByLines2(routePath);
-//
-//        // 修改棋盘每个顶点坐标,然后再入库
-//        List<String> newRoute = new ArrayList<>();
-//        for (String line : list) {
-//            // 将每一行的坐标值获取处理进行修改
-//            String[] split = line.split(" ");
-//
-//            double[] oldPoint = {Double.valueOf(split[0]), Double.valueOf(split[1]), Double.valueOf(split[2])};
-//            double[] newPoint =  applyMatrix4(oldPoint,newMatrix);  //修改棋盘每个顶点坐标,然后再入库
-//
-//            String newLine = Arrays.asList(newPoint[0], newPoint[1], newPoint[2], split[3], split[4],
-//                    split[5], split[6], split[7], split[8], split[9], split[10], split[11]).toString();
-//
-//            // 去逗号
-//            newLine = newLine.replaceAll(",", "");
-//            newLine = newLine.replace("[", "");
-//            newLine = newLine.replace("]", "");
-//            System.out.println(newLine);
-//            newRoute.add(newLine);
-//        }
-//
-//        System.out.println("执行完成");
-//
-//
-//    }
+
+
+
 }

+ 99 - 0
laser/src/main/java/com/fdkankan/indoor/base/convert/GisCoordinateTransform.java

@@ -3,6 +3,8 @@ package com.fdkankan.indoor.base.convert;
 import lombok.extern.slf4j.Slf4j;
 import org.locationtech.proj4j.*;
 
+import java.math.BigDecimal;
+
 /**
  * 提供常国家用坐标系转换方法
  */
@@ -59,6 +61,103 @@ public  class GisCoordinateTransform {
 
     }
 
+    /**
+     * proj4的常用坐标转换方法
+     * @param x   经度或者x轴
+     * @param y   纬度或者y轴
+     * @param csName1  坐标系代码   原始数据坐标系 "EPSG:4326";  "EPSG:3857";
+     * @param csName2   坐标系代码  结果数据坐标系
+     * @return
+     */
+    public static double[] convertByProj4_1(double x,double y,String csName1,String csName2) {
+        CRSFactory csFactory = new CRSFactory();
+
+
+        CoordinateReferenceSystem crs1 = csFactory.createFromParameters("WGS 84 (long/lat)","+proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees");
+        CoordinateReferenceSystem crs2 = csFactory.createFromParameters("WGS84","+proj=tmerc +ellps=WGS84 +lon_0=116.434376069193 +lat_0=39.9199287112848");
+        BasicCoordinateTransform transform = new BasicCoordinateTransform(crs1, crs2);
+        ProjCoordinate pt1 = new ProjCoordinate(x, y);
+        ProjCoordinate pt2 = new ProjCoordinate();
+
+
+        ProjCoordinate p = transform.transform(pt1, pt2);
+        double[] xy=new double[2];
+        xy[0]=p.x;
+        xy[1]=p.y;
+        if (xy == null) {
+            log.error("这里出现空值,应该抛出异常");
+        }
+        return  xy;
+    }
+
+
+
+
+
+
+
+    /**
+     * 2021-12-30
+     * 经纬度转本地 反
+     * @param x
+     * @param y
+     * @param csName1
+     * @param csName2
+     * @return
+     */
+    public static double[] convertByProj4ToLoction(double x,double y,String csName1,String csName2) {
+        CRSFactory crsFactory = new CRSFactory();
+        CoordinateReferenceSystem crs1 = crsFactory.createFromParameters("WGS 84 (long/lat)","+proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees");
+        CoordinateReferenceSystem crs2 = crsFactory.createFromParameters("WGS84","+proj=tmerc +ellps=WGS84 +lon_0=116.434376069193 +lat_0=39.9199287112848");
+
+        BigDecimal d3 = new BigDecimal(x);
+        BigDecimal d4 =  new BigDecimal(y);
+        ProjCoordinate pt11 = new ProjCoordinate(d3.doubleValue(), d4.doubleValue());
+        ProjCoordinate pt21 = new ProjCoordinate();
+        BasicCoordinateTransform transform21 = new BasicCoordinateTransform( crs1,crs2);
+        ProjCoordinate p = transform21.transform(pt11, pt21);
+
+
+        double[] xy=new double[2];
+        xy[0]=p.x;
+        xy[1]=p.y;
+        if (xy == null) {
+            log.error("这里出现空值,应该抛出异常");
+        }
+        return  xy;
+    }
+
+    /**
+     * 2021-12-30
+     * 本地转经纬度 (正)
+     * @param x
+     * @param y
+     * @param originalPoint 原点
+     * @return lon_0、lat_0:取原点中心点坐标
+     */
+    public static double[] convertByProj4ToGps(double x,double y, Double[] originalPoint) {
+        CRSFactory crsFactory = new CRSFactory();
+        CoordinateReferenceSystem crs1 = crsFactory.createFromParameters("WGS 84 (long/lat)","+proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees");
+        // +proj=tmerc +ellps=WGS84 +lon_0=116.434376069193 +lat_0=39.9199287112848
+        String str = "+proj=tmerc +ellps=WGS84 +lon_0=" + originalPoint[0] + "lat_0=" + originalPoint[1];
+        CoordinateReferenceSystem crs2 = crsFactory.createFromParameters("WGS84", str);
+
+        BasicCoordinateTransform transform = new BasicCoordinateTransform(crs2, crs1);
+        BigDecimal d1 = new BigDecimal(x);
+        BigDecimal d2 =  new BigDecimal(y);
+        ProjCoordinate pt1 = new ProjCoordinate(d1.doubleValue(),d2.doubleValue() );
+        ProjCoordinate pt2 = new ProjCoordinate();
+
+        ProjCoordinate p = transform.transform(pt1, pt2);
+        double[] xy=new double[2];
+        xy[0]=p.x;
+        xy[1]=p.y;
+        if (xy == null) {
+            log.error("这里出现空值,应该抛出异常");
+        }
+        return  xy;
+    }
+
 
 
 

+ 31 - 91
laser/src/main/java/com/fdkankan/indoor/base/convert/GisCoordinateUtil.java

@@ -62,19 +62,18 @@ public class GisCoordinateUtil {
 
 
     /**
-     * 本地坐标转经纬度
+     * 本地坐标转经纬度, 转原点使用这个
      * 这里可以获取平面坐标, 结果是很大的
      * @param loctionX
      * @param loctionY
      * @return
      */
-    public static  double[] transformLocationToBL(double loctionX,double loctionY, ControlPointCalculateEntity dto){
+    public static  double[] transformLocationToBL(double loctionX, double loctionY, ControlPointCalculateEntity dto){
         Point point = new Point(loctionX,loctionY);
 
             Point resultPoint = AffineTransform.transformBoePoint(new Point(point.getX(), point.getY()), dto.getRotation2(), dto.getScale2(), dto.getDx2(), dto.getDy2());
-//            log.info("toBL输入参数:{}, {}", resultPoint.getX(), resultPoint.getY());
             double[] doubles = GisCoordinateTransform.convertByProj4(resultPoint.getX(), resultPoint.getY(), "EPSG:4547", "EPSG:4490");
-            if (doubles == null) {
+        if (doubles == null) {
                 String msg = "坐标转换为空值";
                 log.error(msg);
                 throw new BaseRuntimeException(msg);
@@ -85,6 +84,25 @@ public class GisCoordinateUtil {
 
 
     /**
+     * 本地坐标转经纬度
+     * 这里可以获取平面坐标, 结果是很大的
+     * @param loctionX
+     * @param loctionY
+     * @return
+     */
+//    public static  double[] transformLocationToBL(double loctionX, double loctionY){
+//        // 2021-12-30
+//        double[] doubles = GisCoordinateTransform.convertByProj4ToGps(loctionX, loctionY, "", "");
+//        if (doubles == null) {
+//            String msg = "坐标转换为空值";
+//            log.error(msg);
+//            throw new BaseRuntimeException(msg);
+//        }
+//        return doubles;
+//
+//    }
+
+    /**
      * 经纬度转本地坐标
      * @param lon 经度 十进制度
      * @param lat 纬度 十进制度
@@ -111,106 +129,28 @@ public class GisCoordinateUtil {
         double[] location=new double[2];
         location[0]=resultPoint.getX();
         location[1]=resultPoint.getY();
+
         return location;
     }
 
-    /**
 
     /**
-     * 解析控制点文件
-     *
-     * @param controlPointsFileUrl 控制点文件路径
+     * 2021-12-30
+     * 经纬度转本地坐标
+     * @param lon 经度 十进制度
+     * @param lat 纬度 十进制度
      */
-//    public static void parseControlPointsFile(String controlPointsFileUrl) {
-//        String jsonStr = "";
-//        try {
-//            File file = new File(controlPointsFileUrl);
-//            FileReader fileReader = new FileReader(file);
-//            Reader reader = new InputStreamReader(new FileInputStream(file), "Utf-8");
-//            int ch = 0;
-//            StringBuffer sb = new StringBuffer();
-//            while ((ch = reader.read()) != -1) {
-//                sb.append((char) ch);
-//            }
-//            fileReader.close();
-//            reader.close();
-//            jsonStr = sb.toString();
-//            parseJSON(jsonStr);
-//        } catch (Exception e) {
-//            System.out.println("文件内部格式错误!");
-//        }
+//    public static  double[] transformBLToLocation(double lon,double lat, ControlPointCalculateEntity dto){
+//        double[] doubles = GisCoordinateTransform.convertByProj4ToLoction(lon, lat, "", "");
+//
+//        return doubles;
 //    }
 
 
 
 
 
-    /**
-     * 2021-09-07
-     * 采用本地坐标
-     * P1和P2是人工输入的本地坐标
-     * defaultP1和defaultP2是采用算法部给的控制点将人工输入的gis坐标转换成本地坐标
-     * 这四个参数:defaultP1和defaultP2(来自人工输入的gis坐标,再通过默认控制点转换成本地坐标),P1和P2(人工输入的本地坐标)
-     * @param defaultP1
-     * @param defaultP2
-     * @param P1
-     * @param P2
-     * @return
-     */
-    private static double getOrientation(double[] defaultP1,double[] defaultP2,double[] P1,double[] P2){
-
-
-        double dx1 = defaultP2[0] - defaultP1[0];
-        double dy1 = defaultP2[1] - defaultP1[1];
-        double dz1 = 0;
-
-        double dx2 = P2[0] - P1[0];
-        double dy2 = P2[1] - P1[1];
-        double dz2 = 0;
-
-        double lengthSq1 = dx1*dx1 + dy1*dy1;
-        double lengthSq2 = dx2*dx2 + dy2*dy2;
-
-        double denominator = Math.sqrt( lengthSq1 * lengthSq2 );
-
-        double angle = 0;
-        if ( denominator == 0 ) {
-            angle = Math.PI / 2;
-        }
-
-        double theta = (dx1*dx2+dy1*dy2) / denominator;
 
-        //angle = Math.acos( MathUtils.clamp( theta, - 1, 1 ) );
-        angle = Math.acos( Math.max(- 1, Math.min(theta, 1)) );
-        //if(vec1.clone().cross(vec2).z < 0)angle *= -1 //这里不确定是<0还是>0
-        double ax = dx1;
-        double ay = dy1;
-        if((dx1*dy2-dy1*dx2)<0) {
-            angle *= -1;
-        }
-        return angle;
-    }
-
-
-    /**
-     * 求方位角度
-     * @param x
-     * @param y
-     * @return
-     */
-    private static  double azimyth(double x,double y){
-        double returnValue=0;
-        if(y>0&&x>0){
-            returnValue=Math.atan(y/x);
-        }else if(y>0&&x<0){
-            returnValue=Math.PI- Math.atan(y/Math.abs(x));
-        }else if(y<0&&x<0){
-            returnValue=Math.PI+Math.atan(y/x);
-        }else if(y<0&&x>0){
-            returnValue=2*Math.PI-Math.atan(Math.abs(y)/x);
-        }
-        return  returnValue;
-    }
 
 
 

+ 2 - 54
laser/src/main/java/com/fdkankan/indoor/base/convert/ModifyCloud.java

@@ -65,47 +65,16 @@ public class ModifyCloud {
 		return result;
 	}
 
-//	//把原点(0,0,0)的坐标转换成gps坐标
-//	public static double[] convertFromOrigin(ControlPointEntity dto) {
-//		double[] location = {0,0,0};
-//		location = TransformGPS.convertLocationToGis(location, dto);
-//		return location;
-//	}
+
 
 	//把原点(0,0,0)的坐标转换成gps坐标
 	public static double[] convertFromOrigin(ControlPointCalculateEntity dto) {
 		double[] location = {0,0,0};
-//		location = TransformGPS.convertLocationToGis(location, dto);
 		location = GisCoordinateUtil.transformLocationToBL(location[0], location[1], dto);
 		return location;
 	}
 
 
-//	public static double[] convertFromOrigin() {
-//		double[] location = {0,0,0};
-//		location = TransformGPS.convert(location);
-//		return location;
-//	}
-
-//	//把boundingbox的顶点和中心点转换成gps坐标
-//	public static JSONObject convertFromBoundingBox(JSONObject boundingBox, ControlPointEntity dto) {
-//		double[] max = {boundingBox.getDouble("maxX"),boundingBox.getDouble("maxY"),boundingBox.getDouble("maxZ")};
-//		double[] min = {boundingBox.getDouble("minX"),boundingBox.getDouble("minY"),boundingBox.getDouble("minZ")};
-//		double[] centre = {boundingBox.getDouble("centreX"),boundingBox.getDouble("centreY"),boundingBox.getDouble("centreZ")};
-//
-//
-//		max = TransformGPS.convertLocationToGis(max, dto);
-//		min = TransformGPS.convertLocationToGis(min, dto);
-//		centre = TransformGPS.convertLocationToGis(centre, dto);
-//		// 处理centreZ
-//		double[] newCentre = {centre[0],centre[1], boundingBox.getDouble("centreZ")} ;
-//
-//		JSONObject result = new JSONObject();
-//		result.put("max", max);
-//		result.put("min", min);
-//		result.put("centre", newCentre);
-//		return result;
-//	}
 
 
 	//把boundingbox的顶点和中心点转换成gps坐标
@@ -115,9 +84,6 @@ public class ModifyCloud {
 		double[] centre = {boundingBox.getDouble("centreX"),boundingBox.getDouble("centreY"),boundingBox.getDouble("centreZ")};
 
 
-//		max = TransformGPS.convertLocationToGis(max, dto);
-//		min = TransformGPS.convertLocationToGis(min, dto);
-//		centre = TransformGPS.convertLocationToGis(centre, dto);
 		max = GisCoordinateUtil.transformLocationToBL(max[0], max[1], dto);
 		min = GisCoordinateUtil.transformLocationToBL(min[0], max[1], dto);
 		centre = GisCoordinateUtil.transformLocationToBL(centre[0], centre[1], dto);
@@ -131,25 +97,7 @@ public class ModifyCloud {
 		return result;
 	}
 
-	//把boundingbox的顶点和中心点转换成gps坐标
-//	public static JSONObject convertFromBoundingBox(JSONObject boundingBox) {
-//		double[] max = {boundingBox.getDouble("maxX"),boundingBox.getDouble("maxY"),boundingBox.getDouble("maxZ")};
-//		double[] min = {boundingBox.getDouble("minX"),boundingBox.getDouble("minY"),boundingBox.getDouble("minZ")};
-//		double[] centre = {boundingBox.getDouble("centreX"),boundingBox.getDouble("centreY"),boundingBox.getDouble("centreZ")};
-//
-//
-//		max = TransformGPS.convert(max);
-//		min = TransformGPS.convert(min);
-//		centre = TransformGPS.convert(centre);
-//		// 处理centreZ
-//		double[] newCentre = {centre[0],centre[1], boundingBox.getDouble("centreZ")} ;
-//
-//		JSONObject result = new JSONObject();
-//		result.put("max", max);
-//		result.put("min", min);
-//		result.put("centre", newCentre);
-//		return result;
-//	}
+
 
 
     /**

+ 1 - 1
laser/src/main/java/com/fdkankan/indoor/core/service/PoseService.java

@@ -7,5 +7,5 @@ import com.fdkankan.indoor.base.util.Result;
  */
 public interface PoseService {
 
-    Result reposes(String sceneCode);
+//    Result reposes(String sceneCode);
 }

+ 0 - 241
laser/src/main/java/com/fdkankan/indoor/core/service/impl/CloudServiceImpl.java

@@ -76,246 +76,5 @@ public class CloudServiceImpl extends IBaseServiceImpl implements CloudService {
         return Result.success();
     }
 
-//    /**
-//     * 处理上传的点云数据:siteModel -> 原点、中心点、最大点、最小点
-//     * @param sceneCode 场景码
-//     * @param laserDataPath 基础路径
-//     * @param controlPoint 控制点
-//     */
-//    private void processCoule(String sceneCode, String laserDataPath, ControlPointEntity controlPoint){
-//       String path = laserDataPath + "/webcloud/cloud.js";
-//        // 处理原点,将原点坐标转为坐标, 转换后的原点只有经纬度,没有高度, 高度现在默认是0
-//        double[] doubles = ModifyCloud.convertFromOrigin(controlPoint);
-//        // 2021-08-4 原点默认 z:0
-//        Double[] gpsOrigin = {doubles[0] ,doubles[1], 0.0};
-//        // 将数据保存到db, dateSet数据location使用
-//        saveSpecialPoint(sceneCode, TypeConstant.POI_ORIGIN, null, gpsOrigin);
-//        log.info("原点保存成功");
-//
-//        try {
-//            // 修改cloud.js文件
-//            JSONObject info = ModifyCloud.fixCloud(path);
-//
-//            cn.hutool.core.io.FileUtil.writeUtf8String(info.toString(), path);
-//            log.info("新的cloud.js写入服务器完成:{}", path);
-//
-//            /**
-//             * 将boundingBox坐标转换成gis坐标, site_model需要
-//             * boundingBox:虚拟点坐标,存特殊点, dataSet数据要使用
-//             */
-//            JSONObject boundingBox = ModifyCloud.getBoundingBox(info);
-//            Double maxX = boundingBox.getDouble("maxX");
-//            Double maxY = boundingBox.getDouble("maxY");
-//            Double maxZ = boundingBox.getDouble("maxZ");
-//
-//            Double minX = boundingBox.getDouble("minX");
-//            Double minY = boundingBox.getDouble("minY");
-//            Double minZ = boundingBox.getDouble("minZ");
-//
-//            Double centreX = boundingBox.getDouble("centreX");
-//            Double centreY = boundingBox.getDouble("centreY");
-//            Double centreZ = boundingBox.getDouble("centreZ");
-//
-//
-//            // 虚拟点坐标(四维看看坐标)
-//            Double[] ageMax = {maxX,maxY,maxZ};
-//            Double[] ageMin = {minX,minY,minZ};
-//            Double[] ageCentre = {centreX,centreY,centreZ};
-//
-//            JSONObject resJson = ModifyCloud.convertFromBoundingBox(boundingBox, controlPoint);
-//
-//            Double[] gpsMax = getKey(resJson, "max");
-//            Double[] gpsMin = getKey(resJson, "min");
-//            Double[] gpsCentre = getKeyZ(resJson, "centre");
-//
-//            // 将数据保存到db
-//            saveSpecialPoint(sceneCode, TypeConstant.POI_BOUNDINGBOX_MAX, ageMax, gpsMax);
-//            saveSpecialPoint(sceneCode, TypeConstant.POI_BOUNDINGBOX_MIN, ageMin, gpsMin);
-//            saveSpecialPoint(sceneCode, TypeConstant.POI_CENTRE, ageCentre, gpsCentre);
-//            log.info("max、min、中心点保存成功");
-//
-//
-//            // 创建sitModel
-//            createSiteModel(sceneCode, gpsMax, gpsMin, gpsCentre, maxZ, minZ);
-//
-//        } catch (IOException e) {
-//            e.printStackTrace();
-//        }
-//    }
 
-
-    /**
-     * 处理上传的点云数据:siteModel -> 原点、中心点、最大点、最小点
-     * @param sceneCode 场景码
-     * @param laserDataPath 基础路径
-     * @param controlPoint 控制点
-     */
-    private void processCoule(String sceneCode, String laserDataPath, ControlPointCalculateEntity controlPoint){
-        String path = laserDataPath + "/webcloud/cloud.js";
-        // 处理原点,将原点坐标转为坐标, 转换后的原点只有经纬度,没有高度, 高度现在默认是0
-        double[] doubles = ModifyCloud.convertFromOrigin(controlPoint);
-        // 2021-08-4 原点默认 z:0
-        Double[] gpsOrigin = {doubles[0] ,doubles[1], 0.0};
-        // 将数据保存到db, dateSet数据location使用
-        saveSpecialPoint(sceneCode, TypeConstant.POI_ORIGIN, null, gpsOrigin);
-        log.info("原点保存成功");
-
-        try {
-            // 修改cloud.js文件
-            JSONObject info = ModifyCloud.fixCloud(path);
-
-            cn.hutool.core.io.FileUtil.writeUtf8String(info.toString(), path);
-            log.info("新的cloud.js写入服务器完成:{}", path);
-
-            /**
-             * 将boundingBox坐标转换成gis坐标, site_model需要
-             * boundingBox:虚拟点坐标,存特殊点, dataSet数据要使用
-             */
-            JSONObject boundingBox = ModifyCloud.getBoundingBox(info);
-            Double maxX = boundingBox.getDouble("maxX");
-            Double maxY = boundingBox.getDouble("maxY");
-            Double maxZ = boundingBox.getDouble("maxZ");
-
-            Double minX = boundingBox.getDouble("minX");
-            Double minY = boundingBox.getDouble("minY");
-            Double minZ = boundingBox.getDouble("minZ");
-
-            Double centreX = boundingBox.getDouble("centreX");
-            Double centreY = boundingBox.getDouble("centreY");
-            Double centreZ = boundingBox.getDouble("centreZ");
-
-
-            // 虚拟点坐标(四维看看坐标)
-            Double[] ageMax = {maxX,maxY,maxZ};
-            Double[] ageMin = {minX,minY,minZ};
-            Double[] ageCentre = {centreX,centreY,centreZ};
-
-            JSONObject resJson = ModifyCloud.convertFromBoundingBox(boundingBox, controlPoint);
-
-            Double[] gpsMax = getKey(resJson, "max");
-            Double[] gpsMin = getKey(resJson, "min");
-            Double[] gpsCentre = getKeyZ(resJson, "centre");
-
-            // 将数据保存到db
-            saveSpecialPoint(sceneCode, TypeConstant.POI_BOUNDINGBOX_MAX, ageMax, gpsMax);
-            saveSpecialPoint(sceneCode, TypeConstant.POI_BOUNDINGBOX_MIN, ageMin, gpsMin);
-            saveSpecialPoint(sceneCode, TypeConstant.POI_CENTRE, ageCentre, gpsCentre);
-            log.info("max、min、中心点保存成功");
-
-
-            // 创建sitModel
-            createSiteModel(sceneCode, gpsMax, gpsMin, gpsCentre, maxZ, minZ);
-
-        } catch (IOException e) {
-            e.printStackTrace();
-        }
-    }
-
-
-    /**
-     * 获取两个值的
-     * json数组转 double[]
-     * @param resJson
-     * @param key
-     * @return
-     */
-    private Double[] getKey(JSONObject resJson , String key){
-        JSONArray array = resJson.getJSONArray(key);
-        Double[] res = {array.getDouble(0), array.getDouble(1)};
-        return res;
-    }
-
-    /**
-     * 获取三个值的
-     * @param resJson
-     * @param key
-     * @return
-     */
-    private Double[] getKeyZ(JSONObject resJson , String key){
-        JSONArray array = resJson.getJSONArray(key);
-        Double[] res = {array.getDouble(0), array.getDouble(1), array.getDouble(2)};
-        return res;
-    }
-
-
-
-    /***
-     * 保存特质点
-     * @param sceneCode 场景码
-     * @param poiKey key
-     * @param agePoi 虚拟点坐标(四维看看坐标)
-     */
-    private void saveSpecialPoint(String sceneCode, String poiKey, Double[] agePoi, Double[] gpsPoi){
-        SpecialPointEntity entity = new SpecialPointEntity();
-        entity.setId(SnowFlakeUUidUtils.getUuid("SP"));
-        entity.setUpdateTime(LocalDateTime.now());
-        entity.setSceneCode(sceneCode);
-        entity.setPoiKey(poiKey);
-        entity.setPoi(agePoi);
-        entity.setGpsPoi(gpsPoi);
-        specialPointService.save(entity);
-    }
-
-    private void createSiteModel(String sceneCode,  Double[] max,  Double[] min,  Double[] centre, Double maxZ, Double minZ){
-        //读取初始文件
-        String content = cn.hutool.core.io.FileUtil.readUtf8String(configConstant.templatePath + "/site_model.json");
-        List<SiteDto> siteModels = JSON.parseArray(content, SiteDto.class);
-        // z_max、z_min 替换site_model的Floor、root类型
-        // max、min四个顶点替换BUILDING、FLOOR 的coordinates,
-        // 顺时针,(x_max,y_max),(x_max,y_min),(x_min,y_min),(x_min,y_max)
-        // 一般参数1:x, 参数2:Y
-        Double[] peak_1 = {max[0],max[1]};
-        Double[] peak_2 = {max[0],min[1]};
-        Double[] peak_3 = {min[0],min[1]};
-        Double[] peak_4 = {min[0],max[1]};
-        List<List<Double[]>> doubles = Arrays.asList(Arrays.asList(peak_1, peak_2, peak_3, peak_4));
-
-        // centre 替换BUILDING、FLOOR、ROOM 的center
-        log.info("中心点:{}, {}, {}", centre[0], centre[1], centre[2]);
-        siteModels.forEach(p -> {
-            // 第一层:BUILDING,处理centre、coordinates
-            p.setCenter(centre);
-            SitePolygon polygon = p.getPolygon();
-
-            //  BUILDING. coordinates, max、min四个顶点替换
-            polygon.setCoordinates(doubles);
-
-            // 第二层:FLOOR 层
-            List<SiteDto> children = p.getChildren();
-            if (children.size() > 0) {
-                children.forEach(c ->{
-                    c.setCenter(centre);
-                    c.setZ_max(maxZ);
-                    c.setZ_min(minZ);
-
-                    // 第三层: ROOM层
-                    List<SiteDto> roomChildren = c.getChildren();
-                    if (roomChildren.size() > 0) {
-                        roomChildren.forEach(r -> {
-                            r.setCenter(centre);
-                            r.setZ_max(maxZ);
-                            r.setZ_min(minZ);
-                            SitePolygon rPolygon = r.getPolygon();
-                            rPolygon.setCoordinates(doubles);
-                        });
-                    }
-                });
-            }
-
-        });
-
-        log.info("siteMode数据解析完成");
-        SiteModelEntity modelEntity = siteService.findById(sceneCode);
-        if (modelEntity != null) {
-            siteService.remove(sceneCode);
-            log.info("删除旧siteModel数据完成");
-        }
-        SiteModelEntity entity = new SiteModelEntity();
-        entity.setId(sceneCode);
-        entity.setCreateTime(LocalDateTime.now());
-        // 默认热点为空
-        entity.setData(siteModels);
-        siteService.save(entity);
-        log.info("siteModel数据初始化创建完成");
-    }
 }

+ 23 - 7
laser/src/main/java/com/fdkankan/indoor/core/service/impl/InitServiceImpl.java

@@ -301,12 +301,14 @@ public class InitServiceImpl implements InitService {
         log.info("更新控制点计算完成");
 
 
-        // step1: 处理vision.txt 创建filter表, 处理特殊点:firstView
-        createFilter(sceneCode, laserDataPath, calculateEntity, from);
+
 
         // step2 处理could.js、创建sitModel, 使用的是代码初始化,创建site_model, 处理原点、中心点、最大点、最小点
         processCould(sceneCode, laserDataPath, calculateEntity);
 
+        // step1: vision.txt 漫游点处理,2021-12-30 处理vision.txt 创建filter表, 处理特殊点:firstView, 需要使用原点
+        createFilter(sceneCode, laserDataPath, calculateEntity, from);
+
         // step6 创建t_configs表, 使用的是模板数据 , 需要firstView;
         createConfig(sceneCode);
 
@@ -615,12 +617,14 @@ public class InitServiceImpl implements InitService {
         controlPointCalculateService.saveEntity(calculateEntity);
         log.info("更新控制点计算完成");
 
-        // step1: 处理vision.txt 创建filter表, 处理特殊点:firstView
-        createFilter(sceneCode, laserDataPath, calculateEntity, from);
+
 
         // step2 处理could.js 使用的是代码初始化,创建site_model, 处理原点、中心点、最大点、最小点
         processCould(sceneCode, laserDataPath, calculateEntity);
 
+        // step1: 2021-12-30 处理vision.txt 创建filter表, 处理特殊点:firstView, 需要使用原点
+        createFilter(sceneCode, laserDataPath, calculateEntity, from);
+
         // step6 创建t_configs表, 使用的是模板数据 , 需要firstView;
         createConfig(sceneCode);
 
@@ -646,13 +650,25 @@ public class InitServiceImpl implements InitService {
 
 
 
-    // 这个不能本地调试
+
+    /**
+     * 这个不能本地调试
+     * vision.txt 漫游点数据
+     * @param sceneCode
+     * @param path
+     * @param calculateEntity
+     * @param from
+     */
     private void createFilter(String sceneCode, String path, ControlPointCalculateEntity calculateEntity, String from) {
         path = path + "/vision.txt";
         if (!cn.hutool.core.io.FileUtil.isFile(path)) {
             throw new BaseRuntimeException(MsgCode.e3001, "vision.txt不存在");
         }
-        JSONArray jsonArray = convertToVision.createFilter(sceneCode, path, calculateEntity, from, false);
+
+        // 2021-12-30 根据场景码查询特殊点的原点
+        SpecialPointEntity sp = specialPointService.findBySceneCodeAndPoiKey(sceneCode, TypeConstant.POI_ORIGIN);
+
+        JSONArray jsonArray = convertToVision.createFilter(sceneCode, path, calculateEntity, from, false, sp);
         FilterEntity entity = new FilterEntity();
         entity.setId(sceneCode);
         entity.setCreateTime(LocalDateTime.now());
@@ -921,7 +937,7 @@ public class InitServiceImpl implements InitService {
             if (TypeConstant.POI_BOUNDINGBOX_MAX.equals(key) || TypeConstant.POI_BOUNDINGBOX_MIN.equals(key)) {
                 map.put(key, sp.getPoi());
             }
-            // 使用gps坐标
+            // 使用gps坐标, 原点
             if (TypeConstant.POI_ORIGIN.equals(key)) {
                 map.put(key, sp.getGpsPoi());
             }

+ 4 - 68
laser/src/main/java/com/fdkankan/indoor/core/service/impl/MergeSceneServiceImpl.java

@@ -7,7 +7,6 @@ import com.fdkankan.indoor.base.constant.ConfigConstant;
 import com.fdkankan.indoor.base.constant.MsgCode;
 import com.fdkankan.indoor.base.constant.TypeConstant;
 import com.fdkankan.indoor.base.convert.ConvertToVision;
-import com.fdkankan.indoor.base.convert.GisCoordinateUtil;
 import com.fdkankan.indoor.base.convert.ModifyCloud;
 import com.fdkankan.indoor.base.convert.ModifyDataSets;
 import com.fdkankan.indoor.base.exception.BaseRuntimeException;
@@ -464,27 +463,6 @@ public class MergeSceneServiceImpl extends IBaseServiceImpl implements MergeScen
      *   maxId: 输入的最大id
      */
     private Map<Object, Object> setFloor(List<SiteDto> dto, SiteDto floorDto, Integer maxId) {
-//        // 用来获取最大id
-//        List<Integer> ids = new ArrayList<>();
-//
-//        dto.forEach(p -> {
-//            ids.add(p.getId());
-//            List<SiteDto> floorChild = p.getChildren();
-//            floorChild.forEach(f -> {
-//                ids.add(f.getId());
-//
-//                List<SiteDto> roomChild = f.getChildren();
-//                roomChild.forEach(r -> {
-//                    ids.add(r.getId());
-//                });
-//
-//            });
-//
-//        });
-//
-//        // 获取最大id
-//        Integer maxId = ids.stream().reduce(Integer::max).get();
-//        log.info("最大id: {}" , maxId);
 
         for (SiteDto buildingDto : dto) {
             List<SiteDto> floorChild = buildingDto.getChildren();
@@ -505,51 +483,7 @@ public class MergeSceneServiceImpl extends IBaseServiceImpl implements MergeScen
     }
 
 
-//    /**
-//     *
-//     * @param dto 原数据
-//     * @param floorDto  需要加入的楼层
-//     */
-//    private Map<Object, Object> setFloor(List<SiteDto> dto, SiteDto floorDto) {
-//        // 用来获取最大id
-//        List<Integer> ids = new ArrayList<>();
-//
-//        dto.forEach(p -> {
-//            ids.add(p.getId());
-//            List<SiteDto> floorChild = p.getChildren();
-//            floorChild.forEach(f -> {
-//                ids.add(f.getId());
-//
-//                List<SiteDto> roomChild = f.getChildren();
-//                roomChild.forEach(r -> {
-//                    ids.add(r.getId());
-//                });
-//
-//            });
-//
-//        });
-//
-//        // 获取最大id
-//        Integer maxId = ids.stream().reduce(Integer::max).get();
-//        log.info("最大id: {}" , maxId);
-//
-//        for (SiteDto buildingDto : dto) {
-//            List<SiteDto> floorChild = buildingDto.getChildren();
-//            maxId ++;
-//            floorDto.setId(maxId);
-//            floorChild.add(floorDto);
-//        }
-//
-//        Map<Object, Object> result = new HashMap<>();
-//        log.info("返回值最大id: {}" , maxId);
-//        result.put("maxId", maxId);
-//        result.put("data", dto);
-//
-//        // 提供给dataSet使用
-//        ids.add(maxId);
-//        return result;
-//
-//    }
+
 
 
     /**
@@ -606,8 +540,10 @@ public class MergeSceneServiceImpl extends IBaseServiceImpl implements MergeScen
         /**
          * 2021-09-14 todo 这里使用web
          * 2021-11-05 合并时不需要记录firstView到数据库
+         * 2021-12-30 加入特殊点的原点
          * */
-        JSONArray jsonArray = convertToVision.createFilter(sceneCode, path, dto, "web", true);
+        SpecialPointEntity sp = specialPointService.findBySceneCodeAndPoiKey(sceneCode, TypeConstant.POI_ORIGIN);
+        JSONArray jsonArray = convertToVision.createFilter(sceneCode, path, dto, "web", true, sp);
         FilterEntity entity = new FilterEntity();
         entity.setId(sceneCode);
         entity.setCreateTime(LocalDateTime.now());

+ 56 - 57
laser/src/main/java/com/fdkankan/indoor/core/service/impl/PoseServiceImpl.java

@@ -43,65 +43,64 @@ public class PoseServiceImpl extends IBaseServiceImpl implements PoseService {
     @Autowired
     ControlPointCalculateService controlPointCalculateService;
 
-    @Override
-    public Result reposes(String sceneCode) {
-        List<DataSetPo> data = dataSetService.getDataBySceneCode(sceneCode);
-
-//        ControlPointEntity controlPoint = controlPointService.findById(sceneCode);
-        ControlPointCalculateEntity controlPoint = controlPointCalculateService.findById(sceneCode);
-
-        if (controlPoint == null) {
-            String msg = "控制点计算表结果不存在,尝试重算解决";
-            log.error(msg);
-            return Result.failure(msg);
-        }
-
-
-
-        List<PoseVo> resList = new ArrayList<>();
-        for (DataSetPo po : data) {
-            PoseVo vo = new PoseVo();
-            vo.setSceneNum(po.getSceneNum());
-            vo.setDataSetId(po.getId());
-            vo.setPath(po.getPath());
-
-            //rotation对应的是orientation处理的值
-            vo.setRotation(setFromEuler(po.getOrientation()));
-
-            //translation对应的是还原location的值
-            vo.setTranslation(exeTranslation(po.getLocation(), controlPoint));
-
-            resList.add(vo);
-        }
-
-        String initPath = "";
-        if ("dev".equals(configConstant.active)) {
-             initPath = configConstant.serverBasePath + "/" + sceneCode + "/results";
-        } else {
-            initPath = redisPath(sceneCode);
-        }
-        String savePath = initPath  + "/pose.json";
-        log.info("pose.json保存路径: {}", savePath);
-        JSONArray array = JSONArray.parseArray(JSON.toJSONString(resList));
-        FileUtil.writeUtf8String(array.toJSONString(), savePath );
-        log.info("pose.json完成");
-
-
-        return Result.success(savePath);
-    }
+//    @Override
+//    public Result reposes(String sceneCode) {
+//        List<DataSetPo> data = dataSetService.getDataBySceneCode(sceneCode);
+//
+//        ControlPointCalculateEntity controlPoint = controlPointCalculateService.findById(sceneCode);
+//
+//        if (controlPoint == null) {
+//            String msg = "控制点计算表结果不存在,尝试重算解决";
+//            log.error(msg);
+//            return Result.failure(msg);
+//        }
+//
+//
+//
+//        List<PoseVo> resList = new ArrayList<>();
+//        for (DataSetPo po : data) {
+//            PoseVo vo = new PoseVo();
+//            vo.setSceneNum(po.getSceneNum());
+//            vo.setDataSetId(po.getId());
+//            vo.setPath(po.getPath());
+//
+//            //rotation对应的是orientation处理的值
+//            vo.setRotation(setFromEuler(po.getOrientation()));
+//
+//            //translation对应的是还原location的值
+//            vo.setTranslation(exeTranslation(po.getLocation(), controlPoint));
+//
+//            resList.add(vo);
+//        }
+//
+//        String initPath = "";
+//        if ("dev".equals(configConstant.active)) {
+//             initPath = configConstant.serverBasePath + "/" + sceneCode + "/results";
+//        } else {
+//            initPath = redisPath(sceneCode);
+//        }
+//        String savePath = initPath  + "/pose.json";
+//        log.info("pose.json保存路径: {}", savePath);
+//        JSONArray array = JSONArray.parseArray(JSON.toJSONString(resList));
+//        FileUtil.writeUtf8String(array.toJSONString(), savePath );
+//        log.info("pose.json完成");
+//
+//
+//        return Result.success(savePath);
+//    }
 
     // 本地gps坐标转本地坐标
-    private static JSONObject exeTranslation(Double[] location, ControlPointCalculateEntity controlPoint){
-        double[] gpsLocation = {location[0], location[1], location[2]};
-//        double[] translation = GisCoordinateUtil.convertGpsToLocation(gpsLocation, controlPoint);
-        double[] translation = GisCoordinateUtil.transformBLToLocation(gpsLocation[0], gpsLocation[1], controlPoint);
-        JSONObject translationJson = new JSONObject();
-        translationJson.put("x", translation[0]);
-        translationJson.put("y", translation[1]);
-        // z:不变
-        translationJson.put("z", gpsLocation[2]);
-        return translationJson;
-    }
+//    private static JSONObject exeTranslation(Double[] location, ControlPointCalculateEntity controlPoint){
+//        double[] gpsLocation = {location[0], location[1], location[2]};
+////        double[] translation = GisCoordinateUtil.convertGpsToLocation(gpsLocation, controlPoint);
+//        double[] translation = GisCoordinateUtil.transformBLToLocation(gpsLocation[0], gpsLocation[1], controlPoint);
+//        JSONObject translationJson = new JSONObject();
+//        translationJson.put("x", translation[0]);
+//        translationJson.put("y", translation[1]);
+//        // z:不变
+//        translationJson.put("z", gpsLocation[2]);
+//        return translationJson;
+//    }
 
 //    @Test
 //    public void gpsToAge(){