构建和使用地图瓦片网格(也称为TileMatrixSet / TMS)。
项目描述
Morecantile
构建和使用地图瓦片网格(也称为TileMatrixSet / TMS)。
文档: https://developmentseed.org/morecantile/
源代码: https://github.com/developmentseed/morecantile
Morecantile类似于mercantile(处理Web Mercator瓦片索引的最佳工具),但支持其他TileMatrixSet网格。
Morecantile遵循在https://docs.ogc.org/is/17-083r4/17-083r4.html中找到的OGC二维瓦片矩阵集规范2.0。
Morecantile版本 | OGC规范版本 | 链接 |
---|---|---|
>=4.0 | 2.0 | https://docs.ogc.org/is/17-083r4/17-083r4.html |
=<3.0 | 1.0 | http://docs.opengeospatial.org/is/17-083r2/17-083r2.html |
安装
$ python -m pip install -U pip
$ python -m pip install morecantile
# Or install from source:
$ python -m pip install -U pip
$ python -m pip install git+https://github.com/developmentseed/morecantile.git
使用方法
import morecantile
tms = morecantile.tms.get("WebMercatorQuad")
# Get TMS bounding box
print(tms.xy_bbox)
>>> BoundingBox(
left=-20037508.342789244,
bottom=-20037508.34278919,
right=20037508.34278919,
top=20037508.342789244,
)
# Get the bounds for tile Z=4, X=10, Y=10 in the TMS's CRS (e.g epsg:3857)
print(tms.xy_bounds(morecantile.Tile(10, 10, 4)))
>>> BoundingBox(
left=5009377.085697308,
bottom=-7514065.628545959,
right=7514065.628545959,
top=-5009377.085697308,
)
# Get the bounds for tile Z=4, X=10, Y=10 in Geographic CRS (e.g epsg:4326)
print(tms.bounds(morecantile.Tile(10, 10, 4)))
>>> BoundingBox(
left=44.999999999999964,
bottom=-55.776573018667634,
right=67.4999999999999,
top=-40.97989806962009,
)
更多信息可以在https://developmentseed.org/morecantile/usage/找到。
默认网格
morecantile
提供了一组默认的TileMatrixSets
- CDB1GlobalGrid *:CDB 1 全球网格 - EPGS:4326 (WGS84)
- 加拿大NAD83_LCC:加拿大NAD83的Lambert正形圆锥 - EPSG:3978
- 欧洲ETRS89_LAEAQuad:扩展的ETRS89 / LAEA欧洲 - EPGS:3035
- GNOSISGlobalGrid *:GNOSIS全球网格 - EPGS:4326 (WGS84)
- LINZAntarticaMapTilegrid:LINZ南极地图瓦片网格(罗斯海地区) - EPSG:5482
- NZTM2000Quad:LINZ NZTM2000 地图瓦片网格 - EPSG:2193
- UPSAntarcticWGS84Quad:南极WGS 84通用极射赤面投影 - EPSG:5042
- UPSArcticWGS84Quad:北极WGS 84通用极射赤面投影 - EPSG:5041
- UTM31WGS84Quad:UTM网格的示例 - EPSG:32631
- WebMercatorQuad:球面墨卡托 - EPGS:3857(基于Web Mercator的地图的默认网格)
- WGS1984Quad:全球的EPSG:4326 - EPGS:4326 (WGS84)
- WorldCRS84Quad:全球的CRS84
- WorldMercatorWGS84Quad:椭圆墨卡托投影 - EPGS:3395
* 具有可变矩阵宽度的TileMatrixSets(请参阅 https://docs.ogc.org/is/17-083r4/17-083r4.html#toc15)
参考:https://schemas.opengis.net/tms/2.0/json/examples/tilematrixset/
实现
- rio-tiler:使用Morecantile TMS从栅格创建瓦片。
- titiler:基于FastAPI和Rasterio/GDAL的现代动态瓦片服务器。
- tipg:OGC功能瓦片API。
- planetcantile:其他行星的瓦片矩阵集。
- supermorecado:使用附加命令扩展morecantile的功能。
变更
请参阅 CHANGES.md。
贡献与发展
请参阅 CONTRIBUTING.md
许可证
请参阅 LICENSE
作者
由 Development Seed 创建
项目详情
下载文件
下载您平台对应的文件。如果您不确定选择哪个,请了解有关安装包的更多信息。
源分布
morecantile-5.4.2.tar.gz (43.8 kB 查看哈希值)
构建分布
morecantile-5.4.2-py3-none-any.whl (49.4 kB 查看哈希值)