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