Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
张雷
/
skreceive
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
构建
提交
问题看板
文件
提交
网络
比较
分支
标签
03ee6fa8
由
张雷
编写于
2022-11-30 23:16:04 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
人员定位接口修改
1 个父辈
34445ef6
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
75 行增加
和
49 行删除
src/main/java/com/jkdata/service/impl/IThirdServiceImpl.java
src/main/java/com/jkdata/tool/CommonConstant.java
src/main/java/com/jkdata/tool/CoordinateUtil.java
src/main/java/com/jkdata/service/impl/IThirdServiceImpl.java
查看文件 @
03ee6fa
...
...
@@ -71,20 +71,30 @@ public class IThirdServiceImpl implements IThirdService {
}
public
static
void
main
(
String
[]
args
)
{
String
x1
=
"463.7121276855469"
;
String
y1
=
"142.59878540039062"
;
double
fd_x
=
CommonConstant
.
BLC1
*(
Double
.
valueOf
(
x1
)-
CommonConstant
.
LT_B1_X
)+
CommonConstant
.
LT_B1_X
;
double
fd_y
=
CommonConstant
.
BLC1
*(
Double
.
valueOf
(
y1
)+
CommonConstant
.
LT_B1_Y
)-
CommonConstant
.
LT_B1_Y
;
System
.
out
.
println
(
"放大后的坐标为:X:"
+
fd_x
+
",Y:"
+
fd_y
);
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
);
String
x1
=
"22.99456"
;
String
y1
=
"330.3669"
;
Map
<
String
,
Double
>
map
=
new
HashMap
<>();
//初始化
map
=
CoordinateUtil
.
changCoordinate
(
"B2"
,
x1
,
y1
);
System
.
out
.
println
(
"新坐标为:X:"
+
map
.
get
(
"x"
)+
",Y:"
+
map
.
get
(
"y"
));
// double sin = Math.sin(CommonConstant.XZJD);
// double cos = Math.cos(CommonConstant.XZJD);
// System.out.println("sin:"+sin+",cos:"+cos);
// //平移到原点
// double x0 = Double.valueOf(x1) - CommonConstant.LT_B1_X;
// double y0 = Double.valueOf(y1) - CommonConstant.LT_B1_Y;
// System.out.println("平移后的坐标:x0:"+x0+",y0:"+y0);
// //旋转坐标
// double x = x0*sin + y0*cos;
// double y = y0*sin - x0*cos;
// System.out.println("旋转后坐标为:X:"+x+",Y:"+y);
// //平移后的坐标
// double py_x = x + CommonConstant.MQ_B1_X/CommonConstant.BLC_X;
// double py_y = y + CommonConstant.MQ_B1_Y/CommonConstant.BLC_Y;
// System.out.println("平移后的坐标为:X:"+py_x+",Y:"+py_y);
// //放大后的坐标
// double fd_x = CommonConstant.BLC_X*py_x;
// double fd_y = CommonConstant.BLC_Y*py_y;
// System.out.println("放大后的坐标为:X:"+fd_x+",Y:"+fd_y);
}
//B1定位坐标
...
...
src/main/java/com/jkdata/tool/CommonConstant.java
查看文件 @
03ee6fa
...
...
@@ -6,21 +6,23 @@ public interface CommonConstant {
Integer
SC_ERROR_500
=
500
;
//错误代码
Integer
SC_OK_200
=
200
;
//成功代码
//**********************联通
中心
坐标***************************
Double
LT_B1_X
=
379.2256164550781
;
//联通B1层X坐标
Double
LT_B1_Y
=
3
68.61126708984375
;
//联通B1层Y坐标
Double
LT_B2_X
=
397.35992431640625
;
//联通B2层X坐标
Double
LT_B2_Y
=
3
84.9845886230469
;
//联通B2层Y坐标
//**********************鸣启
中心
坐标***************************
Double
MQ_B1_X
=
-
178.527924
;
//鸣启B1层X坐标
Double
MQ_B1_Y
=
-
1226.708374
;
//鸣启B1层Y坐标
Double
MQ_B2_X
=
-
178.527924
;
//鸣启B2层X坐标
Double
MQ_B2_Y
=
-
1226.708374
;
//鸣启B2层Y坐标
//**********************联通坐标***************************
Double
LT_B1_X
=
42.8238
;
//联通B1层X坐标
Double
LT_B1_Y
=
3
25.8339
;
//联通B1层Y坐标
Double
LT_B2_X
=
22.4297
;
//联通B2层X坐标
Double
LT_B2_Y
=
3
30.5528
;
//联通B2层Y坐标
//**********************鸣启坐标***************************
Double
MQ_B1_X
=
-
9850.00
;
//鸣启B1层X坐标
Double
MQ_B1_Y
=
-
7400.00
;
//鸣启B1层Y坐标
Double
MQ_B2_X
=
-
9850.00
;
//鸣启B2层X坐标
Double
MQ_B2_Y
=
-
7430.00
;
//鸣启B2层Y坐标
//**********************比例尺***************************
Double
BLC1
=
100
/
2.54
;
//比例尺
Double
BLC2
=
100
/
2.54
;
//比例尺
Double
BLC_X
=
43.7
;
//比例尺
Double
BLC_Y
=
43.58
;
//比例尺
//**********************旋转角度***************************
Double
XZJD
=
64.7989
;
//旋转角度
//**********************推送用户***************************
String
CMCC
=
"CMCC"
;
//联通推送用户
...
...
src/main/java/com/jkdata/tool/CoordinateUtil.java
查看文件 @
03ee6fa
...
...
@@ -9,33 +9,47 @@ public class CoordinateUtil {
Map
<
String
,
Double
>
map
=
new
HashMap
<>();
//初始化
map
.
put
(
"x"
,
0.00
);
map
.
put
(
"y"
,
0.00
);
double
fd_x
=
0.00
;
//放大的X坐标
double
fd_y
=
0.00
;
//放大的Y坐标
double
a
=
0.00
;
//X偏移量
double
b
=
0.00
;
//Y偏移量
double
py_x
=
0.00
;
double
py_y
=
0.00
;
double
sin
=
Math
.
sin
(
CommonConstant
.
XZJD
);
double
cos
=
Math
.
cos
(
CommonConstant
.
XZJD
);
System
.
out
.
println
(
"sin:"
+
sin
+
",cos:"
+
cos
);
if
(
"B2"
.
equals
(
floor
)){
fd_x
=
CommonConstant
.
BLC2
*(
Double
.
valueOf
(
x1
)-
CommonConstant
.
LT_B2_X
)+
CommonConstant
.
LT_B2_X
;
fd_y
=
CommonConstant
.
BLC2
*(
Double
.
valueOf
(
y1
)+
CommonConstant
.
LT_B2_Y
)-
CommonConstant
.
LT_B2_Y
;
a
=
CommonConstant
.
MQ_B2_X
-
CommonConstant
.
LT_B2_X
;
//原点偏移x
b
=
CommonConstant
.
MQ_B2_Y
-
CommonConstant
.
LT_B2_Y
;
//原点偏移y
//平移到原点
double
x0
=
Double
.
valueOf
(
x1
)
-
CommonConstant
.
LT_B2_X
;
double
y0
=
Double
.
valueOf
(
y1
)
-
CommonConstant
.
LT_B2_Y
;
System
.
out
.
println
(
"平移后的坐标:x0:"
+
x0
+
",y0:"
+
y0
);
//旋转坐标
double
x
=
x0
*
sin
+
y0
*
cos
;
double
y
=
y0
*
sin
-
x0
*
cos
;
System
.
out
.
println
(
"旋转后坐标为:X:"
+
x
+
",Y:"
+
y
);
//平移后的坐标
py_x
=
x
+
CommonConstant
.
MQ_B2_X
/
CommonConstant
.
BLC_X
;
py_y
=
y
+
CommonConstant
.
MQ_B2_Y
/
CommonConstant
.
BLC_Y
;
System
.
out
.
println
(
"平移后的坐标为:X:"
+
py_x
+
",Y:"
+
py_y
);
}
else
if
(
"B1"
.
equals
(
floor
)){
fd_x
=
CommonConstant
.
BLC1
*(
Double
.
valueOf
(
x1
)-
CommonConstant
.
LT_B1_X
)+
CommonConstant
.
LT_B1_X
;
fd_y
=
CommonConstant
.
BLC1
*(
Double
.
valueOf
(
y1
)+
CommonConstant
.
LT_B1_Y
)-
CommonConstant
.
LT_B1_Y
;
a
=
CommonConstant
.
MQ_B1_X
-
CommonConstant
.
LT_B1_X
;
//原点偏移x
b
=
CommonConstant
.
MQ_B1_Y
-
CommonConstant
.
LT_B1_Y
;
//原点偏移y
//平移到原点
double
x0
=
Double
.
valueOf
(
x1
)
-
CommonConstant
.
LT_B1_X
;
double
y0
=
Double
.
valueOf
(
y1
)
-
CommonConstant
.
LT_B1_Y
;
System
.
out
.
println
(
"平移后的坐标:x0:"
+
x0
+
",y0:"
+
y0
);
//旋转坐标
double
x
=
x0
*
sin
+
y0
*
cos
;
double
y
=
y0
*
sin
-
x0
*
cos
;
System
.
out
.
println
(
"旋转后坐标为:X:"
+
x
+
",Y:"
+
y
);
//平移后的坐标
py_x
=
x
+
CommonConstant
.
MQ_B1_X
/
CommonConstant
.
BLC_X
;
py_y
=
y
+
CommonConstant
.
MQ_B1_Y
/
CommonConstant
.
BLC_Y
;
System
.
out
.
println
(
"平移后的坐标为:X:"
+
py_x
+
",Y:"
+
py_y
);
}
else
{
fd_x
=
0.00
;
fd_y
=
0.00
;
a
=
0.00
;
b
=
0.00
;
py_x
=
0.00
;
py_y
=
0.00
;
}
//放大后的坐标
double
fd_x
=
CommonConstant
.
BLC_X
*
py_x
;
double
fd_y
=
CommonConstant
.
BLC_Y
*
py_y
;
System
.
out
.
println
(
"放大后的坐标为:X:"
+
fd_x
+
",Y:"
+
fd_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
);
map
.
put
(
"x"
,
x
);
map
.
put
(
"y"
,
y
);
map
.
put
(
"x"
,
fd_x
);
map
.
put
(
"y"
,
fd_y
);
return
map
;
}
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论