Google maps tile URL Address Resolution

Source: Internet
Author: User

The projection method of Google map slices and the index mechanism of tiles

1. Map projection

Google Maps uses a web Mercator projection (such as), in order to conveniently ignore the regions with large polar deformation, the world map is made into a square with a side length equal to the equator circumference (the equator length is 6378137 meters), the origin in the center of the square, that is, longitude and latitude (0,0). The value of the x, Y coordinates of the Web Mercator projection is: [ -20037508.3427892,20037508.3427892], the corresponding longitude value range is [-180,180], the corresponding latitude range is [- 85.05112877980659,85.05112877980659]. For specific projection explanations, refer to Mercator projection:

2. Tile indexing mechanism

The index mechanism of Google maps is a variant of the TMS (Tile map Service) specification whose map tiles are indexed:

Google Tile coordinate system: The Earth is projected after the formation of a square divided into 2 levels (zoom level) power map tiles, the origin in the upper left corner, similar to the pixel coordinate system; see the Google Maps API documentation for detailed explanations.

TMS Tile coordinate system: TMS is the same as Google's map tile cutting method, unlike the TMS origin in the lower left corner.

Conversion relationship: TMS and Google coordinate system x, z are equal, Y's conversion relationship is: Y (TMS) + Y (Google) = Math.pow (2,zoom)-1

Note: About projection and tile indexing mechanism highly recommended read: Tilesàla Google maps:coordinates, Tile Bounds and Projection, this paper analyzes in detail the map tiles involved in various types of coordinate transformation relations and specific algorithms, Includes tile coordinates (Google, TMS, Bing quadtree), pixel coordinates, WGS84 latitude and longitude, Mercator projection plane coordinates, and more.

3. The resolution of the map zoom level is related to the map scale

The resolution of the Map zoom level (Resolution) refers to the actual distance represented by each pixel at a zoom level;

Map scale, which refers to the actual distance represented by one meter on a zoom level chart;

By default, the screen resolution is the  algorithm:  dpi= +, which means 96 pixels per inch, 1 inches =2. 54 cm.  the relationship between scale and resolution: scales=Resolutionx  number of pixels per metre= Resolutionx (* +)/2.54 = scale* 2.54/(* +)     
Second, Google Map tile address analysis

1. Open the Google Maps interface using Google Chrome and press F12 to open the developer tools, such as:

Visible from the URL address on the left side of the picture, as long as the four parameters in the address (x, Y, Z, s) are correctly parsed, the map tiles can be obtained.

Here is my analysis of ideas:

1. Meaning of four parameters (x, Y, Z, s):

X, y is the coordinate value of the tile coordinate system, Z represents the zoom level, and S has a total of eight characters: a null character and a Galileo of seven characters.

x, y values increment by series when z increases, while the value of S is probably an index value from 0 to 7 after the combination of x, y, and z three parameters.

X, y, Z combined with 8 to obtain the value of S.

2. The relationship of four parameters:
    • When x = 0 o'clock, y increases by 1 o'clock, s increases by 1, regardless of Z-value.
    • When y = 0 o'clock, x increases by 1 o'clock, s increases by 3, regardless of Z-value.
    • From the above two can be concluded that x, Y is likely to be 3*x + y combination, and then with 8 to obtain the remainder of S.
The formula is: (3*x + y)%8 = s 3. Validation then extracts several addresses, taking X, Y, and S into the second step of the speculative formula validation, sure enough. Then how to toss these tile address to see you. Image maps are just different prefixes. It seems that in the future no longer to find the right Google map Downloader toss, you understand! 4. Meaning of several other parameters 1) Google maps uses four service addresses, HTTP://MT (0-3). google.cn/..., all can be used drip. Map: http://mt2.google.cn/vt/[email protected]&hl=zh-CN&gl=cn&src=app& ... Image basemap: http://mt3.google.cn/vt/[email protected]&hl=zh-CN&gl=cn&src=app& ... Overlay of Imagery:http://mt1.google.cn/vt/imgtp=png32&[email protected]&hl=zh-CN&gl=cn&src=app& ...

2) The lyrs in the URL address represents the layer type, that is, the tile type, with the following meanings:

Map tile type Verification, directly modify the value of the lyrs parameter can: http://mt2.google.cn/vt/[email protected]&hl=zh-cn&gl=cn&src=app &x=214130&y=114212&z=18&s=ga

M: Roadmap  T: Topographic map  P: Tagged topographic map  s: satellite map  y: Tagged satellite graph  h: Label Layer (road, place name, etc.)  

3) "&s= ..." is not found at the moment. , the URL has no subsequent prefix does not affect the tile address access.

Extended reading:

1. Mercator projection of latitude and longitude and plane coordinate conversion formula

PostScript: This article only provides a method, Google map slicing address algorithm and prefix may be constantly adjusted.

Third, gmap.net

Gmap.net-great Maps for Windows Forms & Presentation

A very powerful open source map project (version WinForm), the algorithm for parsing map services such as Google is pretty good.

Gmap.net is great and powerful, free, cross platform, open source. NET control.

Enable use routing, geocoding, directions and maps from Coogle, Yahoo!, Bing, OpenStreetMap, ArcGIS, Pergo, Sigpac, Yandex , mapy.cz, maps.lt, ikarte.lv, Nearmap, Ovimap, Cloudmade, Wikimapia in Windows Forms & Presentation, supports caching and runs on Windows mobile!

Original link: Google maps tile URL Address Resolution

Google maps tile URL Address Resolution

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.