fix file upload
This commit is contained in:
@@ -12,7 +12,7 @@ class Config:
|
||||
pg_password: str = 'Root12345678'
|
||||
|
||||
oodb_host: str = '10.10.8.83'
|
||||
oodb_port: int = 32110
|
||||
oodb_port: int = 32100
|
||||
oodb_dbname: str = 'db'
|
||||
oodb_username: str = 'postgres'
|
||||
oodb_passwd: str = 'Root12345678'
|
||||
|
||||
11
main.py
11
main.py
@@ -350,14 +350,15 @@ def put_object(params, files, url):
|
||||
req = ET.fromstring(params['query_data'])
|
||||
obj = req.find('chart')
|
||||
class_id = obj.get('Class')
|
||||
con = OOConnectionParams(scheme, Config.oodb_host, Config.oodb_port, Config.oodb_dbname,
|
||||
con = OOConnectionParams(Config.oodb_schema, Config.oodb_host, Config.oodb_port, Config.oodb_dbname,
|
||||
Config.oodb_username, Config.oodb_passwd, Config.oodb_schema)
|
||||
ws = OODBWorkspace.ws(Config.oodb_schema)
|
||||
if not ws.isInit():
|
||||
res = ws.init(con)
|
||||
logger.warning(res)
|
||||
logging.info(class_id)
|
||||
fc = ws.featureClass(class_id)
|
||||
feature = fc.createFeature()
|
||||
feature = fc.createFeature('')
|
||||
geom = Polygon.fromExtent(Envelope(0.0, 0.0, 1.0, 1.0, SRFactory.PZ9011()))
|
||||
res = feature.setGeometry(geom)
|
||||
for attr in obj.findall('Attribute'):
|
||||
@@ -553,6 +554,12 @@ def vers_key(e):
|
||||
|
||||
|
||||
def test():
|
||||
# with open('/home/ashatora/catalog.json') as f:
|
||||
# j = json.load(f)
|
||||
# j1 = json.loads(j[1]['data'])
|
||||
# with open('/home/ashatora/cat.json', 'w') as f:
|
||||
# f.write(json.dumps(j1, indent=2, ensure_ascii=False))
|
||||
# return
|
||||
#params = {"from": "tcp://kptsp_vb", "query_data": "<?xml version=\"1.0\" encoding=\"utf-8\"?><request><header parcel_id=\"990715ba919544a98f22cc7d3b0d9e8d\"/><getMetadataByIds><chart id=\"fc44343bd1654ee7b03ac1731567bbfd\"/></getMetadataByIds></request>", "query_type": 24, "to": "tcp://bnd127", "user_id": "3302", "ts_added": 1679825320.653038}
|
||||
#files = []
|
||||
#url = 'http://127.0.0.1:7000/xmlrpc'
|
||||
|
||||
Reference in New Issue
Block a user