Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
clx-performance
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
姜武杰
clx-performance
Commits
767a405f
提交
767a405f
authored
9月 26, 2023
作者:
liuhaiquan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
删除system 打印的数字
上级
e4f0b1ec
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
0 行增加
和
9 行删除
+0
-9
RedisGeoUntil.java
...rc/main/java/com/clx/performance/utils/RedisGeoUntil.java
+0
-9
没有找到文件。
performance-web/src/main/java/com/clx/performance/utils/RedisGeoUntil.java
浏览文件 @
767a405f
...
...
@@ -28,7 +28,6 @@ public class RedisGeoUntil {
//Point的属性值,x轴是经度longitude,y轴是纬度latitude。
Point
point
=
new
Point
(
longitudeX
,
latitudeY
);
Long
addedNum
=
redisTemplate
.
opsForGeo
().
add
(
redisKey
,
point
,
code
);
System
.
out
.
println
(
addedNum
);
}
...
...
@@ -52,7 +51,6 @@ public class RedisGeoUntil {
//删除
//redisTemplate.opsForZSet().remove(redisKey,"hangzhou5");
Long
remove
=
redisTemplate
.
boundZSetOps
(
redisKey
).
remove
(
code
);
System
.
out
.
println
(
remove
);
}
...
...
@@ -63,7 +61,6 @@ public class RedisGeoUntil {
//修改(先删除再新增)
deleteRedisGeo
(
redisKey
,
code
);
insertRedisGeo
(
redisKey
,
longitudeX
,
latitudeY
,
code
);
System
.
out
.
println
();
}
...
...
@@ -78,7 +75,6 @@ public class RedisGeoUntil {
pointList
.
add
(
redisGeo
);
}
}
System
.
out
.
println
(
pointList
);
return
pointList
;
}
...
...
@@ -89,7 +85,6 @@ public class RedisGeoUntil {
public
Point
getRedisGeo
(
String
redisKey
,
String
code
)
{
//查询可以查询多个 经纬度
List
<
Point
>
pointsAll
=
redisTemplate
.
opsForGeo
().
position
(
redisKey
,
code
);
System
.
out
.
println
(
pointsAll
);
if
(!
CollectionUtils
.
isEmpty
(
pointsAll
)){
return
pointsAll
.
get
(
0
);
}
...
...
@@ -104,7 +99,6 @@ public class RedisGeoUntil {
Distance
disFiveKmFive
=
new
Distance
(
Integer
.
MAX_VALUE
,
Metrics
.
KILOMETERS
);
RedisGeoCommands
.
GeoRadiusCommandArgs
argsFiveKmFive
=
RedisGeoCommands
.
GeoRadiusCommandArgs
.
newGeoRadiusArgs
().
includeDistance
().
includeCoordinates
().
sortAscending
().
limit
(
5
);
GeoResults
<
RedisGeoCommands
.
GeoLocation
<
String
>>
resultsFiveKmFive
=
redisTemplate
.
opsForGeo
().
radius
(
redisKey
,
code
,
disFiveKmFive
,
argsFiveKmFive
);
System
.
out
.
println
(
resultsFiveKmFive
);
return
resultsFiveKmFive
;
}
...
...
@@ -119,7 +113,6 @@ public class RedisGeoUntil {
Circle
circleCenter
=
new
Circle
(
pointCenter
,
distanceCenter
);
RedisGeoCommands
.
GeoRadiusCommandArgs
argsCircle
=
RedisGeoCommands
.
GeoRadiusCommandArgs
.
newGeoRadiusArgs
().
includeDistance
().
includeCoordinates
().
sortAscending
().
limit
(
limit
);
GeoResults
<
RedisGeoCommands
.
GeoLocation
<
String
>>
resultsDis
=
redisTemplate
.
opsForGeo
().
radius
(
redisKey
,
circleCenter
,
argsCircle
);
System
.
out
.
println
(
resultsDis
);
return
resultsDis
;
}
...
...
@@ -129,7 +122,6 @@ public class RedisGeoUntil {
*/
public
List
<
String
>
getRedisGeoListHash
(
String
redisKey
,
String
code
)
{
List
<
String
>
resultsHash
=
redisTemplate
.
opsForGeo
().
hash
(
redisKey
,
code
);
System
.
out
.
println
(
resultsHash
);
return
resultsHash
;
}
...
...
@@ -138,7 +130,6 @@ public class RedisGeoUntil {
*/
public
Distance
getRedisGeoListTwoSpace
(
String
redisKey
,
String
codeOne
,
String
codeTwo
)
{
Distance
disTwoPlace
=
redisTemplate
.
opsForGeo
().
distance
(
redisKey
,
codeOne
,
codeTwo
,
RedisGeoCommands
.
DistanceUnit
.
KILOMETERS
);
System
.
out
.
println
(
disTwoPlace
);
return
disTwoPlace
;
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论