package org.sxkj.odm.constant;
|
|
import org.sxkj.common.enums.WaylineTypeEnum;
|
|
import java.util.*;
|
|
/**
|
* odm 常量
|
* @author zhongrj
|
* @date 2024-09-11
|
*/
|
public class OdmConstant {
|
|
|
/**
|
* odm_user_token redis key
|
*/
|
public static final String ODM_USER_TOKEN_KEY = "odm:user:token:";
|
|
/**
|
* odm_user_token redis 有效时长(默认是6个小时)
|
*/
|
public static final Long ODM_USER_TOKEN_TIME = 6 * 60 * 60L;
|
|
/**
|
* 默认使用的登录账号
|
*/
|
public static final String USERNAME = "admin";
|
|
/**
|
* 默认使用的登录密码
|
*/
|
public static final String PASSWORD = "odm@2024";
|
|
/**
|
* 执行中的任务数量限制
|
*/
|
public static final Integer MAX_PROCESS_TASK_NUM = 1;
|
|
/**
|
* 拼图任务最少图片数量限制
|
*/
|
public static final Integer MIN_PIC_NUM = 2;
|
|
/**
|
* 拼图任务处理节点数量
|
*/
|
public static final Integer PROCESS_NODE_NUM = 1;
|
|
/**
|
* 拼图任务图片缩放比例-不缩放
|
*/
|
public static final Integer NO_RESIZE_VALUE = -1;
|
|
/**
|
* 拼图任务图片缩放比例
|
*/
|
public static final Integer RESIZE_VALUE = 2048;
|
|
/**
|
* 拼图任务处理帧间隔
|
*/
|
public static final Integer FRAME_INTERVAL = 30;
|
|
/**
|
* odm 登录获取token url
|
*/
|
public static final String AUTH_TOKEN_API = "/api/token-auth/";
|
|
/**
|
* odm 创建任务 url
|
*/
|
public static final String CREATE_TASK_API = "/api/projects/{0}/tasks/";
|
|
/**
|
* odm 任务查询 url
|
*/
|
public static final String QUERY_TASK_API = "/api/projects/{0}/tasks/?ordering=-created_at";
|
|
/**
|
* odm 上传当前任务的图片
|
*/
|
public static final String UPLOAD_PIC_BY_TASK_API = "/api/projects/{0}/tasks/{1}/upload/";
|
|
/**
|
* odm 任务提交
|
*/
|
public static final String COMMIT_TASK_API = "/api/projects/{0}/tasks/{1}/commit/";
|
|
/**
|
* odm 正射影像图片导出 api
|
*/
|
public static final String ORTHOPHOTO_EXPORT_API = "/api/projects/{0}/tasks/{1}/orthophoto/export";
|
|
|
/**
|
* 获取 odm 任务信息 api
|
*/
|
public static final String GET_TASK_INFO_API = "/api/projects/{0}/tasks/{1}/";
|
|
/**
|
* 重置 odm 任务信息 api
|
*/
|
public static final String PATCH_TASK_INFO_API = "/api/projects/{0}/tasks/{1}/";
|
|
/**
|
* 删除 odm 任务信息 api -POST
|
*/
|
public static final String REMOVE_TASK_INFO_API = "/api/projects/{0}/tasks/{1}/remove/";
|
|
/**
|
* 获取 odm 正射影像数据信息 api
|
*/
|
public static final String GET_RTHOPHOTO_METADATA_API = "/api/projects/{0}/tasks/{1}/orthophoto/metadata";
|
|
/**
|
* 重启任务 api
|
*/
|
public static final String RESTART_TASK_API = "/api/projects/{0}/tasks/{1}/restart/";
|
|
/**
|
* 获取正射影像图片地址
|
*/
|
public static final String GET_PHONE_URL = "/workers/get/{0}";
|
|
/**
|
* webodm 数据集映射基础前缀路径
|
*/
|
public static String WEB_ODM_VOLUMES_PRE_PATH = "/webodm_appmedia/_data";
|
|
/**
|
* 正射影像路径
|
*/
|
public static String ORTHO_IMAGE_PATH = WEB_ODM_VOLUMES_PRE_PATH + "/project/{0}/task/{1}/assets/odm_orthophoto/odm_orthophoto.tif";
|
|
/**
|
* 正射影像图斑范围画面输出路径
|
*/
|
public static String ORTHO_TB_IMAGE_PATH = WEB_ODM_VOLUMES_PRE_PATH + "/project/{0}/task/{1}/assets/odm_orthophoto";
|
|
/**
|
* task 文件存放路径
|
*/
|
// public static String TASK_FILE_PATH = WEB_ODM_VOLUMES_BASE_PATH + WEB_ODM_VOLUMES_PRE_PATH + "/project/{0}/task";
|
public static String TASK_FILE_PATH = WEB_ODM_VOLUMES_PRE_PATH + "/project/{0}/task";
|
// public static String TASK_FILE_PATH = "E:\\work\\temp\\3";
|
|
/**
|
* 正射影像 api
|
*/
|
public static String ORTHO_IMAGE_API = "/projects/{0}/tasks/{1}/orthophoto/tiles/";
|
|
/**
|
* 正射影像 api 后缀
|
*/
|
public static String ORTHO_IMAGE_API_SUX = "{z}/{x}/{y}.png";
|
|
/**
|
* 3D-TILES 路径
|
*/
|
public static String TILES_3D_PATH = WEB_ODM_VOLUMES_PRE_PATH + "/project/{0}/task/{1}/assets/3d_tiles/model/tileset.json";
|
|
/**
|
* 模型信息文件路径
|
*/
|
public static String MODEL_INFO_FILE_PATH = WEB_ODM_VOLUMES_PRE_PATH + "/project/{0}/task/{1}/assets/odm_georeferencing/odm_georeferenced_model.info.json";
|
|
/**
|
* DEM TIF 文件路径
|
*/
|
public static String DEM_TIF_PATH = WEB_ODM_VOLUMES_PRE_PATH + "/project/{0}/task/{1}/assets/odm_dem/dsm.tif";
|
|
/**
|
* obj 文件路径
|
*/
|
public static String OBJ_PATH = WEB_ODM_VOLUMES_PRE_PATH + "/project/{0}/task/{1}/assets/odm_texturing/odm_textured_model_geo.obj";
|
|
/**
|
* pointcloud laz 文件路径
|
*/
|
public static String POINT_CLOUD_PATH = WEB_ODM_VOLUMES_PRE_PATH + "/project/{0}/task/{1}/assets/odm_georeferencing/odm_georeferenced_model.laz";
|
|
/**
|
* 中心点 文件路径
|
*/
|
public static String CENTER_FILE_PATH = WEB_ODM_VOLUMES_PRE_PATH + "/project/{0}/task/{1}/assets/odm_georeferencing/odm_georeferencing_model_geo.txt";
|
|
/**
|
* 正射任务类型
|
*/
|
public static final List<Integer> OTR_TASK_TYPES = createOrthoTasks();
|
|
/**
|
* 倾斜任务类型
|
*/
|
public static final List<Integer> TILT_TASK_TYPES = createTiltTasks();
|
|
/**
|
* 白膜任务类型
|
*/
|
public static final List<Integer> ALB_TASK_TYPES = createAlbTasks();
|
|
/**
|
* odm 配置处理类型
|
*/
|
public static final List<Integer> ODM_TASK_OPTION_TYPE = createOdmTaskTypes();
|
|
private static List<Integer> createOrthoTasks() {
|
return Arrays.asList(
|
WaylineTypeEnum.PLANAR_COL_HIS.getType(),
|
WaylineTypeEnum.PLANAR_COL.getType(),
|
WaylineTypeEnum.DISC_WAY.getType()
|
);
|
}
|
|
private static List<Integer> createTiltTasks() {
|
return Arrays.asList(
|
WaylineTypeEnum.TILT_COL.getType(),
|
WaylineTypeEnum.TILT_COL_SMART.getType(),
|
WaylineTypeEnum.TILT_WAY.getType(),
|
WaylineTypeEnum.GEO_WAY.getType()
|
);
|
}
|
|
private static List<Integer> createAlbTasks() {
|
return Arrays.asList(
|
WaylineTypeEnum.ALB_COL.getType()
|
);
|
}
|
|
private static List<Integer> createOdmTaskTypes() {
|
List<Integer> result = new ArrayList<>();
|
result.addAll(OTR_TASK_TYPES);
|
result.addAll(TILT_TASK_TYPES);
|
result.addAll(ALB_TASK_TYPES);
|
return result;
|
}
|
|
|
/**
|
* odm 选项配置 2: 正射举证 4:图斑正射举证 5: 实景倾斜三维航线 6:视频飞白膜
|
*/
|
public static Map<Integer, List<Map<String,Object>>> ODM_TASK_OPTION = new HashMap<>() {
|
{
|
put(WaylineTypeEnum.PLANAR_COL_HIS.getType().intValue(),getOrthophotoOptions(false));
|
put(WaylineTypeEnum.PLANAR_COL.getType().intValue(),getOrthophotoOptions(false));
|
put(WaylineTypeEnum.DISC_WAY.getType().intValue(),getOrthophotoOptions(false));
|
put(WaylineTypeEnum.TILT_COL.getType().intValue(),get3DOptions(false,"10"));
|
put(WaylineTypeEnum.TILT_COL_SMART.getType().intValue(),get3DOptions(false,"10"));
|
put(WaylineTypeEnum.TILT_WAY.getType().intValue(),get3DOptions(false, null));
|
put(WaylineTypeEnum.GEO_WAY.getType().intValue(),get3DOptions(false,"1"));
|
put(WaylineTypeEnum.ALB_COL.getType().intValue(),getAlbOptions(false,"10"));
|
}
|
};
|
|
|
/**
|
* odm 重置配置
|
*/
|
public static Map<Integer, List<Map<String,Object>>> ODM_TASK_RESET_OPTIONS = new HashMap<>() {
|
{
|
put(WaylineTypeEnum.PLANAR_COL_HIS.getType().intValue(),getOrthophotoOptions(true));
|
put(WaylineTypeEnum.PLANAR_COL.getType().intValue(),getOrthophotoOptions(true));
|
put(WaylineTypeEnum.DISC_WAY.getType().intValue(),getOrthophotoOptions(true));
|
put(WaylineTypeEnum.TILT_COL.getType().intValue(),get3DOptions(true,"10"));
|
put(WaylineTypeEnum.TILT_COL_SMART.getType().intValue(),get3DOptions(true,"10"));
|
put(WaylineTypeEnum.TILT_WAY.getType().intValue(),get3DOptions(true,null));
|
put(WaylineTypeEnum.GEO_WAY.getType().intValue(),get3DOptions(true,"1"));
|
put(WaylineTypeEnum.ALB_COL.getType().intValue(),getAlbOptions(true,"10"));
|
}
|
};
|
|
/**
|
* 正射举证类型的配置
|
* @param includeRerunFrom 是否包含 rerun-from
|
* @return
|
*/
|
private static List<Map<String, Object>> getOrthophotoOptions(boolean includeRerunFrom) {
|
return new ArrayList<>() {{
|
add(new HashMap<>() {{
|
put("name", "dsm");
|
put("value", true);
|
}});
|
add(new HashMap<>() {{
|
put("name", "dtm");
|
put("value", true);
|
}});
|
add(new HashMap<>() {{
|
put("name", "skip-3dmodel");
|
put("value", true);
|
}});
|
add(new HashMap<>() {{
|
put("name", "orthophoto-cutline");
|
put("value", true);
|
}});
|
add(new HashMap<>() {{
|
put("name", "skip-report");
|
put("value", true);
|
}});
|
add(new HashMap<>() {{
|
put("name", "optimize-disk-space");
|
put("value", true);
|
}});
|
if (includeRerunFrom) {
|
add(new HashMap<>() {{
|
put("name", "rerun-from");
|
put("value", "dataset");
|
}});
|
}
|
}};
|
}
|
|
/**
|
* 实景倾斜三维航线类型的配置
|
* @param includeRerunFrom 是否包含 rerun-from
|
* @param authBoundaryDistance 自动边界 距离(图片所在位置点组成的面缓冲距离)
|
* @return
|
*/
|
private static List<Map<String, Object>> get3DOptions(boolean includeRerunFrom,String authBoundaryDistance) {
|
return new ArrayList<>() {{
|
add(new HashMap<>() {{
|
put("name", "dsm");
|
put("value", true);
|
}});
|
add(new HashMap<>() {{
|
put("name", "dtm");
|
put("value", true);
|
}});
|
if (null != authBoundaryDistance) {
|
add(new HashMap<>() {{
|
put("name", "auto-boundary");
|
put("value", true);
|
}});
|
add(new HashMap<>() {{
|
put("name", "auto-boundary-distance");
|
put("value", authBoundaryDistance);
|
}});
|
}
|
add(new HashMap<>() {{
|
put("name", "skip-orthophoto");
|
put("value", true);
|
}});
|
add(new HashMap<>() {{
|
put("name", "skip-report");
|
put("value", true);
|
}});
|
add(new HashMap<>() {{
|
put("name", "optimize-disk-space");
|
put("value", true);
|
}});
|
// 如果需要3D相关选项,可以取消注释或添加
|
// add(new HashMap<>(){{
|
// put("name","3d-tiles");
|
// put("value",true);
|
// }});
|
if (includeRerunFrom) {
|
add(new HashMap<>() {{
|
put("name", "rerun-from");
|
put("value", "dataset");
|
}});
|
}
|
}};
|
}
|
|
|
/**
|
* 视频飞白膜类型的配置
|
* @param includeRerunFrom 是否包含 rerun-from
|
* @param authBoundaryDistance 自动边界 距离(图片所在位置点组成的面缓冲距离)
|
* @return
|
*/
|
private static List<Map<String, Object>> getAlbOptions(boolean includeRerunFrom,String authBoundaryDistance) {
|
return new ArrayList<>() {{
|
add(new HashMap<>() {{
|
put("name", "dsm");
|
put("value", true);
|
}});
|
add(new HashMap<>() {{
|
put("name", "dtm");
|
put("value", true);
|
}});
|
add(new HashMap<>() {{
|
put("name", "skip-orthophoto");
|
put("value", true);
|
}});
|
add(new HashMap<>() {{
|
put("name", "skip-report");
|
put("value", true);
|
}});
|
add(new HashMap<>() {{
|
put("name", "auto-boundary");
|
put("value", true);
|
}});
|
add(new HashMap<>() {{
|
put("name", "auto-boundary-distance");
|
put("value", authBoundaryDistance);
|
}});
|
add(new HashMap<>() {{
|
put("name", "optimize-disk-space");
|
put("value", true);
|
}});
|
// 根据参数决定是否添加rerun-from选项
|
if (includeRerunFrom) {
|
add(new HashMap<>() {{
|
put("name", "rerun-from");
|
put("value", "dataset");
|
}});
|
}
|
}};
|
}
|
|
|
}
|