如何在不指定缩放级别(或LevelOfDetails)的情况下获得Tile Count,Tile X,Tile Y细节? [英] How can I get Tile Count, Tile X, Tile Y details without specifying zoom Level (or LevelOfDetails)?

查看:127
本文介绍了如何在不指定缩放级别(或LevelOfDetails)的情况下获得Tile Count,Tile X,Tile Y细节?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是参考Google Tile Map或Bing Maps。是否可以通过任何类型的内部计算得到Tile Count,Tile X,Tile Y细节而不指定缩放级别(或LevelOfDetails)?



客户端只给出坐标P1和P2,并要求瓷砖地图和绑定框等。

Shilpa

解决方案 div>

每个图块都是256像素×256像素。



缩放级别0是1个图块。 (1 x 1)

缩放级别1是4个图块。 (2 x 2)

缩放级别2是16个图块。 (4 x 4)

缩放级别3是64个图块。 (8 x 8)

缩放级别4是256个图块(16 x 16)



x和y每个缩放级别的计数都加倍。根据88ad的评论,瓷砖数量的公式是(2 ^ zoom x 2 ^ zoom)。



我希望你可以通过缩放级别18来完成剩余的数学运算。为了节省空间,不会存储海洋图块。



缩放级别为3时,方块在x方向(经度)上的编号从0到7,编号从0在y方向(纬度)为7。



这些图块开始于接近国际日期线(经度-180或+180)的美国一侧。瓦片0,0从北纬70左右开始。



请参阅维基百科文章墨卡托投影了解更多关于球体如何映射到平面的细节。将经度和纬度转换为x和y坐标的计算在Wikipedia文章中。

您可以将墨卡托投影中的任意点映射到拼贴集。平铺集是缩放级别的平铺集。您必须知道缩放级别才能知道要访问哪个图块并计算要设置为检索并显示的图块中的哪个图块。



此博客文章 Google Mapping ,给出了将(纬度,经度,缩放)转换为(x,y, zoom),其中x和y表示缩放设置中的图块。


This is with reference to Google Tile Map or Bing Maps. Is it possible to get Tile Count, Tile X, Tile Y details without specifying zoom Level (or LevelOfDetails) with any kind of internal calculations?

Client will give just Coordinates P1 and P2 and ask for a Tile Map and Bound Box, etc.

Shilpa

解决方案

Each tile is 256 pixels by 256 pixels.

Zoom level 0 is 1 tile. (1 x 1)

Zoom level 1 is 4 tiles. (2 x 2)

Zoom level 2 is 16 tiles. (4 x 4)

Zoom level 3 is 64 tiles. (8 x 8)

Zoom level 4 is 256 tiles (16 x 16)

The x and y counts are doubled for each zoom level. Per 88ad's comment, the formula for the number of tiles is (2^zoom x 2^zoom).

I hope you can do the rest of the math through zoom level 18. To save space, ocean tiles aren't stored. They're created as a response to the request.

At zoom level 3, the tiles are numbered from 0 to 7 in the x direction (longitude) and numbered from 0 to 7 in the y direction (latitude).

The tiles start on the American side of near the International Date Line (longitude -180 or +180). The tile 0,0 starts at about latitude 70 north.

See the Wikipedia article Mercator Projection for more details about how a sphere is mapped to a plane. The calculations for converting longitude and latitude to x and y coordinates are in the Wikipedia article.

You can map any point on the Mercator Projection to a tile set. A tile set is the set of tiles at a zoom level. You have to know the zoom level to know which tile set to access and to calculate which tile in the tile set to retrieve and display.

This blog post, Google Mapping, gives the formula for converting (latitude, longitude, zoom) to (x, y, zoom), where x and y represent the tile from the zoom set.

这篇关于如何在不指定缩放级别(或LevelOfDetails)的情况下获得Tile Count,Tile X,Tile Y细节?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆