的第一个和最后一个项目我有过期OSM Tilenames这个排序列表从CSV文件:Python-获取序列
15,17485,11075
15,17485,11076
15,17485,11077
15,17485,11078
15,17485,11079
15,17485,11080
15,17486,11068
15,17486,11069
15,17486,11070
15,17486,11071
15,17486,11072
15,17486,11073
15,17486,11074
15,17486,11075
15,17486,11076
15,17486,11077
15,17486,11078
15,17486,11079
15,17486,11080
15,17487,11068
15,17487,11069
15,17487,11070
15,17487,11071
15,17487,11072
15,17487,11073
15,17487,11074
15,17487,11075
15,17487,11076
15,17487,11077
15,17487,11078
15,17487,11079
我想每个序列的第一个和最后一个项目,在第三列和第二列的相应条目中创建一个用mapnik进行渲染的边界框。我不想使用mod_tile。
我没有问题与第二列提取:
for x_idx, row in enumerate(zoom_15):
this_Xelement = row
next_Xelement = zoom_15[(x_idx + 1) % len(zoom_15)]
X = int(next_Xelement[1]) - int(this_Xelement[1])
x_start = 0
x_end = 0
y_end = 0
y_start = int(this_Xelement[2])
if X == 0:
continue
elif X == 1:
x_start = int(this_Xelement[1])
x_end = int(next_Xelement[1])
elif X < 0:
x_start = int(this_Xelement[1])
x_end = int(this_Xelement[1]) + 1
elif X > 1:
x_start = int(this_Xelement[1])
x_end = int(this_Xelement[1]) + 1
print (x_start, x_end)
print "++++++++++++++++"
创建像一些输出:
但我不能让第三列重复右键,以获得BB的正确坐标。 Im'working关于Python 2.7
更新:
我想everey序列在它的第一个和最后一个条目。 做出来的这个:
15,17485,11075
15,17485,11076
15,17485,11077
15,17485,11078
15,17485,11079
15,17485,11080
我想:
17485,11075
17485,11080