本文整理匯總了Python中Polygon.write方法的典型用法代碼示例。如果您正苦於以下問題:Python Polygon.write方法的具體用法?Python Polygon.write怎麽用?Python Polygon.write使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Polygon
的用法示例。
在下文中一共展示了Polygon.write方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: sizeTestExample
# 需要導入模塊: import Polygon [as 別名]
# 或者: from Polygon import write [as 別名]
def sizeTestExample():
import pickle
p = Polygon('testpoly.gpf')
p.write('sizetest.gpf')
tlen = len(open('sizetest.gpf', 'r').read())
blen = len(dumpBinary(p))
xlen = len(dumpXML(p))
plen = len(pickle.dumps(p))
print "Text(gpc): %d, Binary: %d, XML: %d, Pickle: %d" % (tlen, blen, xlen, plen)
示例2: str
# 需要導入模塊: import Polygon [as 別名]
# 或者: from Polygon import write [as 別名]
poly_start_1 = 0
poly_start_2 = 0
poly_f = 0
# On déplace le polygone n°5
i=5
x=0
while x<360 :
y=-90
print x
while y<90 :
path_poly_dir = path_BD_f + str(x) + '_' + str(y) + '_to_' + str(x + pas1) + '_' + str(y + pas1)
path_poly_1 = path_poly_dir +'/' + level + str(i) + '.dat'
poly_start_1 = Polygon(path_poly_1)
path_poly_f_dir = path_BD_f +'/'+ str(x) + '_' + str(y) + '_to_' + str(x + pas1) + '_' + str(y + pas1)
path_poly_f = path_poly_f_dir+ '/' + level + str(i) + '.dat'
#print path_poly_f
poly_start_1.write(path_poly_f)
y=y+pas1
x=x+pas1
# On vide la memoire
poly_start_1 = 0