فهرست منبع

添加 tiledMap 注释

wuweihao 4 سال پیش
والد
کامیت
c90f286980

+ 11 - 0
laser/src/main/java/com/fdkankan/indoor/base/convert/quadTree/Solution.java

@@ -109,6 +109,7 @@ public class Solution {
 		}
 		
 		int max = Math.max(maxX, maxY);
+		max = getMaxDepth(max);
 		int[][] numthree = new int[max][max];
 		
 		for(int i=0;i<max;++i) {
@@ -195,6 +196,16 @@ public class Solution {
 		}
 	}
 
+
+	private int getMaxDepth(int max) {
+		for(int i=0;i<10;++i) {
+			if(Math.pow(2, i)>=max) {
+				return (int)Math.pow(2, i);
+			}
+		}
+		return -1;
+	}
+
 	public static void main(String args[]) {
 		String path = "F:\\test\\ngin\\age_laser_data\\w-60\\results\\laserData\\cover\\0";
 		Solution solution = new Solution();

+ 13 - 0
laser/src/main/java/com/fdkankan/indoor/core/entity/dto/TiledMapDto.java

@@ -5,6 +5,19 @@ import lombok.Data;
 
 /**
  * Created by owen on 2021/8/20 0020 11:41
+ *
+ * bundle_id:1
+ * file_name: "$DEPTH/$X/$Y.png"
+ * file_path: "data/bundle/building_{building的id}/map_tiles/{floor的id}"
+ * floor_id: 所在楼层的id
+ * id: 唯一就行
+ * location: 数据集的原点,和datasets的location一样
+ * map_size_m: 自己生成的
+ * max_depth: 目录的最大值,算法部会给到json文件里
+ * orientation:根据datasets里的orientation,计算得到的
+ * quadtree: 根据文件目录,计算得到的
+ * tile_size_px: 256
+ * type: "TILED_PYRAMID"
  */
 @Data
 public class TiledMapDto {

+ 16 - 1
laser/src/main/java/com/fdkankan/indoor/core/service/impl/TiledMapServiceImpl.java

@@ -74,6 +74,20 @@ public class TiledMapServiceImpl extends IBaseServiceImpl implements TiledMapSer
 
     /**
      * 基本数据写死
+     *
+     * bundle_id:1
+     * file_name: "$DEPTH/$X/$Y.png"
+     * file_path: "data/bundle/building_{building的id}/map_tiles/{floor的id}"
+     * floor_id: 所在楼层的id
+     * id: 唯一就行
+     * location: 数据集的原点,和datasets的location一样
+     * map_size_m: 自己生成的
+     * max_depth: 目录的最大值,算法部会给到json文件里
+     * orientation:根据datasets里的orientation,计算得到的
+     * quadtree: 根据文件目录,计算得到的
+     * tile_size_px: 256
+     * type: "TILED_PYRAMID"
+     *
      * @param param
      * @return
      */
@@ -86,10 +100,11 @@ public class TiledMapServiceImpl extends IBaseServiceImpl implements TiledMapSer
         /**
          * data/bundle/building_1/map_tiles/11
          * building_1: bundle_id值
-         * 11:floor_id值
+         * 11=floor_id值:site_model.type:floor的id
          */
         dto.setFile_path("data/building_1/map");
         dto.setFile_name("$DEPTH/$X/$Y.png");
+        // 11=floor_id值:site_model.type:floor的id
         dto.setFloor_id(11);
         /**
          * /阿里云-四维时代-官网测试服务器-120.25.146.52