|
@@ -21,8 +21,8 @@ conn = psycopg2.connect(
|
|
dbname="real3d",
|
|
dbname="real3d",
|
|
user="postgres",
|
|
user="postgres",
|
|
password="postgis",
|
|
password="postgis",
|
|
- # host="192.168.100.30",
|
|
|
|
- host="192.168.60.2",
|
|
|
|
|
|
+ host="192.168.100.30",
|
|
|
|
+ # host="192.168.60.2",
|
|
port="5432"
|
|
port="5432"
|
|
)
|
|
)
|
|
|
|
|
|
@@ -33,6 +33,8 @@ def home():
|
|
return render_template('index.html')
|
|
return render_template('index.html')
|
|
|
|
|
|
# 后台接口
|
|
# 后台接口
|
|
|
|
+
|
|
|
|
+
|
|
@app.route("/hello")
|
|
@app.route("/hello")
|
|
def hello():
|
|
def hello():
|
|
return "Hello, World!"
|
|
return "Hello, World!"
|
|
@@ -220,6 +222,10 @@ def jsonResToDict(json_res):
|
|
conditionInfo = factorInfo["condition_info"]
|
|
conditionInfo = factorInfo["condition_info"]
|
|
conditionObj = json.loads(conditionInfo)
|
|
conditionObj = json.loads(conditionInfo)
|
|
|
|
|
|
|
|
+ defaultValue = str(factor["value"])
|
|
|
|
+ if defaultValue == '':
|
|
|
|
+ defaultValue = '0'
|
|
|
|
+
|
|
factor_info = {
|
|
factor_info = {
|
|
"id": factorId,
|
|
"id": factorId,
|
|
"name": factor["type"],
|
|
"name": factor["type"],
|
|
@@ -228,7 +234,7 @@ def jsonResToDict(json_res):
|
|
"spatial_type": conditionObj["spatial_type"],
|
|
"spatial_type": conditionObj["spatial_type"],
|
|
"default": factor["condition"],
|
|
"default": factor["condition"],
|
|
"hasValue": conditionObj["hasValue"],
|
|
"hasValue": conditionObj["hasValue"],
|
|
- "defaultValue": str(factor["value"]),
|
|
|
|
|
|
+ "defaultValue": defaultValue,
|
|
"unit": conditionObj["unit"],
|
|
"unit": conditionObj["unit"],
|
|
"clip": conditionObj["clip"]
|
|
"clip": conditionObj["clip"]
|
|
}
|
|
}
|
|
@@ -240,12 +246,13 @@ def jsonResToDict(json_res):
|
|
if factorId in input_factors:
|
|
if factorId in input_factors:
|
|
res["yxyz"].append(input_factors[factorId])
|
|
res["yxyz"].append(input_factors[factorId])
|
|
else:
|
|
else:
|
|
- factorTemplate["conditionInfo"]=json.loads(factorTemplate["conditionInfo"])
|
|
|
|
|
|
+ factorTemplate["conditionInfo"] = json.loads(
|
|
|
|
+ factorTemplate["conditionInfo"])
|
|
res["yxyz"].append(factorTemplate)
|
|
res["yxyz"].append(factorTemplate)
|
|
- resObj={}
|
|
|
|
- resObj["data"]=res
|
|
|
|
- resObj["code"]=200
|
|
|
|
- resObj["type"]="selectLand"
|
|
|
|
|
|
+ resObj = {}
|
|
|
|
+ resObj["data"] = res
|
|
|
|
+ resObj["code"] = 200
|
|
|
|
+ resObj["type"] = "selectLand"
|
|
return resObj
|
|
return resObj
|
|
|
|
|
|
# 获取因子信息
|
|
# 获取因子信息
|