提交 3c691d96c71ffaf0698be37750bfba454c2caae3

作者 nheweijun
1 个父辈 27989a74

2022.02.22 修复服务器入库读取失败问题

... ... @@ -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)
... ...
注册登录 后发表评论