/postile

快速搭建Mapbox pbf服务器 往下翻有中文的说明

Primary LanguagePythonBSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

mapbox:http://www.kingpika.top:3392/mapbox/mapboxstyle.html leaflet:http://www.kingpika.top:3392/leaflet/vectortiles.html maptalks:http://www.kingpika.top:3392/maptalks/demo/

PosTile

Docker image

Fast Mapbox Vector Tile Server

Features

  • serve Mapbox Vector Tiles from a PostGIS backend
  • can read TM2 file data sources with postgis
  • can serve PostGIS layers individually
  • handle on-the-fly reprojection to web mercator projection (only for single layers, not tm2 sources)
  • Connection pooling and asynchronous requests thanks to asyncpg
  • tested with openmaptiles vector tile schema

Requires

  • features stored with PostGIS >= 2.4.0

Installation

Python 3.6 is required to run Postile

pip install cython
pip install -e .
postile --help

Using a Docker container

Start Postile with:

docker run --network host oslandia/postile postile --help

Example of serving postgis layers individually

postile --pguser **** --pgpassword **** --pgdatabase mydb --pghost localhost --listen-port 8080 --cors

Then layer boundaries can be served with:

http://localhost:8080/boundaries/z/x/y.pbf?fields=id,name

fields is optional, and when absent only geometries are encoded in the vector tile.

You can specify schema in this way:

http://localhost:8080/public.xxx/z/x/y.pbf

the default schema is 'public'


For a concrete example using OpenMapTiles schema see this tutorial

——————————中文——————————

前端演示demo

mapbox:http://www.kingpika.top:3392/mapbox/mapboxstyle.html leaflet:http://www.kingpika.top:3392/leaflet/vectortiles.html maptalks:http://www.kingpika.top:3392/maptalks/demo/

PosTile

Docker image

快速搭建postgis瓦片服务(基于mapbox pbf格式)

功能点

环境要求

  • PostGIS版本 >= 2.4.0

安装

需要事先安装Python 3.6

pip install cython
pip install -e .
postile --help

使用docker

使用以下命令启动:

docker run --network host oslandia/postile postile --help

单独指定postgis图层的示例

postile --pguser **** --pgpassword **** --pgdatabase mydb --pghost localhost --listen-port 8080 --cors

如果你有一个图层boundaries ,你可以这样获取它的切片:

http://localhost:8080/boundaries/z/x/y.pbf?fields=id,name

fields是可选的,当不存在时,默认返回所有属性字段。

你可以用以下方式指定schema:

http://localhost:8080/public.xxx/z/x/y.pbf

默认schema是'public'


有关使用OpenMapTiles模式的具体示例,请参阅[本教程](https://github.com/ldgeo/postile-openmaptiles)