帮助处理平铺金字塔

tilematrix的Python项目详细描述


TileMatrix处理地理网络平铺和平铺金字塔。

https://badge.fury.io/py/tilematrix.svghttps://travis-ci.org/ungarj/tilematrix.svg?branch=masterhttps://coveralls.io/repos/github/ungarj/tilematrix/badge.svg?branch=masterhttps://img.shields.io/pypi/pyversions/mapchete.svg

模块设计用于在平铺索引(缩放、行、列)和 地图坐标(例如纬度、经度)。

tilematrix支持metatilingtile缓冲区。而且它使 大量使用shapely,它还可以为每个磁贴生成Affine对象 有助于使用rasterio进行基于平铺的数据读写。

它与mercantile非常相似,但除了支撑球形墨卡托 平铺金字塔,它还支持大地测量(WGS84)平铺金字塔。

安装

使用pip安装最新的稳定版本:

pip install tilematrix

手动安装最新的开发版本

pip install -r requirements.txt
python setup.py install

文档

cli

这个包附带了一个命令行工具tmx,它提供了 子命令:

  • bounds:打印给定平铺的边界。
  • bbox:打印给定平铺的边框几何图形。
  • tile:打印瓷砖覆盖指定点。
  • tiles:打印覆盖给定边界的平铺。

几何输出可以格式化为WKTGeoJSON。例如 下面的命令将打印一个有效的GeoJSON,表示所有分幅 对于geodeticwmts网格的缩放级别1:

$ tmx -f GeoJSON tiles -- 1 -180 -90 18090{"type": "FeatureCollection",
  "features": [{"geometry": {"coordinates": [[[-90.0, 0.0], [-90.0, 90.0], [-180.0, 90.0], [-180.0, 0.0], [-90.0, 0.0]]], "type": "Polygon"}, "properties": {"col": 0, "row": 0, "zoom": 1}, "type": "Feature"},
    {"geometry": {"coordinates": [[[0.0, 0.0], [0.0, 90.0], [-90.0, 90.0], [-90.0, 0.0], [0.0, 0.0]]], "type": "Polygon"}, "properties": {"col": 1, "row": 0, "zoom": 1}, "type": "Feature"},
    {"geometry": {"coordinates": [[[90.0, 0.0], [90.0, 90.0], [0.0, 90.0], [0.0, 0.0], [90.0, 0.0]]], "type": "Polygon"}, "properties": {"col": 2, "row": 0, "zoom": 1}, "type": "Feature"},
    {"geometry": {"coordinates": [[[180.0, 0.0], [180.0, 90.0], [90.0, 90.0], [90.0, 0.0], [180.0, 0.0]]], "type": "Polygon"}, "properties": {"col": 3, "row": 0, "zoom": 1}, "type": "Feature"},
    {"geometry": {"coordinates": [[[-90.0, -90.0], [-90.0, 0.0], [-180.0, 0.0], [-180.0, -90.0], [-90.0, -90.0]]], "type": "Polygon"}, "properties": {"col": 0, "row": 1, "zoom": 1}, "type": "Feature"},
    {"geometry": {"coordinates": [[[0.0, -90.0], [0.0, 0.0], [-90.0, 0.0], [-90.0, -90.0], [0.0, -90.0]]], "type": "Polygon"}, "properties": {"col": 1, "row": 1, "zoom": 1}, "type": "Feature"},
    {"geometry": {"coordinates": [[[90.0, -90.0], [90.0, 0.0], [0.0, 0.0], [0.0, -90.0], [90.0, -90.0]]], "type": "Polygon"}, "properties": {"col": 2, "row": 1, "zoom": 1}, "type": "Feature"},
    {"geometry": {"coordinates": [[[180.0, -90.0], [180.0, 0.0], [90.0, 0.0], [90.0, -90.0], [180.0, -90.0]]], "type": "Polygon"}, "properties": {"col": 3, "row": 1, "zoom": 1}, "type": "Feature"}]}

打印WKT平铺表示4 15 23

$ tmx bbox 41523
POLYGON ((90 -90, 90 -78.75, 78.75 -78.75, 78.75 -90, 90 -90))

此外,tiles周围可以有名为pixelbuffer

的缓冲区
$ tmx --pixelbuffer 10 bbox 41523
POLYGON ((90.439453125 -90, 90.439453125 -78.310546875, 78.310546875 -78.310546875, 78.310546875 -90, 90.439453125 -90))

mercator平铺上打印GeoJSON平铺表示4 15 23。 棱锥体:

$ tmx -output_format GeoJSON -grid mercator bbox 41515{"type": "Polygon", "coordinates": [[[20037508.342789203, -20037508.3427892], [20037508.342789203, -17532819.799940553], [17532819.799940553, -17532819.799940553], [17532819.799940553, -20037508.3427892], [20037508.342789203, -20037508.3427892]]]}

许可证

麻省理工学院许可证

版权所有(c)2015、2016、2017 EOX IT Services

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java我的计时器(scheduleAtFixedRate)不循环   如何在Java中实现过滤迭代器?   java如何在不从本地xml、csv文件访问API的情况下将变量发布到php站点?   SuiteClasses语法的Java JUnit类数组   java从URLConnection读取二进制文件   java在Android Studio中发送加密文本时失败   Android:最近最少使用(LRU)算法在java中的实现?   java Selenium WebDriver无法打开Firefox配置文件   java如何处理带有嵌套抽象类的GSON?   java类型通知的方法SetLateStevenInfo(GcmMessageHandler,String,String,PendingContent)未定义   java Apple或Mac Mail会打开所有附件图像,即使它们已嵌入   java如何解析下面的xml代码?   java如何创建特定于API级别的UI(针对平板电脑和Android旧版本的不同UI,针对同一应用)?   servlet的通配符路径?