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]

댓글

이 블로그의 인기 게시물

HP 서버 OS 설치시 HDD를 잡지 못하는 문제

python-gdal 설치

Mysql JOIN 사용시 컬럼이름 중복해결