如何找到球面墨卡托点

发布于 2025-01-04 21:56:51 字数 280 浏览 3 评论 0原文

我正在使用 Open Street Maps 在 HTML5 应用程序中显示地图。

它对地图图块使用这样的 URL,

http://b.tile.openstreetmap.org/{Z}/{X}/{Y}.png

如果我选择一个区域,例如新西兰奥克兰,我如何计算出覆盖奥克兰的所有 Z、X、Y 值?我希望编写一个脚本来抓取所有这些图像并将它们缓存在 HTML5 数据库中。

I am using Open Street Maps to show a map in my HTML5 application.

It uses a URL like this for the map tiles,

http://b.tile.openstreetmap.org/{Z}/{X}/{Y}.png

If I chose an area, say Auckland, New Zealand, how could I work out all of the values of Z, X, Y that would cover Auckland? I would be looking to write a script to go and grab all those images and cache them in an HTML5 database.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

箹锭⒈辈孓 2025-01-11 21:56:51

首先,请查看有关批量下载的图块使用政策部分。其次,这种缓存可以使用 TileStache 轻松完成:配置缓存以从特定源渲染或获取图块,然后运行 tilestache-seed.py,传入边界框(以 WGS84 坐标表示)和所需的缩放级别,最终您应该得到所有需要的图块。

First of all, take a look at the tile usage policy section about bulk download. Secondly, this sort of caching is easily done using TileStache: configure a cache to render or fetch tiles from a certain source, then run tilestache-seed.py, passing in the bounding box (in WGS84 coordinates) and desired zoom levels, and you should end up with all needed tiles.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文