本文整理匯總了Python中Polygon.id方法的典型用法代碼示例。如果您正苦於以下問題:Python Polygon.id方法的具體用法?Python Polygon.id怎麽用?Python Polygon.id使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Polygon
的用法示例。
在下文中一共展示了Polygon.id方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: enumerate
# 需要導入模塊: import Polygon [as 別名]
# 或者: from Polygon import id [as 別名]
for i, t in enumerate(tiles):
percent = abs(round((i / len(tiles) * 100), 0))
printStatus("%d%%" % percent)
t.parsed = json.loads(t.data)
# for each building
buildings = t.parsed["buildings"]["features"]
for b in buildings:
# buildingcount += 1
# make a list of all the contours in the jpoly
contours = b["geometry"]["coordinates"]
# new Polygon object
poly = Polygon()
poly.id = b["properties"]["id"]
# for each contour in the jpoly
for c in contours:
# remove last redundant coordinate from each contour
# (Tangram doesn't like this - it needs the last coordinate
# to draw the last face properly)
# del c[-1]
# for each vertex
# for v in c:
# offset all verts in tile to arrange in scenespace
# this isn't necessary when the data is coming straight from the json,
# only when the data is coming from a tangram vbo
# v = [v[0]+(4096*(tilemax[0]-tile.x)), v[1]+(4096*(tilemax[1]-tile.y))]