fix: 增加道路面渲染

This commit is contained in:
2023-06-20 14:30:07 +08:00
parent dee79fd63a
commit ac6e3d577a
7 changed files with 90 additions and 11 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"] = ""
}
}
}