f0fee236 张雷

定位坐标转换

1 个父辈 70f83082
package com.it.entity;
public interface CommonConstant {
Integer SC_INTERNAL_SERVER_ERROR_500 = 500;
Integer SC_ERROR_500 = 500;
Integer SC_OK_200 = 200;
//**********************联通中心坐标***************************
......
......@@ -24,7 +24,7 @@ public class Result<T> implements Serializable {
public Result<T> error500(String message) {
this.message = message;
this.code = CommonConstant.SC_INTERNAL_SERVER_ERROR_500;
this.code = CommonConstant.SC_ERROR_500;
this.success = false;
return this;
}
......@@ -61,7 +61,7 @@ public class Result<T> implements Serializable {
}
public static Result<Object> error(String msg) {
return error(CommonConstant.SC_INTERNAL_SERVER_ERROR_500, msg);
return error(CommonConstant.SC_ERROR_500, msg);
}
public static Result<Object> error(int code, String msg) {
......
......@@ -49,12 +49,12 @@ public class IThirdServiceImpl implements IThirdService {
}
public static void main(String[] args) {
changCoordinate("600.2330322265625","-300.28587341308594");
changCoordinate("101.1636962890625","325.2133483886719");
}
private static void changCoordinate(String x1, String y1) {
double blc = 2.54;//联通比例尺
double blc = 100/2.54;//比例尺
double fd_x = blc*(Double.valueOf(x1)-CommonConstant.LT_B1_X)+CommonConstant.LT_B1_X;
double fd_y = blc*(Double.valueOf(y1)+CommonConstant.LT_B1_Y)-CommonConstant.LT_B1_Y;
......@@ -62,9 +62,15 @@ public class IThirdServiceImpl implements IThirdService {
double a = CommonConstant.MQ_B1_X - CommonConstant.LT_B1_X;//原点偏移x
double b = CommonConstant.MQ_B1_Y - CommonConstant.LT_B1_Y;//原点偏移y
System.out.println("偏移a:"+a+",b:"+b);
double x = Double.valueOf(fd_x) + a;
double y = Double.valueOf(fd_y) + b;
System.out.println("新坐标为:X:"+x+",Y:"+y);
System.out.println("新坐标为:X:"+x+",Y:-"+y);
//原点偏移
// double new_fd_x = 10*(Double.valueOf(x)-CommonConstant.MQ_B1_X)+CommonConstant.MQ_B1_X;
// double new_fd_y = 10*(Double.valueOf(y)+CommonConstant.MQ_B1_Y)-CommonConstant.MQ_B1_Y;
// System.out.println("新放大后的坐标为:X:"+new_fd_x+",Y:"+new_fd_y);
}
}
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!