在python中运行tile reduce映射作业
tilereduce的Python项目详细描述
tile reduce
==
编写[tile reduce]的框架(https://github.com/mapbox/tile reduce)
在python中映射脚本。
尚未创建正式的
版本。
用法
----
请首先阅读[tile reduce]上的文档(https://github.com/mapbox/tile reduce)。
`tile reduce py`允许您用python编写映射脚本。减速机仍然是javascript。
```
import mapbox_vector_tile
import tilereduce
class buildingroadcount(tilereduce.tr):
def mapper(self,x,y,zoom,数据:
如果数据为无:
返回0
解码原始二进制协议缓冲区数据
td=mapbox_vector_tile.decoder.tile data(2048)
tile=td.getMessage(数据)
count=0
如果tile.get('buildings'):
count+=len(tile['buildings'])
如果tile.get('roads'):
count+=len(tile['roads'])
==
编写[tile reduce]的框架(https://github.com/mapbox/tile reduce)
在python中映射脚本。
尚未创建正式的
版本。
用法
----
请首先阅读[tile reduce]上的文档(https://github.com/mapbox/tile reduce)。
`tile reduce py`允许您用python编写映射脚本。减速机仍然是javascript。
```
import mapbox_vector_tile
import tilereduce
class buildingroadcount(tilereduce.tr):
def mapper(self,x,y,zoom,数据:
如果数据为无:
返回0
解码原始二进制协议缓冲区数据
td=mapbox_vector_tile.decoder.tile data(2048)
tile=td.getMessage(数据)
count=0
如果tile.get('buildings'):
count+=len(tile['buildings'])
如果tile.get('roads'):
count+=len(tile['roads'])