天道酬勤

博观而约取,厚积而薄发!
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

Download google china maps by MapTileFE

Posted on 2010-04-29 21:31  Happy Coding  阅读(818)  评论(0编辑  收藏  举报

#1: Download google china maps by MapTileFE Author: ansonsyc PostPosted: Fri Jan 09, 2009 5:51 am
    —
Can anyone tell me how to keep download the google china map?
I can download others google maps, but need to change my PC ip address every 5mins. Otherwise, its not workable.

But I tired many times to download google china map but failed. Kindly please advise any way for me.


Thanks a lot~~!


#2: The MapTileCacher.perl need to be updated for GoogleChina Author: miles PostPosted: Sat Apr 25, 2009 1:06 pm
    —
The google china (ditu.google.cn) have upgraded their service interface. And the request parameter format have also been changed.
You may use the attached file to replace the official MapTileCacher.perl. It is based on the Map Tile Cacher v1.36. Just replace the original file, prepare your map define file and start download. I haven't meet download limitation when use GoogleChina map type.
If you want to update the MapTileCacher.perl file yourself, here is the instruction. The change is simple. Just find the line in the original perl file:

Code:
    $url = "http://mt" . (($x+$y)&3) . ".google.cn/mt/v=cn1.6&hl=en&x=$x&y=$y&z=$zoomLevel";


and replace it to

Code:
    $url = "http://mt" . (($x+$y)&3) . ".google.cn/mt?v=cn1.7&hl=zh_CN&x=$x&y=$y&z=$zoomLevel";




MapTileCacher.perl
 Description:

Download
 Filename:  MapTileCacher.perl
 Filesize:  21.39 KB
 Downloaded:  244 Time(s)



#3: Re: The MapTileCacher.perl need to be updated for GoogleChin Author: fenglian38 PostPosted: Mon May 18, 2009 2:57 am
    —

miles wrote:
The google china (ditu.google.cn) have upgraded their service interface. And the request parameter format have also been changed.
You may use the attached file to replace the official MapTileCacher.perl. It is based on the Map Tile Cacher v1.36. Just replace the original file, prepare your map define file and start download. I haven't meet download limitation when use GoogleChina map type.
If you want to update the MapTileCacher.perl file yourself, here is the instruction. The change is simple. Just find the line in the original perl file:
Code:
    $url = "http://mt" . (($x+$y)&3) . ".google.cn/mt/v=cn1.6&hl=en&x=$x&y=$y&z=$zoomLevel";

and replace it to
Code:
    $url = "http://mt" . (($x+$y)&3) . ".google.cn/mt?v=cn1.7&hl=zh_CN&x=$x&y=$y&z=$zoomLevel";



I am using gmapmaker 0.7.2.2. Could you please instruct me how to modify the gmapmaker.exe.config file to reflect your modifications? Thanks.


#4: Re: The MapTileCacher.perl need to be updated for GoogleChin Author: cell35 PostPosted: Sun May 31, 2009 7:41 pm
    —

miles wrote:
The google china (ditu.google.cn) have upgraded their service interface. And the request parameter format have also been changed.
You may use the attached file to replace the official MapTileCacher.perl. It is based on the Map Tile Cacher v1.36. Just replace the original file, prepare your map define file and start download. I haven't meet download limitation when use GoogleChina map type.
If you want to update the MapTileCacher.perl file yourself, here is the instruction. The change is simple. Just find the line in the original perl file:
Code:
    $url = "http://mt" . (($x+$y)&3) . ".google.cn/mt/v=cn1.6&hl=en&x=$x&y=$y&z=$zoomLevel";

and replace it to
Code:
    $url = "http://mt" . (($x+$y)&3) . ".google.cn/mt?v=cn1.7&hl=zh_CN&x=$x&y=$y&z=$zoomLevel";



I run your latest MapTileCacher.perl, but still didn't work for me. Here is the error message:

* Downloading tile 1 of 4 from http://mt1.google.cn/mt?v=cn1.7&hl=zh_CN&x=842&y=387&z=10
http://mt1.google.cn/mt?v=cn1.7&hl=zh_CN&x=842&y=387&z=10:
11:14:26 ERROR 404: Not Found.
ERROR: Requested tile did not exist.

The same script works fine with US maps. Any idea why?


#5: Re: The MapTileCacher.perl need to be updated for GoogleChin Author: Cristian Streng PostPosted: Sun May 31, 2009 8:05 pm
    —

cell35 wrote:
miles wrote:
The google china (ditu.google.cn) have upgraded their service interface. And the request parameter format have also been changed.
You may use the attached file to replace the official MapTileCacher.perl. It is based on the Map Tile Cacher v1.36. Just replace the original file, prepare your map define file and start download. I haven't meet download limitation when use GoogleChina map type.
If you want to update the MapTileCacher.perl file yourself, here is the instruction. The change is simple. Just find the line in the original perl file:
Code:
    $url = "http://mt" . (($x+$y)&3) . ".google.cn/mt/v=cn1.6&hl=en&x=$x&y=$y&z=$zoomLevel";

and replace it to
Code:
    $url = "http://mt" . (($x+$y)&3) . ".google.cn/mt?v=cn1.7&hl=zh_CN&x=$x&y=$y&z=$zoomLevel";


I run your latest MapTileCacher.perl, but still didn't work for me. Here is the error message:

* Downloading tile 1 of 4 from http://mt1.google.cn/mt?v=cn1.7&hl=zh_CN&x=842&y=387&z=10
http://mt1.google.cn/mt?v=cn1.7&hl=zh_CN&x=842&y=387&z=10:
11:14:26 ERROR 404: Not Found.
ERROR: Requested tile did not exist.

The same script works fine with US maps. Any idea why?


Try cn1.11 instead of cn1.7, they are changing versions quickly. I mean

Code:
    $url = "http://mt" . (($x+$y)&3) . ".google.cn/mt?v=cn1.11&hl=zh_CN&x=$x&y=$y&z=$zoomLevel";


#6: Re: The MapTileCacher.perl need to be updated for GoogleChin Author: cell35 PostPosted: Mon Jun 01, 2009 2:06 am
    —

Cristian Streng wrote:
cell35 wrote:
miles wrote:
The google china (ditu.google.cn) have upgraded their service interface. And the request parameter format have also been changed.
You may use the attached file to replace the official MapTileCacher.perl. It is based on the Map Tile Cacher v1.36. Just replace the original file, prepare your map define file and start download. I haven't meet download limitation when use GoogleChina map type.
If you want to update the MapTileCacher.perl file yourself, here is the instruction. The change is simple. Just find the line in the original perl file:
Code:
    $url = "http://mt" . (($x+$y)&3) . ".google.cn/mt/v=cn1.6&hl=en&x=$x&y=$y&z=$zoomLevel";

and replace it to
Code:
    $url = "http://mt" . (($x+$y)&3) . ".google.cn/mt?v=cn1.7&hl=zh_CN&x=$x&y=$y&z=$zoomLevel";


I run your latest MapTileCacher.perl, but still didn't work for me. Here is the error message:

* Downloading tile 1 of 4 from http://mt1.google.cn/mt?v=cn1.7&hl=zh_CN&x=842&y=387&z=10
http://mt1.google.cn/mt?v=cn1.7&hl=zh_CN&x=842&y=387&z=10:
11:14:26 ERROR 404: Not Found.
ERROR: Requested tile did not exist.

The same script works fine with US maps. Any idea why?

Try cn1.11 instead of cn1.7, they are changing versions quickly. I mean
Code:
    $url = "http://mt" . (($x+$y)&3) . ".google.cn/mt?v=cn1.11&hl=zh_CN&x=$x&y=$y&z=$zoomLevel";



Thank you Cristian, the version 1.11 works now.


#7: For gmapmaker users Author: miles PostPosted: Sat Jun 20, 2009 6:07 pm
    —
For gmapmaker users:
You need to edit the gmapmaker.exe.config file accompany with the gmakmaker executable.
Find this line

Code:
               <value>http://mapgoogle.mapabc.com/googlechina/maptile?v=w2.70&amp;x={X}&amp;y={Y}&amp;zoom={ZOOM}</value>


and replace it with

Code:

<value>http://mt{GOOG_DIGIT}.google.cn/mt/v=cn1.11&amp;hl=zh-CN&amp;gl=cn&amp;x={X}&amp;y={Y}&amp;z={ZOOM}&amp;s={GALILEO}</value>


Note google map China update its service quite frequently. It takes only 2 month to upgrade from cn1.7 to cn1.11.
I'll describe how to figure out the suitable url yourself in case of previous modification will soon be outdated. It isn't a so difficult DIY Razz
My suggestion is install Firebug plugin into Firefox. Use Firefox to access google maps China. http://ditu.google.cn. When the google map is displayed, just open the Firebug panel, select 'Net' tab, you will find a lot of downloaded tiles (just hover on the GET request, you will see the url and 256X256 map tile thumbnail). Right click and select "Copy Location". The url will be sent to clipboard. Paste the url into your gmapmaker.exe.config editor window and start modify! The url should like this:

Code:
http://mt0.google.cn/mt/v=cn1.11&hl=zh-CN&gl=cn&x=27436&s=&y=13400&z=15&s=Gali


Just change every "&" into "&amp;" (in XML preferred style), and replace the fixed parts into dynamic macros, please refer to the previous example.[/url]