How to store image tiles in file system for leaflet.js

萝らか妹 提交于 2020-01-15 07:00:08

问题


i got a link which try to explain how to store image tiles in file system but not very clear to me. here is the url http://build-failed.blogspot.in/2012/11/zoomable-image-with-leaflet.html

just see this image

just seen many sub folder has been created as per image but do not understand what they try to point out with arrow images ?

how this eso / «z» / «x» / «y».jpg is related with images folder structure? 1) why zero folder is consider as z ? 2) why zero and one sub folder in parent folder called one is consider as x ? 1) why 0.png and 1.png images are consider as y ?

the above three things is not clear due to lack of explanation. what is the relation there ?

if some one already knows it or do understand then please share the knowledge with me. thanks


回答1:


Ok I'll try to explain.

First z = zoom level, x=longitude, y=latitude

Longitude and latitude are not real value taken from the map projection but grid indexes.

The way you store the tiles is like this:

  1. First parent folder: z (zoom level)
  2. Child folders: all x at this zoom level
  3. Images names: all y at this x position and this zoom level

If you want to store for instance the following tile: /0/0/0.png

  • Folder: 0
  • Subfolder: 0
  • 0.png

At zoom level 0, habitually there is only on tile for the whole world so only a subfolder 0 (for the x) and an image 0.png (for the y). At each zoom level the number of images increase exponentially.

For the /12/6/7.png

  • Folder: 12
  • Subfolder: 6
  • 7.png

Feel free to ask for more details if something is not clear.



来源:https://stackoverflow.com/questions/31880610/how-to-store-image-tiles-in-file-system-for-leaflet-js

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!