开发者

Why have these Google Satellite map tile links stopped working?

开发者 https://www.devze.com 2023-03-31 10:30 出处:网络
A while back, my android map app stopped getting Google Satellite tiles. Now that it\'s moved up to being the most important issue, I\'ve traced the code and found that it creates requests like this o

A while back, my android map app stopped getting Google Satellite tiles. Now that it's moved up to being the most important issue, I've traced the code and found that it creates requests like this one:

http://khm3.google.com/kh/v=65&x=30147&y=19664&z=15&s=

开发者_如何学编程

Following the link showed it was broken. The guy who wrote the code was the only one to work on the app before me, left before I was employed, and documented nothing. I have no idea what this link is supposed to do, as I can't find it in the Google Map Api, even the deprecated versions. Does anyone have any idea what this link used to connect to, why it no longer works, and how to go about fixing it?


khm3.google.com/kh/ is a link to the Google satellite tiles. Each tile is 256 pixels by 256 pixels.

I'm guessing the v parameter is a version number. The higher the version number, the more recent the satellite images. The highest valid version number as I'm typing this is 104. Google is only going to keep so many versions of these tiles.

The x and y parameters are the x and y location of the tile on the earth. 0, 0 starts at approximately 80 degrees of latitude north, at the international date line west. x increments to the east, and y increments to the south in a Mercator projection.

The z parameter is a level parameter that ranges from 10 to 15.

  • Level 10 has a set of 1024 x 1024 tiles.
  • Level 11 has a set of 2048 x 2048 tiles.
  • Level 12 has a set of 4096 x 4096 tiles.
  • Level 13 has a set of 8192 x 8192 tiles.
  • Level 14 has a set of 16384 x 16384 tiles.
  • Level 15 has a set of 32768 x 32768 tiles.

To see the scales of these levels, you can look at this Open Street Map text file. For example, level 15 is 17,061 meters per pixel.

It appears that x and y are normalized for a given level. If you specify an x or a y greater than 1024 at level 10, you get the tile that's x % 1024 (remainder) or y % 1024.

This Slippery Map Tiles link gives you the formulas to convert from latitude / longitude to tile number, and tile number to latitude / longitude.

This link is undocumented and unsupported by Google. It could change at any time.


I've discovered the answer on my own. The v parameter is, I guess, a version number or something. I increased it to 90 and it worked again. I still can't find documentation on this thing, though, so I'm concerned that the app will have to be manually updated and recompiled whenever that number changes.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号