Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
eshiled-new
/
ne-shield-devicemonitor
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit a1bbcc64
authored
Mar 30, 2022
by
杨林龙
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
优化基站经纬度格式
1 parent
2d0b53b2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
5 deletions
src/main/java/cn/com/glsx/devicemonitor/modules/components/HdaoGpsComponent.java
src/main/java/cn/com/glsx/devicemonitor/modules/utils/LocationUtil.java
src/main/java/cn/com/glsx/devicemonitor/modules/components/HdaoGpsComponent.java
View file @
a1bbcc6
...
@@ -447,12 +447,18 @@ public class HdaoGpsComponent {
...
@@ -447,12 +447,18 @@ public class HdaoGpsComponent {
dataGpsLocation
.
setLat
(
lat
);
dataGpsLocation
.
setLat
(
lat
);
double
[]
googleGps
=
GpsCorrect
.
gpsToGoogle
(
Double
.
parseDouble
(
lat
),
Double
.
parseDouble
(
lng
));
double
[]
googleGps
=
GpsCorrect
.
gpsToGoogle
(
Double
.
parseDouble
(
lat
),
Double
.
parseDouble
(
lng
));
dataGpsLocation
.
setElat
(
String
.
valueOf
(
googleGps
[
0
]));
dataGpsLocation
.
setElng
(
String
.
valueOf
(
googleGps
[
1
]));
String
elng
=
LocationUtil
.
latlng
(
googleGps
[
1
]);
String
elat
=
LocationUtil
.
latlng
(
googleGps
[
0
]);
dataGpsLocation
.
setElat
(
elat
);
dataGpsLocation
.
setElng
(
elng
);
double
[]
baiduGps
=
GpsCorrect
.
gpsToBaidu
(
Double
.
parseDouble
(
lat
),
Double
.
parseDouble
(
lng
));
double
[]
baiduGps
=
GpsCorrect
.
gpsToBaidu
(
Double
.
parseDouble
(
lat
),
Double
.
parseDouble
(
lng
));
dataGpsLocation
.
setBlat
(
String
.
valueOf
(
baiduGps
[
0
]));
dataGpsLocation
.
setBlng
(
String
.
valueOf
(
baiduGps
[
1
]));
String
blng
=
LocationUtil
.
latlng
(
baiduGps
[
1
]);
String
blat
=
LocationUtil
.
latlng
(
baiduGps
[
0
]);
dataGpsLocation
.
setBlat
(
blat
);
dataGpsLocation
.
setBlng
(
blng
);
dataGpsLocation
.
setAddress
(
resp
.
value
.
gps
.
addr
);
dataGpsLocation
.
setAddress
(
resp
.
value
.
gps
.
addr
);
dataGpsLocation
.
setDateTime
(
dataBsLocation
.
getGpsTime
());
dataGpsLocation
.
setDateTime
(
dataBsLocation
.
getGpsTime
());
...
...
src/main/java/cn/com/glsx/devicemonitor/modules/utils/LocationUtil.java
View file @
a1bbcc6
...
@@ -15,7 +15,7 @@ public class LocationUtil {
...
@@ -15,7 +15,7 @@ public class LocationUtil {
/**
/**
* 转化数据部门的位置点
* 转化数据部门的位置点
*
*
/
*/
public
static
String
latlng
(
int
value
)
{
public
static
String
latlng
(
int
value
)
{
DecimalFormat
df
=
new
DecimalFormat
(
"#.000000"
);
DecimalFormat
df
=
new
DecimalFormat
(
"#.000000"
);
String
ret
=
df
.
format
((
double
)
value
/
1000000
D
);
String
ret
=
df
.
format
((
double
)
value
/
1000000
D
);
...
@@ -23,6 +23,14 @@ public class LocationUtil {
...
@@ -23,6 +23,14 @@ public class LocationUtil {
}
}
/**
/**
* 转化数据部门的位置点 格式化
*/
public
static
String
latlng
(
Double
value
)
{
DecimalFormat
df
=
new
DecimalFormat
(
"#.000000"
);
return
df
.
format
(
value
);
}
/**
* 计算两点之间的实际距离
* 计算两点之间的实际距离
*
*
* @param long1 第一个点的经度
* @param long1 第一个点的经度
...
@@ -53,6 +61,7 @@ public class LocationUtil {
...
@@ -53,6 +61,7 @@ public class LocationUtil {
/**
/**
* int值转换
* int值转换
*
* @param strValue
* @param strValue
* @return
* @return
*/
*/
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment