帮助处理平铺金字塔

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在循环中使用if语句   Java onthefly字符串替换   安卓 java。util。拉链ZipInputStream在解压过程中部分为空   java检查安卓设备是否支持4K视频?   java如何显示ArrayList<Integer[]>lista=new ArrayList<>()   如何在Java8中将字符流转换为字符串   java序列化ArrayList<Objects>并返回,保留类   java通过复制到webapps手动部署Tomcat应用   java如何将JsonNode转换为映射   java从addOnSuccessListener获取结果   java在泛型类中生成随机数   列表中每个对象的java格式   最新GAE SDK版本(1.9.26)的java MemcacheService增量问题   RESTful服务的java url设计   java Maven可传递依赖公共集合版本3 vs 4   list Java:如何使用try/catch块和return   如何在Eclipse 202012中为Java 14启用预览功能?