https://github.com/mapbox/projectmill的python端口

py-projectmill的Python项目详细描述


https://travis-ci.org/jimr/py-projectmill.png

python 2.5+(包括3.x)的python端口https://github.com/mapbox/projectmill

目前只支持--mill--render

python 2.7、3.2+和pypy-1.9没有任何要求,除非您想运行测试。 要运行测试,只需python setup.py test

文档的其余部分改编自原始项目。


需要生成一组几乎相同的tilemil项目 然后把它们都渲染出来?写什么剧本?我们查到了。

用法:projectmill <command> [options]

示例:projectmill --mill-c config.example.json -t../tilemill/

安装

最简单的方法就是pip install py-projectmill

从源安装:pip install -e .python setup.py install。 如果您使用的是python 2.5、2.6、3.0或3.1,则还需要pip install -rrequirements-X.Y.txt(它们不包括argparse,这是必需的,而2.5需要simplejson)。

测试通过了2.5-3.3和pypy-1.9的所有版本,所以它应该对每个人都有效。

配置

配置应该是一个json文件,其中包含一个数组作为根 目标有关示例,请参见config.example.json。数组中的每个元素 应该是具有以下键的对象:

source        REQUIRED The source project, generally the name of folder it
              lives in.

destination   REQUIRED The destination project name.

mml           A json snippet which will be merged on top of the project's mml
              file. To clear out an option set it to 'null'

cartoVars     A json object containing key value pairs which can be use to
              override variables in in carto stylesheets.

MBmeta        MBTiles: A json object containing key value pairs which will be added to
              a rendered MBtiles export.

Additionally, the following options will be passed to TileMill's export commnd

format        Export format (png|pdf|svg|mbtiles). (Default: undefined)

bbox          Array containing coordinates of bounding box to export. (Default: undefined)

minzoom       MBTiles: minimum zoom level to export. (Default: undefined)

maxzoom       MBTiles: maximum zoom level to export. (Default: undefined)

width         Image: image width in pixels. (Default: 400)

height        Image: image height in pixels. (Default: 400)

bufferSize    Mapnik render buffer size. (Default: 128)

命令

projectmill接受以下命令。它们也可以发行 单独或一起:

--mill      Generates new tilemill projects based on configuration.

--render    Renders projects that are present in configuration and have been milled.

--upload    Uploads projects that are present in configuration and have been rendered.

选项

我们还接受以下选项:

-t      Path to the TileMill install

-c      specify a configuration file. (Defaults: ./config.json)

-p      Path to TileMill project folder. (Defaults: ~/Documents/Mapbox)

-f      Replace existing projects (together with mill) or existing projects and exports (together with render).

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

推荐PyPI第三方库


热门话题
java如何用新列表替换ListView的列表   swing Java JFrame布局   java JNativehook未捕获密码   java JPA仅获取一级关联   java KeyListener是否停止使用动作或鼠标Listener?   shell如何在Ubuntu中安装java   java如何通过使用会话检索数据来跳过空值。冬眠   java如何在jsp中获取列表   java Android仅在位置(0,0)上缩放,而不是在整个图像上缩放   Java for循环格式化控制台   协议缓冲区Protobuf Java不区分大小写映射?   java模拟对象,并将它们分配给方法中的实例和静态变量   java是否可以在执行时看到对对象的所有引用?   wcf Java客户端和InstanceContextMode   java我在XMLGregorianCalendar中的“20170526T04:08:00.000+05:30”中有一个日期,我需要将其转换为20170526T04:08:00.000z   java如何让两个小程序共享字段   java保留CSS注释而不修改YUI压缩器中的内容   java Android(Kotlin)具有非字符串基元类型的双向数据绑定   Java swing:warning组合框是原始类型。对泛型类型JComboBox<E>的引用应参数化