本文整理汇总了Python中Block.Block.createAllCAObjects方法的典型用法代码示例。如果您正苦于以下问题:Python Block.createAllCAObjects方法的具体用法?Python Block.createAllCAObjects怎么用?Python Block.createAllCAObjects使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Block.Block
的用法示例。
在下文中一共展示了Block.createAllCAObjects方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: getCAs
# 需要导入模块: from Block import Block [as 别名]
# 或者: from Block.Block import createAllCAObjects [as 别名]
def getCAs():
cas = Block.createAllCAObjects()
ca_bounds = {}
for t, ca in cas.items():
l = list(ca.polygon.exterior.coords)
ca_bounds[t] = l
return jsonify(ca_bounds)
示例2: open
# 需要导入模块: from Block import Block [as 别名]
# 或者: from Block.Block import createAllCAObjects [as 别名]
The raw file is in the ../../../dataset/ChicagoTaxi/2013-dec.txt
We map those trips to CA
"""
from shapely.geometry import Polygon, Point, box
from Block import Block
fraw = '../../dataset/ChicagoTaxi/2013-dec.txt'
if __name__ == '__main__':
cas = Block.createAllCAObjects()
with open(fraw, 'r') as fin, open('data/taxi.txt', 'w') as fout:
header = fin.readline()
for line in fin:
try:
ls = line.split("\t")
trp = []
trp.append( ls[2] ) # travel time
trp.append(ls[7]) # meter on time
pickup = ls[9].replace('"', '')
pc = pickup.split(",")
p = Point( float(pc[1]), float(pc[0]) )