Merge branch 'master' of gitlab.navinfo.com:CollectVehicle/OneMapQS

 Conflicts:
	app/src/main/assets/omdb_config.json
This commit is contained in:
squallzhjch
2023-06-21 10:21:50 +08:00
7 changed files with 86 additions and 12 deletions

View File

@@ -190,4 +190,31 @@ class ImportPreProcess {
angleReference.properties["type"] = "angle"
Realm.getDefaultInstance().insert(angleReference)
}
fun generateRoadName(renderEntity: RenderEntity) {
// LinkName的真正名称数据是保存在properties的shapeList中的因此需要解析shapeList数据
var shape :JSONObject? = null
if (renderEntity.properties.containsKey("shapeList")) {
val shapeListJsonArray: JSONArray = JSONArray(renderEntity.properties["shapeList"])
for (i in 0 until shapeListJsonArray.length()) {
val shapeJSONObject = shapeListJsonArray.getJSONObject(i)
if (shapeJSONObject["nameClass"]==1) {
if (shape == null) {
shape = shapeJSONObject
}
// 获取第一官方名
//("名称分类"NAME_CLASS =“1 官方名”且名称序号SEQ_NUM 最小者)
if (shapeJSONObject["seqNum"].toString().toInt()< shape!!["seqNum"].toString().toInt()) {
shape = shapeJSONObject
}
}
}
}
// 获取最小的shape值将其记录增加记录在properties的name属性下
if(shape!=null) {
renderEntity.properties["name"] = shape["name"].toString()
} else {
renderEntity.properties["name"] = ""
}
}
}