update3
Showing
11 changed files
with
225 additions
and
164 deletions
... | @@ -3,13 +3,15 @@ | ... | @@ -3,13 +3,15 @@ |
3 | <component name="ChangeListManager"> | 3 | <component name="ChangeListManager"> |
4 | <list default="true" id="5b5a29d8-78e9-4a9f-a415-1e11442b5ca7" name="Default" comment=""> | 4 | <list default="true" id="5b5a29d8-78e9-4a9f-a415-1e11442b5ca7" name="Default" comment=""> |
5 | <change type="DELETED" beforePath="$PROJECT_DIR$/my.db" afterPath="" /> | 5 | <change type="DELETED" beforePath="$PROJECT_DIR$/my.db" afterPath="" /> |
6 | <change type="MODIFICATION" beforePath="$PROJECT_DIR$/out/production/TiandituDownloader/Main.class" afterPath="$PROJECT_DIR$/out/production/TiandituDownloader/Main.class" /> | ||
7 | <change type="MODIFICATION" beforePath="$PROJECT_DIR$/out/production/TiandituDownloader/TiandituDownload.class" afterPath="$PROJECT_DIR$/out/production/TiandituDownloader/TiandituDownload.class" /> | 6 | <change type="MODIFICATION" beforePath="$PROJECT_DIR$/out/production/TiandituDownloader/TiandituDownload.class" afterPath="$PROJECT_DIR$/out/production/TiandituDownloader/TiandituDownload.class" /> |
8 | <change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/uiDesigner.xml" afterPath="$PROJECT_DIR$/.idea/uiDesigner.xml" /> | 7 | <change type="MODIFICATION" beforePath="$PROJECT_DIR$/out/production/TiandituDownloader/utils/CalEnv.class" afterPath="$PROJECT_DIR$/out/production/TiandituDownloader/utils/CalEnv.class" /> |
8 | <change type="MODIFICATION" beforePath="$PROJECT_DIR$/out/production/TiandituDownloader/utils/Point.class" afterPath="$PROJECT_DIR$/out/production/TiandituDownloader/utils/Point.class" /> | ||
9 | <change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" /> | 9 | <change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" /> |
10 | <change type="MODIFICATION" beforePath="$PROJECT_DIR$/readme.md" afterPath="$PROJECT_DIR$/readme.md" /> | 10 | <change type="MODIFICATION" beforePath="$PROJECT_DIR$/readme.md" afterPath="$PROJECT_DIR$/readme.md" /> |
11 | <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/Main.java" afterPath="$PROJECT_DIR$/src/Main.java" /> | 11 | <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/Main.java" afterPath="$PROJECT_DIR$/src/Main.java" /> |
12 | <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/TiandituDownload.java" afterPath="$PROJECT_DIR$/src/TiandituDownload.java" /> | 12 | <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/TiandituDownload.java" afterPath="$PROJECT_DIR$/src/TiandituDownload.java" /> |
13 | <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/utils/CalEnv.java" afterPath="$PROJECT_DIR$/src/utils/CalEnv.java" /> | ||
14 | <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/utils/Point.java" afterPath="$PROJECT_DIR$/src/utils/Point.java" /> | ||
13 | </list> | 15 | </list> |
14 | <ignored path="$PROJECT_DIR$/out/" /> | 16 | <ignored path="$PROJECT_DIR$/out/" /> |
15 | <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" /> | 17 | <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" /> |
... | @@ -21,11 +23,11 @@ | ... | @@ -21,11 +23,11 @@ |
21 | </component> | 23 | </component> |
22 | <component name="FileEditorManager"> | 24 | <component name="FileEditorManager"> |
23 | <leaf SIDE_TABS_SIZE_LIMIT_KEY="300"> | 25 | <leaf SIDE_TABS_SIZE_LIMIT_KEY="300"> |
24 | <file leaf-file-name="Main.java" pinned="false" current-in-tab="false"> | 26 | <file leaf-file-name="Main.java" pinned="false" current-in-tab="true"> |
25 | <entry file="file://$PROJECT_DIR$/src/Main.java"> | 27 | <entry file="file://$PROJECT_DIR$/src/Main.java"> |
26 | <provider selected="true" editor-type-id="text-editor"> | 28 | <provider selected="true" editor-type-id="text-editor"> |
27 | <state relative-caret-position="210"> | 29 | <state relative-caret-position="210"> |
28 | <caret line="14" column="87" lean-forward="false" selection-start-line="14" selection-start-column="87" selection-end-line="14" selection-end-column="87" /> | 30 | <caret line="14" column="79" lean-forward="false" selection-start-line="14" selection-start-column="79" selection-end-line="14" selection-end-column="79" /> |
29 | <folding> | 31 | <folding> |
30 | <element signature="imports" expanded="true" /> | 32 | <element signature="imports" expanded="true" /> |
31 | </folding> | 33 | </folding> |
... | @@ -33,68 +35,23 @@ | ... | @@ -33,68 +35,23 @@ |
33 | </provider> | 35 | </provider> |
34 | </entry> | 36 | </entry> |
35 | </file> | 37 | </file> |
36 | <file leaf-file-name="readme.md" pinned="false" current-in-tab="true"> | ||
37 | <entry file="file://$PROJECT_DIR$/readme.md"> | ||
38 | <provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]"> | ||
39 | <state split_layout="SPLIT"> | ||
40 | <first_editor relative-caret-position="210"> | ||
41 | <caret line="14" column="44" lean-forward="false" selection-start-line="14" selection-start-column="44" selection-end-line="14" selection-end-column="44" /> | ||
42 | <folding /> | ||
43 | </first_editor> | ||
44 | <second_editor /> | ||
45 | </state> | ||
46 | </provider> | ||
47 | </entry> | ||
48 | </file> | ||
49 | <file leaf-file-name="TiandituDownload.java" pinned="false" current-in-tab="false"> | 38 | <file leaf-file-name="TiandituDownload.java" pinned="false" current-in-tab="false"> |
50 | <entry file="file://$PROJECT_DIR$/src/TiandituDownload.java"> | 39 | <entry file="file://$PROJECT_DIR$/src/TiandituDownload.java"> |
51 | <provider selected="true" editor-type-id="text-editor"> | 40 | <provider selected="true" editor-type-id="text-editor"> |
52 | <state relative-caret-position="190"> | 41 | <state relative-caret-position="295"> |
53 | <caret line="114" column="60" lean-forward="true" selection-start-line="114" selection-start-column="60" selection-end-line="114" selection-end-column="60" /> | 42 | <caret line="45" column="10" lean-forward="false" selection-start-line="45" selection-start-column="10" selection-end-line="45" selection-end-column="10" /> |
54 | <folding> | 43 | <folding> |
55 | <element signature="imports" expanded="true" /> | 44 | <element signature="imports" expanded="true" /> |
56 | <element signature="method#calculateEnv#0;class#TiandituDownload#0" expanded="false" /> | 45 | <element signature="e#2063#2064#0" expanded="true" /> |
57 | <element signature="method#getTile#0;class#TiandituDownload#0" expanded="false" /> | 46 | <element signature="method#getTile#0;class#TiandituDownload#0" expanded="false" /> |
58 | <marker date="1522048729940" expanded="true" signature="3123:3220" ph="select * fro... missingValue" /> | 47 | <marker date="1522070065953" expanded="true" signature="3289:3386" ph="select * fro... missingValue" /> |
59 | <marker date="1522048729940" expanded="true" signature="5353:5429" ph="INSERT INTO missingValue... " /> | 48 | <marker date="1522070065953" expanded="true" signature="5529:5606" ph="INSERT INTO missingValue... " /> |
60 | <marker date="1522048729940" expanded="true" signature="6550:6737" ph="CREATE TABLE... IF" /> | 49 | <marker date="1522070065953" expanded="true" signature="6731:6918" ph="CREATE TABLE... IF" /> |
61 | </folding> | 50 | </folding> |
62 | </state> | 51 | </state> |
63 | </provider> | 52 | </provider> |
64 | </entry> | 53 | </entry> |
65 | </file> | 54 | </file> |
66 | <file leaf-file-name="TDTUrl.java" pinned="false" current-in-tab="false"> | ||
67 | <entry file="file://$PROJECT_DIR$/src/utils/TDTUrl.java"> | ||
68 | <provider selected="true" editor-type-id="text-editor"> | ||
69 | <state relative-caret-position="15"> | ||
70 | <caret line="1" column="0" lean-forward="false" selection-start-line="1" selection-start-column="0" selection-end-line="1" selection-end-column="0" /> | ||
71 | <folding> | ||
72 | <element signature="imports" expanded="true" /> | ||
73 | </folding> | ||
74 | </state> | ||
75 | </provider> | ||
76 | </entry> | ||
77 | </file> | ||
78 | <file leaf-file-name="TianDiTuTiledMapServiceType.java" pinned="false" current-in-tab="false"> | ||
79 | <entry file="file://$PROJECT_DIR$/src/utils/TianDiTuTiledMapServiceType.java"> | ||
80 | <provider selected="true" editor-type-id="text-editor"> | ||
81 | <state relative-caret-position="30"> | ||
82 | <caret line="2" column="3" lean-forward="false" selection-start-line="2" selection-start-column="3" selection-end-line="2" selection-end-column="3" /> | ||
83 | <folding /> | ||
84 | </state> | ||
85 | </provider> | ||
86 | </entry> | ||
87 | </file> | ||
88 | <file leaf-file-name="Point.java" pinned="false" current-in-tab="false"> | ||
89 | <entry file="file://$PROJECT_DIR$/src/utils/Point.java"> | ||
90 | <provider selected="true" editor-type-id="text-editor"> | ||
91 | <state relative-caret-position="0"> | ||
92 | <caret line="0" column="10" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="1" selection-end-column="0" /> | ||
93 | <folding /> | ||
94 | </state> | ||
95 | </provider> | ||
96 | </entry> | ||
97 | </file> | ||
98 | </leaf> | 55 | </leaf> |
99 | </component> | 56 | </component> |
100 | <component name="FileTemplateManagerImpl"> | 57 | <component name="FileTemplateManagerImpl"> |
... | @@ -117,17 +74,17 @@ | ... | @@ -117,17 +74,17 @@ |
117 | <list> | 74 | <list> |
118 | <option value="$PROJECT_DIR$/src/Point.java" /> | 75 | <option value="$PROJECT_DIR$/src/Point.java" /> |
119 | <option value="$PROJECT_DIR$/src/CalEnv.java" /> | 76 | <option value="$PROJECT_DIR$/src/CalEnv.java" /> |
120 | <option value="$PROJECT_DIR$/src/utils/CalEnv.java" /> | ||
121 | <option value="$PROJECT_DIR$/src/utils/Point.java" /> | ||
122 | <option value="$PROJECT_DIR$/src/TianDiTuTiledMapServiceType.java" /> | 77 | <option value="$PROJECT_DIR$/src/TianDiTuTiledMapServiceType.java" /> |
123 | <option value="$PROJECT_DIR$/src/TDTUrl.java" /> | 78 | <option value="$PROJECT_DIR$/src/TDTUrl.java" /> |
124 | <option value="$PROJECT_DIR$/src/utils/TianDiTuTiledMapServiceType.java" /> | 79 | <option value="$PROJECT_DIR$/src/utils/TianDiTuTiledMapServiceType.java" /> |
125 | <option value="$PROJECT_DIR$/src/utils/TDTUrl.java" /> | 80 | <option value="$PROJECT_DIR$/src/utils/TDTUrl.java" /> |
126 | <option value="$PROJECT_DIR$/src/MainForm.java" /> | 81 | <option value="$PROJECT_DIR$/src/MainForm.java" /> |
127 | <option value="$PROJECT_DIR$/src/MainForm.form" /> | 82 | <option value="$PROJECT_DIR$/src/MainForm.form" /> |
83 | <option value="$PROJECT_DIR$/readme.md" /> | ||
84 | <option value="$PROJECT_DIR$/src/utils/Point.java" /> | ||
85 | <option value="$PROJECT_DIR$/src/utils/CalEnv.java" /> | ||
128 | <option value="$PROJECT_DIR$/src/Main.java" /> | 86 | <option value="$PROJECT_DIR$/src/Main.java" /> |
129 | <option value="$PROJECT_DIR$/src/TiandituDownload.java" /> | 87 | <option value="$PROJECT_DIR$/src/TiandituDownload.java" /> |
130 | <option value="$PROJECT_DIR$/readme.md" /> | ||
131 | </list> | 88 | </list> |
132 | </option> | 89 | </option> |
133 | </component> | 90 | </component> |
... | @@ -138,8 +95,8 @@ | ... | @@ -138,8 +95,8 @@ |
138 | <sorting>DEFINITION_ORDER</sorting> | 95 | <sorting>DEFINITION_ORDER</sorting> |
139 | </component> | 96 | </component> |
140 | <component name="ProjectFrameBounds"> | 97 | <component name="ProjectFrameBounds"> |
141 | <option name="x" value="40" /> | 98 | <option name="x" value="171" /> |
142 | <option name="y" value="23" /> | 99 | <option name="y" value="29" /> |
143 | <option name="width" value="1400" /> | 100 | <option name="width" value="1400" /> |
144 | <option name="height" value="771" /> | 101 | <option name="height" value="771" /> |
145 | </component> | 102 | </component> |
... | @@ -159,10 +116,9 @@ | ... | @@ -159,10 +116,9 @@ |
159 | <foldersAlwaysOnTop value="true" /> | 116 | <foldersAlwaysOnTop value="true" /> |
160 | </navigator> | 117 | </navigator> |
161 | <panes> | 118 | <panes> |
119 | <pane id="Scope" /> | ||
162 | <pane id="Scratches" /> | 120 | <pane id="Scratches" /> |
163 | <pane id="PackagesPane" /> | 121 | <pane id="PackagesPane" /> |
164 | <pane id="AndroidView" /> | ||
165 | <pane id="Scope" /> | ||
166 | <pane id="ProjectPane"> | 122 | <pane id="ProjectPane"> |
167 | <subPane> | 123 | <subPane> |
168 | <expand> | 124 | <expand> |
... | @@ -177,12 +133,19 @@ | ... | @@ -177,12 +133,19 @@ |
177 | </path> | 133 | </path> |
178 | <path> | 134 | <path> |
179 | <item name="TiandituDownloader" type="b2602c69:ProjectViewProjectNode" /> | 135 | <item name="TiandituDownloader" type="b2602c69:ProjectViewProjectNode" /> |
136 | <item name="TiandituDownloader" type="462c0819:PsiDirectoryNode" /> | ||
137 | <item name="src" type="462c0819:PsiDirectoryNode" /> | ||
138 | <item name="utils" type="462c0819:PsiDirectoryNode" /> | ||
139 | </path> | ||
140 | <path> | ||
141 | <item name="TiandituDownloader" type="b2602c69:ProjectViewProjectNode" /> | ||
180 | <item name="External Libraries" type="cb654da1:ExternalLibrariesNode" /> | 142 | <item name="External Libraries" type="cb654da1:ExternalLibrariesNode" /> |
181 | </path> | 143 | </path> |
182 | </expand> | 144 | </expand> |
183 | <select /> | 145 | <select /> |
184 | </subPane> | 146 | </subPane> |
185 | </pane> | 147 | </pane> |
148 | <pane id="AndroidView" /> | ||
186 | </panes> | 149 | </panes> |
187 | </component> | 150 | </component> |
188 | <component name="PropertiesComponent"> | 151 | <component name="PropertiesComponent"> |
... | @@ -266,15 +229,16 @@ | ... | @@ -266,15 +229,16 @@ |
266 | <option name="presentableId" value="Default" /> | 229 | <option name="presentableId" value="Default" /> |
267 | <updated>1522029080525</updated> | 230 | <updated>1522029080525</updated> |
268 | <workItem from="1522029083503" duration="8800000" /> | 231 | <workItem from="1522029083503" duration="8800000" /> |
269 | <workItem from="1522044614927" duration="3890000" /> | 232 | <workItem from="1522044614927" duration="4004000" /> |
233 | <workItem from="1522068118889" duration="1963000" /> | ||
270 | </task> | 234 | </task> |
271 | <servers /> | 235 | <servers /> |
272 | </component> | 236 | </component> |
273 | <component name="TimeTrackingManager"> | 237 | <component name="TimeTrackingManager"> |
274 | <option name="totallyTimeSpent" value="12690000" /> | 238 | <option name="totallyTimeSpent" value="14767000" /> |
275 | </component> | 239 | </component> |
276 | <component name="ToolWindowManager"> | 240 | <component name="ToolWindowManager"> |
277 | <frame x="40" y="23" width="1400" height="771" extended-state="0" /> | 241 | <frame x="171" y="29" width="1400" height="771" extended-state="0" /> |
278 | <editor active="true" /> | 242 | <editor active="true" /> |
279 | <layout> | 243 | <layout> |
280 | <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" /> | 244 | <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" /> |
... | @@ -287,10 +251,10 @@ | ... | @@ -287,10 +251,10 @@ |
287 | <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" /> | 251 | <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" /> |
288 | <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" /> | 252 | <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" /> |
289 | <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" /> | 253 | <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" /> |
290 | <window_info id="Terminal" 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="7" side_tool="false" content_ui="tabs" /> | 254 | <window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.14201184" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" /> |
291 | <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" /> | 255 | <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" /> |
292 | <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" /> | 256 | <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" /> |
293 | <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.17157584" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" /> | 257 | <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" /> |
294 | <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" /> | 258 | <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" /> |
295 | <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" /> | 259 | <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" /> |
296 | <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" /> | 260 | <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" /> |
... | @@ -348,6 +312,68 @@ | ... | @@ -348,6 +312,68 @@ |
348 | <component name="editorHistoryManager"> | 312 | <component name="editorHistoryManager"> |
349 | <entry file="file://$PROJECT_DIR$/src/Main.java"> | 313 | <entry file="file://$PROJECT_DIR$/src/Main.java"> |
350 | <provider selected="true" editor-type-id="text-editor"> | 314 | <provider selected="true" editor-type-id="text-editor"> |
315 | <state relative-caret-position="165"> | ||
316 | <caret line="14" column="87" lean-forward="false" selection-start-line="14" selection-start-column="87" selection-end-line="14" selection-end-column="87" /> | ||
317 | <folding> | ||
318 | <element signature="imports" expanded="true" /> | ||
319 | </folding> | ||
320 | </state> | ||
321 | </provider> | ||
322 | </entry> | ||
323 | <entry file="file://$PROJECT_DIR$/src/TiandituDownload.java"> | ||
324 | <provider selected="true" editor-type-id="text-editor"> | ||
325 | <state relative-caret-position="1710"> | ||
326 | <caret line="114" column="60" lean-forward="true" selection-start-line="114" selection-start-column="60" selection-end-line="114" selection-end-column="60" /> | ||
327 | <folding> | ||
328 | <element signature="imports" expanded="true" /> | ||
329 | <element signature="e#2063#2064#0" expanded="true" /> | ||
330 | <element signature="method#getTile#0;class#TiandituDownload#0" expanded="false" /> | ||
331 | <marker date="1522070065953" expanded="true" signature="3289:3386" ph="select * fro... missingValue" /> | ||
332 | <marker date="1522070065953" expanded="true" signature="5529:5606" ph="INSERT INTO missingValue... " /> | ||
333 | <marker date="1522070065953" expanded="true" signature="6731:6918" ph="CREATE TABLE... IF" /> | ||
334 | </folding> | ||
335 | </state> | ||
336 | </provider> | ||
337 | </entry> | ||
338 | <entry file="file://$PROJECT_DIR$/src/utils/TDTUrl.java"> | ||
339 | <provider selected="true" editor-type-id="text-editor"> | ||
340 | <state relative-caret-position="15"> | ||
341 | <caret line="1" column="0" lean-forward="false" selection-start-line="1" selection-start-column="0" selection-end-line="1" selection-end-column="0" /> | ||
342 | <folding> | ||
343 | <element signature="imports" expanded="true" /> | ||
344 | </folding> | ||
345 | </state> | ||
346 | </provider> | ||
347 | </entry> | ||
348 | <entry file="file://$PROJECT_DIR$/src/utils/TianDiTuTiledMapServiceType.java"> | ||
349 | <provider selected="true" editor-type-id="text-editor"> | ||
350 | <state relative-caret-position="30"> | ||
351 | <caret line="2" column="3" lean-forward="false" selection-start-line="2" selection-start-column="3" selection-end-line="2" selection-end-column="3" /> | ||
352 | <folding /> | ||
353 | </state> | ||
354 | </provider> | ||
355 | </entry> | ||
356 | <entry file="file://$PROJECT_DIR$/src/utils/Point.java"> | ||
357 | <provider selected="true" editor-type-id="text-editor"> | ||
358 | <state relative-caret-position="0"> | ||
359 | <caret line="0" column="10" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="1" selection-end-column="0" /> | ||
360 | <folding /> | ||
361 | </state> | ||
362 | </provider> | ||
363 | </entry> | ||
364 | <entry file="file://$PROJECT_DIR$/readme.md"> | ||
365 | <provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]"> | ||
366 | <state split_layout="SPLIT"> | ||
367 | <first_editor relative-caret-position="255"> | ||
368 | <caret line="17" column="3" lean-forward="true" selection-start-line="17" selection-start-column="3" selection-end-line="17" selection-end-column="3" /> | ||
369 | <folding /> | ||
370 | </first_editor> | ||
371 | <second_editor /> | ||
372 | </state> | ||
373 | </provider> | ||
374 | </entry> | ||
375 | <entry file="file://$PROJECT_DIR$/src/Main.java"> | ||
376 | <provider selected="true" editor-type-id="text-editor"> | ||
351 | <state relative-caret-position="180"> | 377 | <state relative-caret-position="180"> |
352 | <caret line="15" column="83" lean-forward="false" selection-start-line="11" selection-start-column="8" selection-end-line="15" selection-end-column="83" /> | 378 | <caret line="15" column="83" lean-forward="false" selection-start-line="11" selection-start-column="8" selection-end-line="15" selection-end-column="83" /> |
353 | <folding> | 379 | <folding> |
... | @@ -362,11 +388,11 @@ | ... | @@ -362,11 +388,11 @@ |
362 | <caret line="11" column="29" lean-forward="false" selection-start-line="11" selection-start-column="13" selection-end-line="11" selection-end-column="29" /> | 388 | <caret line="11" column="29" lean-forward="false" selection-start-line="11" selection-start-column="13" selection-end-line="11" selection-end-column="29" /> |
363 | <folding> | 389 | <folding> |
364 | <element signature="imports" expanded="true" /> | 390 | <element signature="imports" expanded="true" /> |
365 | <element signature="method#calculateEnv#0;class#TiandituDownload#0" expanded="false" /> | 391 | <element signature="e#2063#2064#0" expanded="true" /> |
366 | <element signature="method#getTile#0;class#TiandituDownload#0" expanded="false" /> | 392 | <element signature="method#getTile#0;class#TiandituDownload#0" expanded="false" /> |
367 | <marker date="1522048729940" expanded="true" signature="3123:3220" ph="select * fro... missingValue" /> | 393 | <marker date="1522070065953" expanded="true" signature="3289:3386" ph="select * fro... missingValue" /> |
368 | <marker date="1522048729940" expanded="true" signature="5353:5429" ph="INSERT INTO missingValue... " /> | 394 | <marker date="1522070065953" expanded="true" signature="5529:5606" ph="INSERT INTO missingValue... " /> |
369 | <marker date="1522048729940" expanded="true" signature="6550:6737" ph="CREATE TABLE... IF" /> | 395 | <marker date="1522070065953" expanded="true" signature="6731:6918" ph="CREATE TABLE... IF" /> |
370 | </folding> | 396 | </folding> |
371 | </state> | 397 | </state> |
372 | </provider> | 398 | </provider> |
... | @@ -415,17 +441,23 @@ | ... | @@ -415,17 +441,23 @@ |
415 | </state> | 441 | </state> |
416 | </provider> | 442 | </provider> |
417 | </entry> | 443 | </entry> |
418 | <entry file="file://$PROJECT_DIR$/src/utils/CalEnv.java"> | 444 | <entry file="file://$PROJECT_DIR$/src/MainForm.form" /> |
419 | <provider selected="true" editor-type-id="text-editor"> | 445 | <entry file="file://$PROJECT_DIR$/src/MainForm.java" /> |
420 | <state relative-caret-position="30"> | 446 | <entry file="file://$PROJECT_DIR$/readme.md"> |
421 | <caret line="2" column="13" lean-forward="false" selection-start-line="2" selection-start-column="13" selection-end-line="2" selection-end-column="13" /> | 447 | <provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]"> |
448 | <state split_layout="SPLIT"> | ||
449 | <first_editor relative-caret-position="255"> | ||
450 | <caret line="17" column="3" lean-forward="false" selection-start-line="17" selection-start-column="3" selection-end-line="17" selection-end-column="3" /> | ||
451 | <folding /> | ||
452 | </first_editor> | ||
453 | <second_editor /> | ||
422 | </state> | 454 | </state> |
423 | </provider> | 455 | </provider> |
424 | </entry> | 456 | </entry> |
425 | <entry file="file://$PROJECT_DIR$/src/utils/Point.java"> | 457 | <entry file="file://$PROJECT_DIR$/src/utils/Point.java"> |
426 | <provider selected="true" editor-type-id="text-editor"> | 458 | <provider selected="true" editor-type-id="text-editor"> |
427 | <state relative-caret-position="0"> | 459 | <state relative-caret-position="45"> |
428 | <caret line="0" column="10" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="1" selection-end-column="0" /> | 460 | <caret line="3" column="7" lean-forward="false" selection-start-line="3" selection-start-column="7" selection-end-line="3" selection-end-column="7" /> |
429 | <folding /> | 461 | <folding /> |
430 | </state> | 462 | </state> |
431 | </provider> | 463 | </provider> |
... | @@ -440,60 +472,47 @@ | ... | @@ -440,60 +472,47 @@ |
440 | </entry> | 472 | </entry> |
441 | <entry file="file://$PROJECT_DIR$/src/utils/TDTUrl.java"> | 473 | <entry file="file://$PROJECT_DIR$/src/utils/TDTUrl.java"> |
442 | <provider selected="true" editor-type-id="text-editor"> | 474 | <provider selected="true" editor-type-id="text-editor"> |
443 | <state relative-caret-position="15"> | 475 | <state relative-caret-position="-467"> |
444 | <caret line="1" column="0" lean-forward="false" selection-start-line="1" selection-start-column="0" selection-end-line="1" selection-end-column="0" /> | 476 | <caret line="9" column="0" lean-forward="true" selection-start-line="9" selection-start-column="0" selection-end-line="9" selection-end-column="0" /> |
445 | <folding> | 477 | <folding> |
446 | <element signature="imports" expanded="true" /> | 478 | <element signature="imports" expanded="true" /> |
447 | </folding> | 479 | </folding> |
448 | </state> | 480 | </state> |
449 | </provider> | 481 | </provider> |
450 | </entry> | 482 | </entry> |
451 | <entry file="file://$PROJECT_DIR$/src/MainForm.form"> | 483 | <entry file="file://$PROJECT_DIR$/src/utils/CalEnv.java"> |
452 | <provider selected="true" editor-type-id="ui-designer"> | ||
453 | <state /> | ||
454 | </provider> | ||
455 | </entry> | ||
456 | <entry file="file://$PROJECT_DIR$/src/MainForm.java"> | ||
457 | <provider selected="true" editor-type-id="text-editor"> | ||
458 | <state relative-caret-position="75"> | ||
459 | <caret line="5" column="0" lean-forward="true" selection-start-line="5" selection-start-column="0" selection-end-line="5" selection-end-column="0" /> | ||
460 | <folding /> | ||
461 | </state> | ||
462 | </provider> | ||
463 | </entry> | ||
464 | <entry file="file://$PROJECT_DIR$/src/Main.java"> | ||
465 | <provider selected="true" editor-type-id="text-editor"> | 484 | <provider selected="true" editor-type-id="text-editor"> |
466 | <state relative-caret-position="210"> | 485 | <state relative-caret-position="253"> |
467 | <caret line="14" column="87" lean-forward="false" selection-start-line="14" selection-start-column="87" selection-end-line="14" selection-end-column="87" /> | 486 | <caret line="28" column="27" lean-forward="false" selection-start-line="28" selection-start-column="27" selection-end-line="28" selection-end-column="27" /> |
468 | <folding> | 487 | <folding> |
469 | <element signature="imports" expanded="true" /> | 488 | <element signature="e#487#488#0" expanded="true" /> |
489 | <element signature="e#527#528#0" expanded="true" /> | ||
470 | </folding> | 490 | </folding> |
471 | </state> | 491 | </state> |
472 | </provider> | 492 | </provider> |
473 | </entry> | 493 | </entry> |
474 | <entry file="file://$PROJECT_DIR$/src/TiandituDownload.java"> | 494 | <entry file="file://$PROJECT_DIR$/src/TiandituDownload.java"> |
475 | <provider selected="true" editor-type-id="text-editor"> | 495 | <provider selected="true" editor-type-id="text-editor"> |
476 | <state relative-caret-position="190"> | 496 | <state relative-caret-position="295"> |
477 | <caret line="114" column="60" lean-forward="true" selection-start-line="114" selection-start-column="60" selection-end-line="114" selection-end-column="60" /> | 497 | <caret line="45" column="10" lean-forward="false" selection-start-line="45" selection-start-column="10" selection-end-line="45" selection-end-column="10" /> |
478 | <folding> | 498 | <folding> |
479 | <element signature="imports" expanded="true" /> | 499 | <element signature="imports" expanded="true" /> |
480 | <element signature="method#calculateEnv#0;class#TiandituDownload#0" expanded="false" /> | 500 | <element signature="e#2063#2064#0" expanded="true" /> |
481 | <element signature="method#getTile#0;class#TiandituDownload#0" expanded="false" /> | 501 | <element signature="method#getTile#0;class#TiandituDownload#0" expanded="false" /> |
482 | <marker date="1522048729940" expanded="true" signature="3123:3220" ph="select * fro... missingValue" /> | 502 | <marker date="1522070065953" expanded="true" signature="3289:3386" ph="select * fro... missingValue" /> |
483 | <marker date="1522048729940" expanded="true" signature="5353:5429" ph="INSERT INTO missingValue... " /> | 503 | <marker date="1522070065953" expanded="true" signature="5529:5606" ph="INSERT INTO missingValue... " /> |
484 | <marker date="1522048729940" expanded="true" signature="6550:6737" ph="CREATE TABLE... IF" /> | 504 | <marker date="1522070065953" expanded="true" signature="6731:6918" ph="CREATE TABLE... IF" /> |
485 | </folding> | 505 | </folding> |
486 | </state> | 506 | </state> |
487 | </provider> | 507 | </provider> |
488 | </entry> | 508 | </entry> |
489 | <entry file="file://$PROJECT_DIR$/readme.md"> | 509 | <entry file="file://$PROJECT_DIR$/src/Main.java"> |
490 | <provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]"> | 510 | <provider selected="true" editor-type-id="text-editor"> |
491 | <state split_layout="SPLIT"> | 511 | <state relative-caret-position="210"> |
492 | <first_editor relative-caret-position="210"> | 512 | <caret line="14" column="79" lean-forward="false" selection-start-line="14" selection-start-column="79" selection-end-line="14" selection-end-column="79" /> |
493 | <caret line="14" column="44" lean-forward="false" selection-start-line="14" selection-start-column="44" selection-end-line="14" selection-end-column="44" /> | 513 | <folding> |
494 | <folding /> | 514 | <element signature="imports" expanded="true" /> |
495 | </first_editor> | 515 | </folding> |
496 | <second_editor /> | ||
497 | </state> | 516 | </state> |
498 | </provider> | 517 | </provider> |
499 | </entry> | 518 | </entry> | ... | ... |
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
... | @@ -4,15 +4,15 @@ TiandituDownload主要用于下载天地图数据,其坐标系为CGCS2000. | ... | @@ -4,15 +4,15 @@ TiandituDownload主要用于下载天地图数据,其坐标系为CGCS2000. |
4 | 4 | ||
5 | ```java | 5 | ```java |
6 | 6 | ||
7 | // 设置要下载的图片存储sqlite路径 | 7 | // 设置要下载的图片存储sqlite路径 |
8 | TiandituDownload tiandituDownload = new TiandituDownload("my.db"); | 8 | TiandituDownload tiandituDownload = new TiandituDownload("my.db"); |
9 | // 范围起始点(左下角、右上角) | 9 | // 范围起始点(左下角、右上角) |
10 | Point pt = new Point(29.76,106.64); | 10 | Point pt = new Point(29.76,106.64); |
11 | Point pt2 = new Point(35.33, 108.12); | 11 | Point pt2 = new Point(35.33, 108.12); |
12 | // 下载器 | 12 | // 下载器 |
13 | // 2 为最小level,9为最大level | 13 | // 2 为最小level,9为最大level |
14 | // TianDiTuTiledMapServiceType.IMG_C 为下载数据类型 | 14 | // TianDiTuTiledMapServiceType.IMG_C 为下载数据类型 |
15 | // 最后一个参数为merge,为true时,会将地图及其注记一并下载融合到一张图片中去 | 15 | // 最后一个参数为merge,为true时,会将地图及其注记一并下载融合到一张图片中去 |
16 | tiandituDownload.Download(pt, pt2, 2,9, TianDiTuTiledMapServiceType.IMG_C, true); | 16 | tiandituDownload.Download(pt, pt2, 2,9, TianDiTuTiledMapServiceType.IMG_C, true); |
17 | 17 | ||
18 | ``` | 18 | ``` |
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
... | @@ -12,6 +12,7 @@ public class Main{ | ... | @@ -12,6 +12,7 @@ public class Main{ |
12 | TiandituDownload tiandituDownload = new TiandituDownload("my.db"); | 12 | TiandituDownload tiandituDownload = new TiandituDownload("my.db"); |
13 | Point pt = new Point(29.76,106.64); | 13 | Point pt = new Point(29.76,106.64); |
14 | Point pt2 = new Point(35.33, 108.12); | 14 | Point pt2 = new Point(35.33, 108.12); |
15 | tiandituDownload.Download(pt, pt2, 2,9, TianDiTuTiledMapServiceType.VEC_C, true); | 15 | |
16 | tiandituDownload.Download(pt, pt2, 7,9, TianDiTuTiledMapServiceType.VEC_C, true); | ||
16 | } | 17 | } |
17 | } | 18 | } | ... | ... |
... | @@ -16,6 +16,10 @@ import java.sql.*; | ... | @@ -16,6 +16,10 @@ import java.sql.*; |
16 | 16 | ||
17 | public class TiandituDownload { | 17 | public class TiandituDownload { |
18 | 18 | ||
19 | // 级别 | ||
20 | int[] level = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20}; | ||
21 | |||
22 | // 分辨率 | ||
19 | double[] res = { | 23 | double[] res = { |
20 | 1.40625, | 24 | 1.40625, |
21 | 0.703125, | 25 | 0.703125, |
... | @@ -39,6 +43,7 @@ public class TiandituDownload { | ... | @@ -39,6 +43,7 @@ public class TiandituDownload { |
39 | 2.68220901489258E-06, | 43 | 2.68220901489258E-06, |
40 | 1.34110450744629E-06 | 44 | 1.34110450744629E-06 |
41 | }; | 45 | }; |
46 | // 比例尺 | ||
42 | double[] scale = { | 47 | double[] scale = { |
43 | 400000000, | 48 | 400000000, |
44 | 295497598.5708346, | 49 | 295497598.5708346, |
... | @@ -60,69 +65,83 @@ public class TiandituDownload { | ... | @@ -60,69 +65,83 @@ public class TiandituDownload { |
60 | 4508.93552506767, | 65 | 4508.93552506767, |
61 | 2254.467762533835, | 66 | 2254.467762533835, |
62 | 1127.2338812669175, | 67 | 1127.2338812669175, |
63 | 563.616940 | 68 | 563.61694063345875 |
64 | }; | 69 | }; |
65 | 70 | // 最小级别 | |
66 | int minLevel = 1; | 71 | int minLevel = 1; |
72 | |||
73 | // 最大级别 | ||
67 | int maxLevel = 2; | 74 | int maxLevel = 2; |
68 | 75 | ||
69 | // 保存数据的sqlite文件路径 | 76 | // 保存数据的sqlite文件路径 |
70 | String dbpath; | 77 | String dbpath; |
71 | 78 | ||
79 | // SQLite链接 | ||
72 | Connection conn = null; | 80 | Connection conn = null; |
73 | |||
74 | Statement stmt = null; | 81 | Statement stmt = null; |
75 | 82 | ||
76 | public TiandituDownload(String dbpath){ | 83 | public TiandituDownload(String dbpath) { |
77 | this.dbpath =dbpath; | 84 | this.dbpath = dbpath; |
78 | } | 85 | } |
79 | 86 | ||
80 | private CalEnv calculateEnv(Point originPoint, int level){ | 87 | /** |
81 | int startX = (int) Math.floor((originPoint.getLng() + 180)/(256 * res[level])); | 88 | * |
82 | int startY = (int) Math.floor((90 - originPoint.getLat())/(256 * res[level])); | 89 | * @param originPoint 坐标点 |
83 | if(startX<0)startX = 0; | 90 | * @param level 级别 |
84 | if(startY<0)startY = 0; | 91 | * @return 改点在该级别所属的地图瓦片行列号 |
92 | */ | ||
93 | private CalEnv calculateEnv(Point originPoint, int level) { | ||
94 | int startX = (int) Math.floor((originPoint.getLng() + 180) / (256 * res[level])); | ||
95 | int startY = (int) Math.floor((90 - originPoint.getLat()) / (256 * res[level])); | ||
96 | if (startX < 0) startX = 0; | ||
97 | if (startY < 0) startY = 0; | ||
85 | 98 | ||
86 | return new CalEnv(startX, startY); | 99 | return new CalEnv(startX, startY); |
87 | } | 100 | } |
88 | 101 | ||
89 | private void Download(Point minPoint, Point maxPoint, int level, TianDiTuTiledMapServiceType type, boolean merge){ | 102 | /** |
103 | * | ||
104 | * @param minPoint 下载范围左下角坐标 | ||
105 | * @param maxPoint 下载范围右上角坐标 | ||
106 | * @param level 下载级别 | ||
107 | * @param type 下载数据类型 | ||
108 | * @param merge 数据与其注记是否融合 | ||
109 | */ | ||
110 | private void downloadSingLevelTiles(Point minPoint, Point maxPoint, int level, TianDiTuTiledMapServiceType type, boolean merge) { | ||
90 | 111 | ||
91 | try{ | 112 | try { |
92 | CalEnv startEnv = calculateEnv(minPoint, level); | 113 | CalEnv startEnv = calculateEnv(minPoint, level); |
93 | CalEnv stopEnv = calculateEnv(maxPoint, level); | 114 | CalEnv stopEnv = calculateEnv(maxPoint, level); |
94 | 115 | ||
95 | // System.out.println(startEnv.getStartX() + ":" +startEnv.getStartY()); | ||
96 | // System.out.println(stopEnv.getStartX() + ":" +stopEnv.getStartY()); | ||
97 | PreparedStatement preparedStatement; | 116 | PreparedStatement preparedStatement; |
98 | ResultSet rs; | 117 | ResultSet rs; |
99 | 118 | ||
100 | for(int i = startEnv.getStartX(); i <= stopEnv.getStartX(); i++){ | 119 | for (int i = startEnv.getStartCol(); i <= stopEnv.getStartCol(); i++) { |
101 | for(int j = stopEnv.getStartY(); j<= startEnv.getStartY(); j++){ | 120 | for (int j = stopEnv.getStartRow(); j <= startEnv.getStartRow(); j++) { |
102 | boolean hasData = false; | 121 | boolean hasData = false; |
103 | try{ | 122 | try { |
104 | // 查询瓦片是否存在 | 123 | // 查询瓦片是否存在 |
105 | String querySQL = "select * from " + type + " where TILELEVEL = " + level + " and TILECOL = " + i + " and TILEROW = " + j; | 124 | String querySQL = "select * from " + type + " where TILELEVEL = " + level + " and TILECOL = " + i + " and TILEROW = " + j; |
106 | rs = stmt.executeQuery(querySQL); | 125 | rs = stmt.executeQuery(querySQL); |
107 | while(rs.next()){ | 126 | while (rs.next()) { |
108 | hasData = true; | 127 | hasData = true; |
109 | } | 128 | } |
110 | // 如果不存在 | 129 | // 如果不存在则从网络获取 |
111 | if(!hasData){ | 130 | if (!hasData) { |
112 | String url = new TDTUrl(level, i, j, type).generatUrl(); | 131 | String url = new TDTUrl(level, i, j, type).generatUrl(); |
113 | // 获得地图瓦片 | 132 | // 获得地图瓦片数据流 |
114 | byte[] img = getTile(url); | 133 | byte[] img = getTile(url); |
115 | System.out.println("正在下载 "+url); | 134 | System.out.println("正在下载 " + url); |
116 | 135 | ||
117 | // 如果merge为true,则在下载img_c或vec_c时将其注记图片一并下载 | 136 | // 如果merge为true,则在下载img_c或vec_c时将其注记图片一并下载 |
118 | if(merge) { | 137 | if (merge) { |
119 | InputStream img_stream = new ByteArrayInputStream(img); | 138 | InputStream img_stream = new ByteArrayInputStream(img); |
120 | BufferedImage bImageFromConvert = ImageIO.read(img_stream); | 139 | BufferedImage bImageFromConvert = ImageIO.read(img_stream); |
121 | 140 | ||
122 | String url2 = ""; | 141 | String url2 = ""; |
123 | if(type == TianDiTuTiledMapServiceType.IMG_C) { | 142 | if (type == TianDiTuTiledMapServiceType.IMG_C) { |
124 | url2 = new TDTUrl(level, i, j, TianDiTuTiledMapServiceType.CIA_C).generatUrl(); | 143 | url2 = new TDTUrl(level, i, j, TianDiTuTiledMapServiceType.CIA_C).generatUrl(); |
125 | }else{ | 144 | } else { |
126 | url2 = new TDTUrl(level, i, j, TianDiTuTiledMapServiceType.CVA_C).generatUrl(); | 145 | url2 = new TDTUrl(level, i, j, TianDiTuTiledMapServiceType.CVA_C).generatUrl(); |
127 | } | 146 | } |
128 | byte[] img2 = getTile(url2); | 147 | byte[] img2 = getTile(url2); |
... | @@ -140,7 +159,7 @@ public class TiandituDownload { | ... | @@ -140,7 +159,7 @@ public class TiandituDownload { |
140 | baos.close(); | 159 | baos.close(); |
141 | } | 160 | } |
142 | // 将数据写入sqlite | 161 | // 将数据写入sqlite |
143 | String insertSQL = "INSERT INTO "+ type + "(TILELEVEL,TILECOL,TILEROW,TILEDATA) VALUES (?,?,?,?)"; | 162 | String insertSQL = "INSERT INTO " + type + "(TILELEVEL,TILECOL,TILEROW,TILEDATA) VALUES (?,?,?,?)"; |
144 | preparedStatement = conn.prepareStatement(insertSQL); | 163 | preparedStatement = conn.prepareStatement(insertSQL); |
145 | preparedStatement.setInt(1, level); | 164 | preparedStatement.setInt(1, level); |
146 | preparedStatement.setInt(2, i); | 165 | preparedStatement.setInt(2, i); |
... | @@ -148,17 +167,27 @@ public class TiandituDownload { | ... | @@ -148,17 +167,27 @@ public class TiandituDownload { |
148 | preparedStatement.setBytes(4, img); | 167 | preparedStatement.setBytes(4, img); |
149 | preparedStatement.execute(); | 168 | preparedStatement.execute(); |
150 | } | 169 | } |
151 | }catch (Exception e){ | 170 | } catch (Exception e) { |
152 | System.out.println(e.getMessage()); | 171 | System.out.println(e.getMessage()); |
153 | } | 172 | } |
154 | } | 173 | } |
155 | conn.commit(); | 174 | conn.commit(); |
156 | } | 175 | } |
157 | }catch (Exception e){ | 176 | } catch (Exception e) { |
158 | System.out.println(e.getMessage()); | 177 | System.out.println(e.getMessage()); |
159 | } | 178 | } |
160 | } | 179 | } |
161 | 180 | ||
181 | /** | ||
182 | * | ||
183 | * @param minPoint 下载范围左下角坐标 | ||
184 | * @param maxPoint 下载范围右上角坐标 | ||
185 | * @param minLevel 下载最小级别 | ||
186 | * @param maxLevel 下载最大级别 | ||
187 | * @param type 下载数据类型 | ||
188 | * @param merge 数据与其注记是否融合 | ||
189 | * @throws SQLException | ||
190 | */ | ||
162 | public void Download(Point minPoint, Point maxPoint, int minLevel, int maxLevel, TianDiTuTiledMapServiceType type, boolean merge) throws SQLException { | 191 | public void Download(Point minPoint, Point maxPoint, int minLevel, int maxLevel, TianDiTuTiledMapServiceType type, boolean merge) throws SQLException { |
163 | try { | 192 | try { |
164 | Class.forName("org.sqlite.JDBC"); | 193 | Class.forName("org.sqlite.JDBC"); |
... | @@ -174,17 +203,23 @@ public class TiandituDownload { | ... | @@ -174,17 +203,23 @@ public class TiandituDownload { |
174 | stmt.executeUpdate(sql); | 203 | stmt.executeUpdate(sql); |
175 | stmt.close(); | 204 | stmt.close(); |
176 | 205 | ||
177 | for(int m = minLevel; m<= maxLevel; m++){ | 206 | for (int m = minLevel; m <= maxLevel; m++) { |
178 | this.Download(minPoint, maxPoint, m, type, merge); | 207 | this.downloadSingLevelTiles(minPoint, maxPoint, m, type, merge); |
179 | } | 208 | } |
180 | conn.close(); | 209 | conn.close(); |
181 | System.out.println("下载完成"); | 210 | System.out.println("下载完成"); |
182 | 211 | ||
183 | }catch (Exception e){ | 212 | } catch (Exception e) { |
184 | 213 | ||
185 | } | 214 | } |
186 | } | 215 | } |
187 | 216 | ||
217 | /** | ||
218 | * 下载网络数据 | ||
219 | * @param url | ||
220 | * @return 图片数据流 | ||
221 | * @throws Exception | ||
222 | */ | ||
188 | protected byte[] getTile(String url) throws Exception { | 223 | protected byte[] getTile(String url) throws Exception { |
189 | byte[] result = null; | 224 | byte[] result = null; |
190 | try { | 225 | try { | ... | ... |
1 | package utils; | 1 | package utils; |
2 | 2 | ||
3 | /** | ||
4 | * 范围计算后的Row与Col类 | ||
5 | */ | ||
3 | public class CalEnv { | 6 | public class CalEnv { |
4 | 7 | ||
5 | private int startX; | 8 | private int startCol; |
6 | 9 | ||
7 | private int startY; | 10 | private int startRow; |
8 | 11 | ||
9 | public CalEnv(int startX, int startY) { | 12 | public CalEnv(int startX, int startY) { |
10 | this.startX = startX; | 13 | this.startCol = startX; |
11 | this.startY = startY; | 14 | this.startRow = startY; |
12 | } | 15 | } |
13 | 16 | ||
14 | public int getStartX() { | 17 | public int getStartCol() { |
15 | return startX; | 18 | return startCol; |
16 | } | 19 | } |
17 | 20 | ||
18 | public void setStartX(int startX) { | 21 | public void setStartCol(int startCol) { |
19 | this.startX = startX; | 22 | this.startCol = startCol; |
20 | } | 23 | } |
21 | 24 | ||
22 | public int getStartY() { | 25 | public int getStartRow() { |
23 | return startY; | 26 | return startRow; |
24 | } | 27 | } |
25 | 28 | ||
26 | public void setStartY(int startY) { | 29 | public void setStartRow(int startRow) { |
27 | this.startY = startY; | 30 | this.startRow = startRow; |
28 | } | 31 | } |
29 | } | 32 | } | ... | ... |
-
Please register or sign in to post a comment