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使用XYDataset(JFreeChart)向XySeries添加双变量值   ApacheJava:如何从远程smtp服务器删除邮件?   从Java API客户端访问HBase   如何使用spring mvc使用@RequestParam捕获多个参数?   java如何修复无效的infinispan数据存储?   java将一个接口扩展到另一个接口   java运行时。getRuntime()。exec()不起作用   java反射式地检查对象是否是方法的有效泛型参数   java如何确保每个jvm只有一个guava service manager实例?   java如何在第一个列表中按另一个列表排序?   java无法验证从属性文件加载的目录   Google PlayStore上HostnameVerifier接口的java Android不安全实现   带有jsch的java Scp文件提供了“意外的文件名”   Tomcat 7中子域上的java缓存控制   eclipse使用AspectJ 1.7安装将AspectJ代码编译为Java 6代码   java H2数据库损坏问题及其大文件大小   java汽车/移动PC平台是否需要基于触摸屏的UI?   java iText:在CellEvent期间设置单元格高度   java如何将列表<Long>中存储的值与长值进行比较?