05db60ef by chiangbt

update 3.27

1 parent b5905b49
......@@ -2,16 +2,9 @@
<project version="4">
<component name="ChangeListManager">
<list default="true" id="5b5a29d8-78e9-4a9f-a415-1e11442b5ca7" name="Default" comment="">
<change type="DELETED" beforePath="$PROJECT_DIR$/my.db" afterPath="" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/out/production/TiandituDownloader/TiandituDownload.class" afterPath="$PROJECT_DIR$/out/production/TiandituDownloader/TiandituDownload.class" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/out/production/TiandituDownloader/utils/CalEnv.class" afterPath="$PROJECT_DIR$/out/production/TiandituDownloader/utils/CalEnv.class" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/out/production/TiandituDownloader/utils/Point.class" afterPath="$PROJECT_DIR$/out/production/TiandituDownloader/utils/Point.class" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/readme.md" afterPath="$PROJECT_DIR$/readme.md" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/Main.java" afterPath="$PROJECT_DIR$/src/Main.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/TiandituDownload.java" afterPath="$PROJECT_DIR$/src/TiandituDownload.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/utils/CalEnv.java" afterPath="$PROJECT_DIR$/src/utils/CalEnv.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/utils/Point.java" afterPath="$PROJECT_DIR$/src/utils/Point.java" />
</list>
<ignored path="$PROJECT_DIR$/out/" />
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
......@@ -23,32 +16,28 @@
</component>
<component name="FileEditorManager">
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
<file leaf-file-name="Main.java" pinned="false" current-in-tab="false">
<file leaf-file-name="Main.java" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/src/Main.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="210">
<caret line="14" column="0" lean-forward="false" selection-start-line="14" selection-start-column="0" selection-end-line="14" selection-end-column="0" />
<folding>
<element signature="imports" expanded="true" />
</folding>
<state relative-caret-position="45">
<caret line="3" column="0" lean-forward="true" selection-start-line="3" selection-start-column="0" selection-end-line="3" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="TiandituDownload.java" pinned="false" current-in-tab="true">
<file leaf-file-name="TiandituDownload.java" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/TiandituDownload.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1605">
<caret line="109" column="132" lean-forward="false" selection-start-line="109" selection-start-column="132" selection-end-line="109" selection-end-column="132" />
<state relative-caret-position="235">
<caret line="143" column="5" lean-forward="true" selection-start-line="143" selection-start-column="5" selection-end-line="143" selection-end-column="5" />
<folding>
<element signature="imports" expanded="true" />
<element signature="e#2102#2103#0" expanded="true" />
<element signature="method#downloadSingLevelTiles#0;class#TiandituDownload#0" expanded="false" />
<element signature="method#Download#0;class#TiandituDownload#0" expanded="false" />
<element signature="method#getTile#0;class#TiandituDownload#0" expanded="false" />
<marker date="1522070480465" expanded="true" signature="3469:3566" ph="select * fro... missingValue" />
<marker date="1522070480465" expanded="true" signature="5718:5795" ph="INSERT INTO missingValue... " />
<marker date="1522070480465" expanded="true" signature="7165:7352" ph="CREATE TABLE... IF" />
<element signature="e#3248#3249#0" expanded="true" />
<element signature="e#3284#3285#0" expanded="true" />
<marker date="1522117421550" expanded="true" signature="4629:4726" ph="select * fro... missingValue" />
<marker date="1522117421550" expanded="true" signature="6923:7000" ph="INSERT INTO missingValue... " />
<marker date="1522117421550" expanded="true" signature="8359:8546" ph="CREATE TABLE... IF" />
</folding>
</state>
</provider>
......@@ -85,8 +74,8 @@
<option value="$PROJECT_DIR$/readme.md" />
<option value="$PROJECT_DIR$/src/utils/Point.java" />
<option value="$PROJECT_DIR$/src/utils/CalEnv.java" />
<option value="$PROJECT_DIR$/src/Main.java" />
<option value="$PROJECT_DIR$/src/TiandituDownload.java" />
<option value="$PROJECT_DIR$/src/Main.java" />
</list>
</option>
</component>
......@@ -97,7 +86,7 @@
<sorting>DEFINITION_ORDER</sorting>
</component>
<component name="ProjectFrameBounds">
<option name="x" value="171" />
<option name="x" value="40" />
<option name="y" value="29" />
<option name="width" value="1400" />
<option name="height" value="771" />
......@@ -118,9 +107,7 @@
<foldersAlwaysOnTop value="true" />
</navigator>
<panes>
<pane id="Scope" />
<pane id="Scratches" />
<pane id="PackagesPane" />
<pane id="ProjectPane">
<subPane>
<expand>
......@@ -147,6 +134,8 @@
<select />
</subPane>
</pane>
<pane id="PackagesPane" />
<pane id="Scope" />
<pane id="AndroidView" />
</panes>
</component>
......@@ -232,15 +221,16 @@
<updated>1522029080525</updated>
<workItem from="1522029083503" duration="8800000" />
<workItem from="1522044614927" duration="4004000" />
<workItem from="1522068118889" duration="2393000" />
<workItem from="1522068118889" duration="2525000" />
<workItem from="1522113502843" duration="1052000" />
</task>
<servers />
</component>
<component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="15197000" />
<option name="totallyTimeSpent" value="16381000" />
</component>
<component name="ToolWindowManager">
<frame x="171" y="29" width="1400" height="771" extended-state="0" />
<frame x="40" y="29" width="1400" height="771" extended-state="0" />
<layout>
<window_info id="Palette" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
......@@ -250,14 +240,13 @@
<window_info id="Capture Analysis" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" />
<window_info id="Maven Projects" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32988167" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.32988167" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Terminal" active="true" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.4733728" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4733728" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Capture Tool" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Designer" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.100883655" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.102356404" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
<window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32988167" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="UI Designer" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
......@@ -269,6 +258,7 @@
<window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
<window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
<window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32988167" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
</layout>
<layout-to-restore>
<window_info id="Palette" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
......@@ -313,27 +303,46 @@
<component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/src/Main.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="165">
<caret line="14" column="87" lean-forward="false" selection-start-line="14" selection-start-column="87" selection-end-line="14" selection-end-column="87" />
<state relative-caret-position="210">
<caret line="14" column="0" lean-forward="false" selection-start-line="14" selection-start-column="0" selection-end-line="14" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/TiandituDownload.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="2235">
<caret line="149" column="45" lean-forward="true" selection-start-line="149" selection-start-column="45" selection-end-line="149" selection-end-column="45" />
<folding>
<element signature="imports" expanded="true" />
<element signature="e#3248#3249#0" expanded="true" />
<element signature="e#3284#3285#0" expanded="true" />
<marker date="1522117421550" expanded="true" signature="4629:4726" ph="select * fro... missingValue" />
<marker date="1522117421550" expanded="true" signature="6923:7000" ph="INSERT INTO missingValue... " />
<marker date="1522117421550" expanded="true" signature="8359:8546" ph="CREATE TABLE... IF" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/Main.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="165">
<caret line="14" column="87" lean-forward="false" selection-start-line="14" selection-start-column="87" selection-end-line="14" selection-end-column="87" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/TiandituDownload.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1710">
<caret line="114" column="60" lean-forward="true" selection-start-line="114" selection-start-column="60" selection-end-line="114" selection-end-column="60" />
<folding>
<element signature="imports" expanded="true" />
<element signature="e#2102#2103#0" expanded="true" />
<element signature="method#downloadSingLevelTiles#0;class#TiandituDownload#0" expanded="false" />
<element signature="method#Download#0;class#TiandituDownload#0" expanded="false" />
<element signature="method#getTile#0;class#TiandituDownload#0" expanded="false" />
<marker date="1522070480465" expanded="true" signature="3469:3566" ph="select * fro... missingValue" />
<marker date="1522070480465" expanded="true" signature="5718:5795" ph="INSERT INTO missingValue... " />
<marker date="1522070480465" expanded="true" signature="7165:7352" ph="CREATE TABLE... IF" />
<element signature="e#3248#3249#0" expanded="true" />
<element signature="e#3284#3285#0" expanded="true" />
<marker date="1522117421550" expanded="true" signature="4629:4726" ph="select * fro... missingValue" />
<marker date="1522117421550" expanded="true" signature="6923:7000" ph="INSERT INTO missingValue... " />
<marker date="1522117421550" expanded="true" signature="8359:8546" ph="CREATE TABLE... IF" />
</folding>
</state>
</provider>
......@@ -379,9 +388,7 @@
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="180">
<caret line="15" column="83" lean-forward="false" selection-start-line="11" selection-start-column="8" selection-end-line="15" selection-end-column="83" />
<folding>
<element signature="imports" expanded="true" />
</folding>
<folding />
</state>
</provider>
</entry>
......@@ -391,13 +398,11 @@
<caret line="11" column="29" lean-forward="false" selection-start-line="11" selection-start-column="13" selection-end-line="11" selection-end-column="29" />
<folding>
<element signature="imports" expanded="true" />
<element signature="e#2102#2103#0" expanded="true" />
<element signature="method#downloadSingLevelTiles#0;class#TiandituDownload#0" expanded="false" />
<element signature="method#Download#0;class#TiandituDownload#0" expanded="false" />
<element signature="method#getTile#0;class#TiandituDownload#0" expanded="false" />
<marker date="1522070480465" expanded="true" signature="3469:3566" ph="select * fro... missingValue" />
<marker date="1522070480465" expanded="true" signature="5718:5795" ph="INSERT INTO missingValue... " />
<marker date="1522070480465" expanded="true" signature="7165:7352" ph="CREATE TABLE... IF" />
<element signature="e#3248#3249#0" expanded="true" />
<element signature="e#3284#3285#0" expanded="true" />
<marker date="1522117421550" expanded="true" signature="4629:4726" ph="select * fro... missingValue" />
<marker date="1522117421550" expanded="true" signature="6923:7000" ph="INSERT INTO missingValue... " />
<marker date="1522117421550" expanded="true" signature="8359:8546" ph="CREATE TABLE... IF" />
</folding>
</state>
</provider>
......@@ -496,30 +501,26 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/Main.java">
<entry file="file://$PROJECT_DIR$/src/TiandituDownload.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="210">
<caret line="14" column="0" lean-forward="false" selection-start-line="14" selection-start-column="0" selection-end-line="14" selection-end-column="0" />
<state relative-caret-position="235">
<caret line="143" column="5" lean-forward="true" selection-start-line="143" selection-start-column="5" selection-end-line="143" selection-end-column="5" />
<folding>
<element signature="imports" expanded="true" />
<element signature="e#3248#3249#0" expanded="true" />
<element signature="e#3284#3285#0" expanded="true" />
<marker date="1522117421550" expanded="true" signature="4629:4726" ph="select * fro... missingValue" />
<marker date="1522117421550" expanded="true" signature="6923:7000" ph="INSERT INTO missingValue... " />
<marker date="1522117421550" expanded="true" signature="8359:8546" ph="CREATE TABLE... IF" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/TiandituDownload.java">
<entry file="file://$PROJECT_DIR$/src/Main.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1605">
<caret line="109" column="132" lean-forward="false" selection-start-line="109" selection-start-column="132" selection-end-line="109" selection-end-column="132" />
<folding>
<element signature="imports" expanded="true" />
<element signature="e#2102#2103#0" expanded="true" />
<element signature="method#downloadSingLevelTiles#0;class#TiandituDownload#0" expanded="false" />
<element signature="method#Download#0;class#TiandituDownload#0" expanded="false" />
<element signature="method#getTile#0;class#TiandituDownload#0" expanded="false" />
<marker date="1522070480465" expanded="true" signature="3469:3566" ph="select * fro... missingValue" />
<marker date="1522070480465" expanded="true" signature="5718:5795" ph="INSERT INTO missingValue... " />
<marker date="1522070480465" expanded="true" signature="7165:7352" ph="CREATE TABLE... IF" />
</folding>
<state relative-caret-position="45">
<caret line="3" column="0" lean-forward="true" selection-start-line="3" selection-start-column="0" selection-end-line="3" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
......
import utils.CalEnv;
import utils.Point;
import utils.TianDiTuTiledMapServiceType;
......
......@@ -20,7 +20,7 @@ public class TiandituDownload {
int[] level = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20};
// 分辨率
double[] res = {
double[] res4490 = {
1.40625,
0.703125,
0.3515625,
......@@ -44,7 +44,7 @@ public class TiandituDownload {
1.34110450744629E-06
};
// 比例尺
double[] scale = {
double[] scale4490 = {
400000000,
295497598.5708346,
147748799.285417,
......@@ -67,6 +67,47 @@ public class TiandituDownload {
1127.2338812669175,
563.61694063345875
};
double[] scale3857 = {
295829355.45,
147914677.73,
73957338.86,
36978669.43,
18489334.72,
9244667.36,
4622333.68,
2311166.84,
1155583.42,
577791.71,
288895.85,
144447.93,
72223.96,
36111.98,
18055.99,
9028,
4514,
2257};
double[] res3857 = {
0.70391441567318025,
0.35195720784848739,
0.1759786039123464,
0.087989301956173202,
0.043994650989983904,
0.021997325494991952,
0.010998662747495976,
0.005499331373747988,
0.002749665686873994,
0.001374832843436997,
0.00068741640982119352,
0.00034370821680790179,
0.00017185409650664589,
8.5927048253322947e-005,
4.2963524126661473e-005,
2.1481773960635764e-005,
1.0740886980317882e-005,
5.3704434901589409e-006};
// 最小级别
int minLevel = 1;
......@@ -80,19 +121,22 @@ public class TiandituDownload {
Connection conn = null;
Statement stmt = null;
public TiandituDownload() {
}
public TiandituDownload(String dbpath) {
this.dbpath = dbpath;
}
/**
*
* @param originPoint 坐标点
* @param level 级别
* @return 改点在该级别所属的地图瓦片行列号
* @param level 级别
* @return 改点在该级别所属的地图瓦片行列号(4490)
*/
private CalEnv calculateEnv(Point originPoint, int level) {
int startX = (int) Math.floor((originPoint.getLng() + 180) / (256 * res[level]));
int startY = (int) Math.floor((90 - originPoint.getLat()) / (256 * res[level]));
private CalEnv calculateEnv4490(Point originPoint, int level) {
int startX = (int) Math.floor((originPoint.getLng() + 180) / (256 * res4490[level]));
int startY = (int) Math.floor((90 - originPoint.getLat()) / (256 * res4490[level]));
if (startX < 0) startX = 0;
if (startY < 0) startY = 0;
......@@ -100,18 +144,17 @@ public class TiandituDownload {
}
/**
*
* @param minPoint 下载范围左下角坐标
* @param maxPoint 下载范围右上角坐标
* @param level 下载级别
* @param type 下载数据类型
* @param merge 数据与其注记是否融合
* @param maxPoint 下载范围右上角坐标
* @param level 下载级别
* @param type 下载数据类型
* @param merge 数据与其注记是否融合
*/
private void downloadSingLevelTiles(Point minPoint, Point maxPoint, int level, TianDiTuTiledMapServiceType type, boolean merge) {
try {
CalEnv startEnv = calculateEnv(minPoint, level);
CalEnv stopEnv = calculateEnv(maxPoint, level);
CalEnv startEnv = calculateEnv4490(minPoint, level);
CalEnv stopEnv = calculateEnv4490(maxPoint, level);
PreparedStatement preparedStatement;
ResultSet rs;
......@@ -179,13 +222,12 @@ public class TiandituDownload {
}
/**
*
* @param minPoint 下载范围左下角坐标
* @param maxPoint 下载范围右上角坐标
* @param minLevel 下载最小级别
* @param maxLevel 下载最大级别
* @param type 下载数据类型
* @param merge 数据与其注记是否融合
* @param minLevel 下载最小级别
* @param maxLevel 下载最大级别
* @param type 下载数据类型
* @param merge 数据与其注记是否融合
* @throws SQLException
*/
public void Download(Point minPoint, Point maxPoint, int minLevel, int maxLevel, TianDiTuTiledMapServiceType type, boolean merge) throws SQLException {
......@@ -216,6 +258,7 @@ public class TiandituDownload {
/**
* 下载网络数据
*
* @param url
* @return 图片数据流
* @throws Exception
......