简体   繁体   English

马普尼克和当地的蒂夫瓷砖

[英]mapnik and local tiff tiles

I have a local directory full of geotiff files which make up a map of the UK. 我在本地目录中充满了geotiff文件,这些文件构成了英国的地图。

I'm using mapnik to render different images at various locations in the UK. 我正在使用mapnik在英国的各个位置渲染不同的图像。

I'm wondering what is the best way to approach this? 我想知道解决这个问题的最佳方法是什么?

I can create a single RasterSymbolizer then loop through the tiff directory and add each tiff as a seperate layer, then use mapniks zoom_to_box to render at the correct location. 我可以创建一个RasterSymbolizer然后遍历tiff目录并将每个tiff添加为单独的图层,然后使用mapniks zoom_to_box在正确的位置进行渲染。

But would this cause the rendering time to be unnecessarily slow? 但这会导致渲染时间不必要地变慢吗? I have no information on how the tiles fit together (other than the data in each individual tiff of course). 我没有关于磁贴如何组合在一起的信息(当然不是每个单独的tiff中的数据)。

I imagine there may be a way to setup some kind of vector file defining the tiff layout so I can quickly query that to find out which tile I need to render for a given bounding box? 我想可能有一种方法可以设置某种矢量文件来定义tiff布局,以便我可以快速查询以找出需要为给定边界框渲染的图块?

You can either generate a big tiff file from the original tiffs with gdal_merge.py (you can find it in the python-gdal package on Debian or Ubuntu) or create a virtual file that mixes them all with gdal_merge-vrt . 您可以使用gdal_merge.py (可以在Debian或Ubuntu的python-gdal包中找到它)从原始tiff生成一个大的tiff文件,也可以创建将它们与gdal_merge-vrt混合在一起的虚拟文件。 This second option saves space but probably is slower. 第二个选项可以节省空间,但速度可能较慢。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM