Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
L
ldmap-download
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
王健
ldmap-download
Commits
f5c0f289
提交
f5c0f289
authored
4月 03, 2020
作者:
张航
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
添加了可以继续下载
上级
ec7edba1
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
38 行增加
和
5 行删除
+38
-5
DownMap.java
...java/com/comleader/ldmapdownload/application/DownMap.java
+11
-5
CLStringUtil.java
...n/java/com/comleader/ldmapdownload/util/CLStringUtil.java
+23
-0
download-map.properties
src/main/resources/config/download-map.properties
+4
-0
没有找到文件。
src/main/java/com/comleader/ldmapdownload/application/DownMap.java
浏览文件 @
f5c0f289
...
@@ -46,11 +46,14 @@ public class DownMap implements ApplicationRunner {
...
@@ -46,11 +46,14 @@ public class DownMap implements ApplicationRunner {
private
int
maxLv
;
// 最大层级
private
int
maxLv
;
// 最大层级
@Value
(
"${map.Lv6.flag}"
)
@Value
(
"${map.Lv6.flag}"
)
private
boolean
flag
;
// 记录前六级是否打开下载
private
boolean
lvFlag
;
// 记录前六级是否打开下载
@Value
(
"${map.download.append}"
)
private
boolean
appendFlag
;
// 是否是继续下载
@Override
@Override
public
void
run
(
ApplicationArguments
args
)
throws
Exception
{
public
void
run
(
ApplicationArguments
args
)
throws
Exception
{
if
(
f
lag
){
if
(
lvF
lag
){
return
;
return
;
}
}
...
@@ -163,11 +166,14 @@ public class DownMap implements ApplicationRunner {
...
@@ -163,11 +166,14 @@ public class DownMap implements ApplicationRunner {
try
{
try
{
//高德地图(6:影像,7:矢量,8:影像路网)
//高德地图(6:影像,7:矢量,8:影像路网)
imgUrl
=
CLStringUtil
.
getImgUrl
(
z
,
x
,
y
);
imgUrl
=
CLStringUtil
.
getImgUrl
(
z
,
x
,
y
);
File
file
=
CLStringUtil
.
getFullFile
(
z
,
x
,
y
);
File
file
=
appendFlag
?
CLStringUtil
.
getFullFileNotExist
(
z
,
x
,
y
):
CLStringUtil
.
getFullFile
(
z
,
x
,
y
);
// 开始下载地图
// 开始下载地图
HttpUtil
.
downImageByGet
(
imgUrl
,
file
);
if
(
file
!=
null
){
return
imgUrl
+
" Success"
;
HttpUtil
.
downImageByGet
(
imgUrl
,
file
);
return
imgUrl
+
" Success"
;
}
return
imgUrl
+
" Loaded"
;
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
//log.error(imgUrl + " Down Failed");
//log.error(imgUrl + " Down Failed");
errResults
.
add
(
"Failed: "
+
imgUrl
+
" ErrorMsg >> "
+
e
.
getMessage
());
errResults
.
add
(
"Failed: "
+
imgUrl
+
" ErrorMsg >> "
+
e
.
getMessage
());
...
...
src/main/java/com/comleader/ldmapdownload/util/CLStringUtil.java
浏览文件 @
f5c0f289
...
@@ -64,6 +64,29 @@ public class CLStringUtil {
...
@@ -64,6 +64,29 @@ public class CLStringUtil {
return
FileUtil
.
file
(
fullFileName
);
return
FileUtil
.
file
(
fullFileName
);
}
}
/**
* @param z
* @param x
* @param y
* @description: 根据传入的 z\x\y来创建本地图片路径
* @return: java.lang.String
* @author: zhanghang
* @date: 2020/4/2
**/
public
static
File
getFullFileNotExist
(
Integer
z
,
Integer
x
,
Integer
y
)
{
String
fullFileName
;
if
(
MAP_TYPE
==
"ArcGIS"
){
fullFileName
=
getArcGISFullFile
(
z
,
x
,
y
);
}
else
{
fullFileName
=
BASE_PATH
+
z
+
File
.
separator
+
x
+
File
.
separator
+
y
+
".png"
;
}
File
file
=
new
File
(
fullFileName
);
if
(
file
.
exists
()){
return
null
;
}
return
FileUtil
.
file
(
fullFileName
);
}
/**
/**
* @param z
* @param z
...
...
src/main/resources/config/download-map.properties
浏览文件 @
f5c0f289
...
@@ -26,3 +26,6 @@ map.threadNum=1000
...
@@ -26,3 +26,6 @@ map.threadNum=1000
# 是否下载前6级(不能与其余的同时进行)
# 是否下载前6级(不能与其余的同时进行)
map.Lv6.flag
=
false
map.Lv6.flag
=
false
# 是否继续下载
map.download.append
=
false
\ No newline at end of file
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论