From 6d3a203fbc8ab8bb8827c08e5e5eafa4f4096096 Mon Sep 17 00:00:00 2001 From: atlasdatatech Date: Thu, 14 Jan 2021 22:25:44 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=B7=E6=AD=8C=E5=9B=BD=E5=86=85=E5=BD=B1?= =?UTF-8?q?=E5=83=8F=E4=B8=8D=E8=83=BD=E7=94=A8=E4=BA=86=EF=BC=8C=20?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=BD=B1=E5=83=8F=E5=9C=B0=E5=9D=80=20?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E8=BE=93=E5=87=BA=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- conf.toml | 8 ++++---- task.go | 7 +++---- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/conf.toml b/conf.toml index 8d105f04..78f167d4 100644 --- a/conf.toml +++ b/conf.toml @@ -8,13 +8,13 @@ directory ="output" [task] #number of fetchers - workers = 100 + workers = 64 #number of savers - savepipe = 1 + savepipe = 4 [tm] #name for mbtiles - name = "streets-v8" + name = "google satelite" #max and min level for mbtiles min = 0 max = 3 @@ -27,7 +27,7 @@ #url is the schema url of tiles # url= "https://api.mapbox.com/v4/mapbox.mapbox-streets-v8/{z}/{x}/{y}.vector.pbf?sku=1016gFniej06a&access_token=pk.eyJ1IjoibWFwYm94IiwiYSI6ImNpejY4M29iazA2Z2gycXA4N2pmbDZmangifQ.-g_vE53SD2WrJ6tFX7QHmA" # url= "https://api.mapbox.com/v4/mapbox.mapbox-terrain-v2/{z}/{x}/{y}.vector.pbf?sku=1016gFniej06a&access_token=pk.eyJ1IjoibWFwYm94IiwiYSI6ImNpejY4M29iazA2Z2gycXA4N2pmbDZmangifQ.-g_vE53SD2WrJ6tFX7QHmA" - url = "http://mt0.google.cn/vt/lyrs=s&x={x}&y={y}&z={z}" + url = "http://mt0.google.com/vt/lyrs=s&x={x}&y={y}&z={z}" #lrs can set diff boundaries for diff levels [[lrs]] min = 0 diff --git a/task.go b/task.go index a1d3387a..2857360d 100644 --- a/task.go +++ b/task.go @@ -289,12 +289,12 @@ func (task *Task) tileFetcher(t maptile.Tile, url string) { task.saveTile(tile) } secs := time.Since(start).Seconds() - fmt.Printf("\ntile %v, %.3fs, %.2f kb, %s ...\n", t, secs, float32(len(body))/1024.0, pbf) + fmt.Printf("tile(z:%d, x:%d, y:%d), %.3fs, %.2f kb, %s ...\n", t.Z, t.X, t.Y, secs, float32(len(body))/1024.0, pbf) } //DownloadZoom 下载指定层级 func (task *Task) downloadLayer(layer Layer) { - bar := pb.New64(layer.Count).Prefix(fmt.Sprintf("Zoom %d : ", layer.Zoom)) + bar := pb.New64(layer.Count).Prefix(fmt.Sprintf("Zoom %d : ", layer.Zoom)).Postfix("\n") // bar.SetRefreshRate(time.Second) bar.Start() // bar.SetMaxWidth(300) @@ -371,8 +371,7 @@ func (task *Task) downloadGeom(geom orb.Geometry, zoom int) { //Download 开启下载任务 func (task *Task) Download() { //g orb.Geometry, minz int, maxz int - task.Bar = pb.New64(task.Total).Prefix("Task : ") - //.Postfix("\n") + task.Bar = pb.New64(task.Total).Prefix("Task : ").Postfix("\n") // task.Bar.SetRefreshRate(10 * time.Second) // task.Bar.Format("<.- >") task.Bar.Start()