正在显示
2 个修改的文件
包含
3 行增加
和
4 行删除
... | ... | @@ -92,7 +92,7 @@ class Api(ApiTemplate): |
92 | 92 | if data_path.endswith("shp"): |
93 | 93 | info["type"]="shp" |
94 | 94 | driver: Driver = ogr.GetDriverByName("ESRI Shapefile") |
95 | - ds: DataSource = driver.Open(data_path, 1) | |
95 | + ds: DataSource = driver.Open(data_path, 0) | |
96 | 96 | if not ds: |
97 | 97 | raise Exception("打开数据失败!") |
98 | 98 | layer: Layer = ds.GetLayer(0) |
... | ... | @@ -112,8 +112,7 @@ class Api(ApiTemplate): |
112 | 112 | layer_name[layer.GetName()] = layer.GetName() |
113 | 113 | |
114 | 114 | except Exception as e : |
115 | - print(traceback.format_exc()) | |
116 | - info={} | |
115 | + raise e | |
117 | 116 | finally: |
118 | 117 | if ds: |
119 | 118 | ds.Destroy() | ... | ... |
... | ... | @@ -120,7 +120,7 @@ class EntryDataVacuate: |
120 | 120 | ''' |
121 | 121 | |
122 | 122 | driver: Driver = ogr.GetDriverByName("ESRI Shapefile") |
123 | - ds: DataSource = driver.Open(data_path, 1) | |
123 | + ds: DataSource = driver.Open(data_path, 0) | |
124 | 124 | if not ds: |
125 | 125 | raise Exception("打开数据失败!") |
126 | 126 | layer: Layer = ds.GetLayer(0) | ... | ... |
请
注册
或
登录
后发表评论