python shp 파일 설치
설치 : sudo pip install pyshp
테스트
sf = shapefile.Reader(path+fname)
shapes = sf.shapes()
print "file len : "+ str(len(shapes))
bbox = shapes[0].bbox
print "bbox value : "
print ['%.3f' % coord for coord in bbox]
print "points len :"+str(len(shapes[0].points))
for index in range(0,100) :
shape = shapes[0].points[index]
#print "point value : 0"
print ['%.3f' % coord for coord in shape]
테스트
sf = shapefile.Reader(path+fname)
shapes = sf.shapes()
print "file len : "+ str(len(shapes))
bbox = shapes[0].bbox
print "bbox value : "
print ['%.3f' % coord for coord in bbox]
print "points len :"+str(len(shapes[0].points))
for index in range(0,100) :
shape = shapes[0].points[index]
#print "point value : 0"
print ['%.3f' % coord for coord in shape]
댓글
댓글 쓰기