优化数据库查询
This commit is contained in:
parent
7a99a9d0fb
commit
51c44f00b1
@ -2,6 +2,15 @@
|
|||||||
{
|
{
|
||||||
"tableGroupName": "普通图层",
|
"tableGroupName": "普通图层",
|
||||||
"tableMap": {
|
"tableMap": {
|
||||||
|
"2001": {
|
||||||
|
"table": "OMDB_RD_LINK",
|
||||||
|
"code": 2001,
|
||||||
|
"name": "道路线",
|
||||||
|
"zoomMin": 15,
|
||||||
|
"zoomMax": 17,
|
||||||
|
"catch": true,
|
||||||
|
"checkLinkId": false
|
||||||
|
},
|
||||||
"1007": {
|
"1007": {
|
||||||
"table": "OMDB_NODE_FORM",
|
"table": "OMDB_NODE_FORM",
|
||||||
"code": 1007,
|
"code": 1007,
|
||||||
@ -28,15 +37,6 @@
|
|||||||
"zoomMin": 15,
|
"zoomMin": 15,
|
||||||
"zoomMax": 20
|
"zoomMax": 20
|
||||||
},
|
},
|
||||||
"2001": {
|
|
||||||
"table": "OMDB_RD_LINK",
|
|
||||||
"code": 2001,
|
|
||||||
"name": "道路线",
|
|
||||||
"zoomMin": 15,
|
|
||||||
"zoomMax": 17,
|
|
||||||
"catch":true,
|
|
||||||
"checkLinkId": false
|
|
||||||
},
|
|
||||||
"2002": {
|
"2002": {
|
||||||
"table": "OMDB_RD_LINK_FUNCTION_CLASS",
|
"table": "OMDB_RD_LINK_FUNCTION_CLASS",
|
||||||
"code": 2002,
|
"code": 2002,
|
||||||
@ -642,7 +642,6 @@
|
|||||||
"zoomMin": 15,
|
"zoomMin": 15,
|
||||||
"zoomMax": 17
|
"zoomMax": 17
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
@ -37,7 +37,9 @@ import org.locationtech.jts.geom.LineString
|
|||||||
import org.locationtech.jts.geom.MultiLineString
|
import org.locationtech.jts.geom.MultiLineString
|
||||||
import org.spatialite.database.SQLiteDatabase
|
import org.spatialite.database.SQLiteDatabase
|
||||||
import java.io.File
|
import java.io.File
|
||||||
|
import java.util.*
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
|
import kotlin.collections.HashMap
|
||||||
import kotlin.streams.toList
|
import kotlin.streams.toList
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -155,7 +157,7 @@ class ImportOMDBHelper @AssistedInject constructor(
|
|||||||
.directory(currentInstallTaskFolder)
|
.directory(currentInstallTaskFolder)
|
||||||
.name("OMQS.realm")
|
.name("OMQS.realm")
|
||||||
.encryptionKey(Constant.PASSWORD)
|
.encryptionKey(Constant.PASSWORD)
|
||||||
.allowQueriesOnUiThread(true)
|
// .allowQueriesOnUiThread(true)
|
||||||
.schemaVersion(2)
|
.schemaVersion(2)
|
||||||
.build()
|
.build()
|
||||||
val unZipFolder = File(omdbZipFile.parentFile, "result")
|
val unZipFolder = File(omdbZipFile.parentFile, "result")
|
||||||
@ -181,28 +183,27 @@ class ImportOMDBHelper @AssistedInject constructor(
|
|||||||
var tableImportTime = System.currentTimeMillis()
|
var tableImportTime = System.currentTimeMillis()
|
||||||
//总表要素统计时间
|
//总表要素统计时间
|
||||||
var dataImportTime = System.currentTimeMillis()
|
var dataImportTime = System.currentTimeMillis()
|
||||||
|
val realm = Realm.getInstance(currentInstallTaskConfig)
|
||||||
Realm.getInstance(currentInstallTaskConfig).beginTransaction()
|
realm.beginTransaction()
|
||||||
|
|
||||||
for (importConfig in importConfigList) {
|
for (importConfig in importConfigList) {
|
||||||
tableNum += importConfig.tableMap.size
|
tableNum += importConfig.tableMap.size
|
||||||
}
|
}
|
||||||
//缓存任务link信息,便于下面与数据进行任务link匹配
|
//缓存任务link信息,便于下面与数据进行任务link匹配
|
||||||
val hashMap: HashMap<Long, HadLinkDvoBean> = HashMap<Long, HadLinkDvoBean>()
|
val hashMap: HashMap<Long, HadLinkDvoBean> = HashMap<Long, HadLinkDvoBean>()
|
||||||
|
|
||||||
val lineList = arrayOfNulls<LineString>(task.hadLinkDvoList.size)
|
// val lineList = arrayOfNulls<LineString>(task.hadLinkDvoList.size)
|
||||||
var index = 0
|
// var index = 0
|
||||||
task.hadLinkDvoList.forEach {
|
task.hadLinkDvoList.forEach {
|
||||||
hashMap[it.linkPid.toLong()] = it
|
hashMap[it.linkPid.toLong()] = it
|
||||||
lineList[index] = GeometryTools.createGeometry(it.geometry) as LineString
|
// lineList[index] = GeometryTools.createGeometry(it.geometry) as LineString
|
||||||
index++
|
// index++
|
||||||
}
|
}
|
||||||
|
|
||||||
val resHashMap: HashMap<String, RenderEntity> =
|
val resHashMap: HashMap<String, RenderEntity> =
|
||||||
HashMap<String, RenderEntity>() //define empty hashmap
|
HashMap<String, RenderEntity>() //define empty hashmap
|
||||||
try {
|
try {
|
||||||
|
|
||||||
var multipLine = MultiLineString(lineList, GeometryFactory())
|
// var multipLine = MultiLineString(lineList, GeometryFactory())
|
||||||
|
|
||||||
|
|
||||||
// 遍历解压后的文件,读取该数据返回
|
// 遍历解压后的文件,读取该数据返回
|
||||||
@ -259,13 +260,14 @@ class ImportOMDBHelper @AssistedInject constructor(
|
|||||||
renderEntity.zoomMin = map["qi_zoomMin"].toString().toInt()
|
renderEntity.zoomMin = map["qi_zoomMin"].toString().toInt()
|
||||||
renderEntity.zoomMax = map["qi_zoomMax"].toString().toInt()
|
renderEntity.zoomMax = map["qi_zoomMax"].toString().toInt()
|
||||||
// 在外层记录当前数据的linkPid
|
// 在外层记录当前数据的linkPid
|
||||||
if (renderEntity.properties.containsKey("linkPid")) {
|
if (map.containsKey("linkPid")) {
|
||||||
renderEntity.linkPid =
|
renderEntity.linkPid =
|
||||||
renderEntity.properties["linkPid"]?.split(",")?.get(0)
|
map["linkPid"].toString().split(",")
|
||||||
|
?.get(0)
|
||||||
.toString()
|
.toString()
|
||||||
} else if (renderEntity.properties.containsKey("linkList")){
|
} else if (map.containsKey("linkList")) {
|
||||||
val linkList =
|
val linkList =
|
||||||
renderEntity.properties["linkList"]
|
map["linkList"].toString()
|
||||||
if (!linkList.isNullOrEmpty() && linkList != "null") {
|
if (!linkList.isNullOrEmpty() && linkList != "null") {
|
||||||
val list: List<LinkList> = gson.fromJson(
|
val list: List<LinkList> = gson.fromJson(
|
||||||
linkList,
|
linkList,
|
||||||
@ -774,13 +776,18 @@ class ImportOMDBHelper @AssistedInject constructor(
|
|||||||
if (renderEntity.linkRelation == null) {
|
if (renderEntity.linkRelation == null) {
|
||||||
renderEntity.linkRelation = LinkRelation()
|
renderEntity.linkRelation = LinkRelation()
|
||||||
}
|
}
|
||||||
renderEntity.linkRelation!!.sNodeId = renderEntity.properties["snodePid"]
|
renderEntity.linkRelation!!.sNodeId =
|
||||||
renderEntity.linkRelation!!.eNodeId = renderEntity.properties["enodePid"]
|
renderEntity.properties["snodePid"]
|
||||||
|
renderEntity.linkRelation!!.eNodeId =
|
||||||
|
renderEntity.properties["enodePid"]
|
||||||
|
// 同时尝试更新RD_link的relation记录中的名称字段
|
||||||
|
renderEntity.linkRelation!!.linkPid =
|
||||||
|
renderEntity.properties["linkPid"]
|
||||||
|
?: UUID.randomUUID().toString()
|
||||||
}
|
}
|
||||||
|
|
||||||
Log.d("ImportOMDBHelper", "解析===1insert")
|
Log.d("ImportOMDBHelper", "解析===1insert")
|
||||||
Realm.getInstance(currentInstallTaskConfig)
|
realm.insert(renderEntity)
|
||||||
.insert(renderEntity)
|
|
||||||
Log.d("ImportOMDBHelper", "解析===2insert")
|
Log.d("ImportOMDBHelper", "解析===2insert")
|
||||||
}
|
}
|
||||||
if (currentConfig.code == DataCodeEnum.OMDB_RD_LINK.code.toInt()) {
|
if (currentConfig.code == DataCodeEnum.OMDB_RD_LINK.code.toInt()) {
|
||||||
@ -805,30 +812,33 @@ class ImportOMDBHelper @AssistedInject constructor(
|
|||||||
)
|
)
|
||||||
elementIndex = 0
|
elementIndex = 0
|
||||||
tableImportTime = System.currentTimeMillis()
|
tableImportTime = System.currentTimeMillis()
|
||||||
if (insertIndex % 20000 == 0) {
|
if (insertIndex % 20000 == 0 || currentEntry.value.table == DataCodeEnum.OMDB_RD_LINK.name) {
|
||||||
Log.d(
|
Log.d(
|
||||||
"ImportOMDBHelper",
|
"ImportOMDBHelper",
|
||||||
"表解析===结束用时时间===事物开始"
|
"表解析===结束用时时间===事物开始"
|
||||||
)
|
)
|
||||||
Realm.getInstance(currentInstallTaskConfig).commitTransaction()
|
realm.commitTransaction()
|
||||||
Realm.getInstance(currentInstallTaskConfig).beginTransaction()
|
realm.refresh()
|
||||||
|
realm.beginTransaction()
|
||||||
Log.d(
|
Log.d(
|
||||||
"ImportOMDBHelper",
|
"ImportOMDBHelper",
|
||||||
"表解析===结束用时时间===事物结束"
|
"表解析===结束用时时间===事物结束"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Realm.getInstance(currentInstallTaskConfig).commitTransaction()
|
realm.commitTransaction()
|
||||||
Realm.getInstance(currentInstallTaskConfig).close()
|
realm.close()
|
||||||
Log.d(
|
Log.d(
|
||||||
"ImportOMDBHelper",
|
"ImportOMDBHelper",
|
||||||
"表解析===结束用时时间${(System.currentTimeMillis() - dataImportTime)}===$dataIndex===插入$insertIndex"
|
"表解析===结束用时时间${(System.currentTimeMillis() - dataImportTime)}===$dataIndex===插入$insertIndex"
|
||||||
)
|
)
|
||||||
Log.e("qj", "安装结束")
|
Log.e("qj", "安装结束")
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
if (Realm.getInstance(currentInstallTaskConfig).isInTransaction) {
|
if (realm.isInTransaction) {
|
||||||
Realm.getInstance(currentInstallTaskConfig).cancelTransaction()
|
realm.cancelTransaction()
|
||||||
|
realm.close()
|
||||||
}
|
}
|
||||||
throw e
|
throw e
|
||||||
}
|
}
|
||||||
|
@ -15,6 +15,7 @@ import org.locationtech.jts.geom.Coordinate
|
|||||||
import org.locationtech.jts.geom.Geometry
|
import org.locationtech.jts.geom.Geometry
|
||||||
import org.locationtech.jts.io.WKTWriter
|
import org.locationtech.jts.io.WKTWriter
|
||||||
import org.oscim.core.GeoPoint
|
import org.oscim.core.GeoPoint
|
||||||
|
import java.util.*
|
||||||
|
|
||||||
|
|
||||||
class ImportPreProcess {
|
class ImportPreProcess {
|
||||||
@ -582,13 +583,6 @@ class ImportPreProcess {
|
|||||||
} else {
|
} else {
|
||||||
renderEntity.properties["name"] = ""
|
renderEntity.properties["name"] = ""
|
||||||
}
|
}
|
||||||
// 同时尝试更新RD_link的relation记录中的名称字段
|
|
||||||
val rdLinkEntity = queryRdLink(renderEntity.properties["linkPid"]!!)
|
|
||||||
if (rdLinkEntity?.linkRelation == null) {
|
|
||||||
rdLinkEntity?.linkRelation = LinkRelation()
|
|
||||||
}
|
|
||||||
rdLinkEntity?.linkRelation?.linkName = renderEntity.properties["name"]
|
|
||||||
Realm.getInstance(Constant.currentInstallTaskConfig).insertOrUpdate(rdLinkEntity)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -178,7 +178,8 @@ class RealmOperateHelper() {
|
|||||||
)
|
)
|
||||||
val realm = getRealmDefaultInstance()
|
val realm = getRealmDefaultInstance()
|
||||||
try {
|
try {
|
||||||
val realmList = realm.where(HadLinkDvoBean::class.java).equalTo("taskId", taskId).findAll()
|
val realmList =
|
||||||
|
realm.where(HadLinkDvoBean::class.java).equalTo("taskId", taskId).findAll()
|
||||||
var linkBean: HadLinkDvoBean? = null
|
var linkBean: HadLinkDvoBean? = null
|
||||||
var nearLast: Double = 99999.99
|
var nearLast: Double = 99999.99
|
||||||
for (link in realmList) {
|
for (link in realmList) {
|
||||||
@ -333,7 +334,7 @@ class RealmOperateHelper() {
|
|||||||
val result = mutableListOf<RenderEntity>()
|
val result = mutableListOf<RenderEntity>()
|
||||||
val realmList = getSelectTaskRealmTools(realm, RenderEntity::class.java, false)
|
val realmList = getSelectTaskRealmTools(realm, RenderEntity::class.java, false)
|
||||||
.notEqualTo("table", DataCodeEnum.OMDB_RD_LINK.name)
|
.notEqualTo("table", DataCodeEnum.OMDB_RD_LINK.name)
|
||||||
.equalTo("properties['${LinkTable.linkPid}']", linkPid)
|
.equalTo("linkPid", linkPid)
|
||||||
.findAll()
|
.findAll()
|
||||||
result.addAll(realm.copyFromRealm(realmList))
|
result.addAll(realm.copyFromRealm(realmList))
|
||||||
return result
|
return result
|
||||||
|
@ -816,8 +816,12 @@ class MainViewModel @Inject constructor(
|
|||||||
|
|
||||||
val newLineString = GeometryTools.createLineString(linePoints)
|
val newLineString = GeometryTools.createLineString(linePoints)
|
||||||
linkId?.let {
|
linkId?.let {
|
||||||
|
val time = System.currentTimeMillis()
|
||||||
val elementList = realmOperateHelper.queryLinkByLinkPid(realm, it)
|
val elementList = realmOperateHelper.queryLinkByLinkPid(realm, it)
|
||||||
Log.e("jingo", "捕捉到数据 ${elementList.size} 个")
|
Log.e(
|
||||||
|
"jingo",
|
||||||
|
"捕捉到数据 ${elementList.size} 个 ${System.currentTimeMillis() - time}"
|
||||||
|
)
|
||||||
for (element in elementList) {
|
for (element in elementList) {
|
||||||
if (element.code == DataCodeEnum.OMDB_LINK_NAME.code) {
|
if (element.code == DataCodeEnum.OMDB_LINK_NAME.code) {
|
||||||
hisRoadName = true
|
hisRoadName = true
|
||||||
|
@ -81,11 +81,11 @@ class NaviEngine(
|
|||||||
/**
|
/**
|
||||||
* 要查询的link基本信息列表
|
* 要查询的link基本信息列表
|
||||||
*/
|
*/
|
||||||
private val QUERY_KEY_LINK_INFO_LIST = arrayOf(
|
// private val QUERY_KEY_LINK_INFO_LIST = arrayOf(
|
||||||
DataCodeEnum.OMDB_RD_LINK.name,
|
// DataCodeEnum.OMDB_RD_LINK.name,
|
||||||
DataCodeEnum.OMDB_LINK_DIRECT.name,
|
// DataCodeEnum.OMDB_LINK_DIRECT.name,
|
||||||
DataCodeEnum.OMDB_LINK_NAME.name,
|
// DataCodeEnum.OMDB_LINK_NAME.name,
|
||||||
)
|
// )
|
||||||
|
|
||||||
// /**
|
// /**
|
||||||
// * 偏离距离 单位:米
|
// * 偏离距离 单位:米
|
||||||
@ -215,62 +215,56 @@ class NaviEngine(
|
|||||||
)
|
)
|
||||||
|
|
||||||
route.pointList = GeometryTools.getGeoPoints(link.geometry)
|
route.pointList = GeometryTools.getGeoPoints(link.geometry)
|
||||||
|
var time = System.currentTimeMillis()
|
||||||
|
val res = realm.where(RenderEntity::class.java)
|
||||||
|
.equalTo("table", DataCodeEnum.OMDB_RD_LINK.name).equalTo("linkPid", link.linkPid)
|
||||||
|
.findFirst()
|
||||||
|
|
||||||
val res = realm.where(RenderEntity::class.java).`in`("table", QUERY_KEY_LINK_INFO_LIST)
|
Log.e("jingo","查询link时间 ${System.currentTimeMillis() - time}")
|
||||||
.equalTo("properties['linkPid']", link.linkPid).findAll()
|
|
||||||
var bHasNode = false
|
if (res?.linkRelation != null) {
|
||||||
var bHasDir = false
|
if (res.linkRelation!!.sNodeId == null) {
|
||||||
var bHasName = false
|
callback.planningPathStatus(
|
||||||
if (res != null) {
|
NaviStatus.NAVI_STATUS_PATH_ERROR_NODE
|
||||||
for (entity in res) {
|
)
|
||||||
when (entity.code) {
|
return
|
||||||
DataCodeEnum.OMDB_RD_LINK.code -> {
|
|
||||||
bHasNode = true
|
|
||||||
val snodePid = entity.properties["snodePid"]
|
|
||||||
if (snodePid != null) {
|
|
||||||
route.sNode = snodePid
|
|
||||||
} else {
|
} else {
|
||||||
bHasNode = false
|
route.sNode = res.linkRelation!!.sNodeId!!
|
||||||
}
|
}
|
||||||
val enodePid = entity.properties["enodePid"]
|
if (res.linkRelation!!.eNodeId == null) {
|
||||||
if (enodePid != null) {
|
callback.planningPathStatus(
|
||||||
route.eNode = enodePid
|
NaviStatus.NAVI_STATUS_PATH_ERROR_NODE
|
||||||
|
)
|
||||||
|
return
|
||||||
} else {
|
} else {
|
||||||
bHasNode = false
|
route.eNode = res.linkRelation!!.eNodeId!!
|
||||||
}
|
}
|
||||||
}
|
|
||||||
DataCodeEnum.OMDB_LINK_DIRECT.code -> {
|
route.direct = res.linkRelation!!.direct
|
||||||
val direct = entity.properties["direct"]
|
// route.name = res.linkRelation!!.linkName
|
||||||
if (direct != null) {
|
time = System.currentTimeMillis()
|
||||||
bHasDir = true
|
val otherLinks = realm.where(RenderEntity::class.java)
|
||||||
route.direct = direct.toInt()
|
.equalTo("table", DataCodeEnum.OMDB_RD_LINK.name)
|
||||||
}
|
.notEqualTo("linkPid", route.linkId).beginGroup()
|
||||||
}
|
.`in`("linkRelation.sNodeId", arrayOf(route.sNode, route.eNode)).or()
|
||||||
DataCodeEnum.OMDB_LINK_NAME.code -> {
|
.`in`("linkRelation.eNodeId", arrayOf(route.sNode, route.eNode)).endGroup()
|
||||||
bHasName = true
|
.findAll()
|
||||||
route.name = realm.copyFromRealm(entity)
|
Log.e("jingo","拓扑道路时间 ${System.currentTimeMillis() - time} 共${otherLinks.size}条")
|
||||||
}
|
} else {
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!bHasNode) {
|
|
||||||
callback.planningPathStatus(
|
callback.planningPathStatus(
|
||||||
NaviStatus.NAVI_STATUS_PATH_ERROR_NODE
|
NaviStatus.NAVI_STATUS_PATH_ERROR_NODE
|
||||||
)
|
)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (!bHasDir) {
|
|
||||||
callback.planningPathStatus(
|
|
||||||
NaviStatus.NAVI_STATUS_PATH_ERROR_DIRECTION
|
|
||||||
)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
pathList.add(route)
|
pathList.add(route)
|
||||||
}
|
}
|
||||||
|
|
||||||
//用来存储最终的导航路径
|
//用来存储最终的导航路径
|
||||||
val newRouteList = mutableListOf<NaviRoute>()
|
val newRouteList = mutableListOf<NaviRoute>()
|
||||||
|
|
||||||
//比对路径排序用的
|
//比对路径排序用的
|
||||||
val tempRouteList = pathList.toMutableList()
|
val tempRouteList = pathList.toMutableList()
|
||||||
|
|
||||||
//先找到一根有方向的link,确定起终点
|
//先找到一根有方向的link,确定起终点
|
||||||
var routeStart: NaviRoute? = null
|
var routeStart: NaviRoute? = null
|
||||||
for (i in tempRouteList.indices) {
|
for (i in tempRouteList.indices) {
|
||||||
@ -359,10 +353,9 @@ class NaviEngine(
|
|||||||
for (route in newRouteList) {
|
for (route in newRouteList) {
|
||||||
itemMap.clear()
|
itemMap.clear()
|
||||||
//常规点限速
|
//常规点限速
|
||||||
val res = realm.where(RenderEntity::class.java)
|
val res =
|
||||||
.equalTo("properties['linkPid']", route.linkId).and().`in`(
|
realm.where(RenderEntity::class.java).equalTo("linkPid", route.linkId).and().`in`(
|
||||||
"table",
|
"table", QUERY_KEY_ITEM_LIST
|
||||||
QUERY_KEY_ITEM_LIST
|
|
||||||
).findAll()
|
).findAll()
|
||||||
if (res.isNotEmpty()) {
|
if (res.isNotEmpty()) {
|
||||||
// Log.e("jingo", "道路查询预警要素 ${route.linkId} ${res.size}条数据")
|
// Log.e("jingo", "道路查询预警要素 ${route.linkId} ${res.size}条数据")
|
||||||
@ -541,8 +534,7 @@ class NaviEngine(
|
|||||||
// if (route.itemList != null) {
|
// if (route.itemList != null) {
|
||||||
// Log.e("jingo", "${route.linkId}我有${route.itemList!!.size}个要素 ")
|
// Log.e("jingo", "${route.linkId}我有${route.itemList!!.size}个要素 ")
|
||||||
// }
|
// }
|
||||||
if (route.indexInPath < routeIndex)
|
if (route.indexInPath < routeIndex) continue
|
||||||
continue
|
|
||||||
if (route.indexInPath == routeIndex) {
|
if (route.indexInPath == routeIndex) {
|
||||||
currentRoute = route
|
currentRoute = route
|
||||||
}
|
}
|
||||||
|
@ -8,6 +8,7 @@ import io.realm.RealmDictionary
|
|||||||
import io.realm.RealmObject
|
import io.realm.RealmObject
|
||||||
import io.realm.RealmSet
|
import io.realm.RealmSet
|
||||||
import io.realm.annotations.Ignore
|
import io.realm.annotations.Ignore
|
||||||
|
import io.realm.annotations.Index
|
||||||
import io.realm.annotations.PrimaryKey
|
import io.realm.annotations.PrimaryKey
|
||||||
import kotlinx.parcelize.Parcelize
|
import kotlinx.parcelize.Parcelize
|
||||||
import org.locationtech.jts.geom.Coordinate
|
import org.locationtech.jts.geom.Coordinate
|
||||||
@ -21,10 +22,12 @@ import java.util.*
|
|||||||
@Parcelize
|
@Parcelize
|
||||||
open class LinkRelation() : RealmObject(), Parcelable {
|
open class LinkRelation() : RealmObject(), Parcelable {
|
||||||
@PrimaryKey
|
@PrimaryKey
|
||||||
var id: String = UUID.randomUUID().toString() // id
|
var linkPid:String = UUID.randomUUID().toString()
|
||||||
|
@Index
|
||||||
var sNodeId: String? = null
|
var sNodeId: String? = null
|
||||||
|
@Index
|
||||||
var eNodeId: String? = null
|
var eNodeId: String? = null
|
||||||
var linkName: String? = null
|
|
||||||
var direct: Int = 0
|
var direct: Int = 0
|
||||||
|
|
||||||
constructor(direct: Int) : this() {
|
constructor(direct: Int) : this() {
|
||||||
|
@ -8,6 +8,7 @@ import io.realm.RealmDictionary
|
|||||||
import io.realm.RealmObject
|
import io.realm.RealmObject
|
||||||
import io.realm.RealmSet
|
import io.realm.RealmSet
|
||||||
import io.realm.annotations.Ignore
|
import io.realm.annotations.Ignore
|
||||||
|
import io.realm.annotations.Index
|
||||||
import io.realm.annotations.PrimaryKey
|
import io.realm.annotations.PrimaryKey
|
||||||
import kotlinx.parcelize.Parcelize
|
import kotlinx.parcelize.Parcelize
|
||||||
import org.locationtech.jts.geom.Coordinate
|
import org.locationtech.jts.geom.Coordinate
|
||||||
@ -56,13 +57,16 @@ open class RenderEntity() : RealmObject(), Parcelable {
|
|||||||
return field
|
return field
|
||||||
}
|
}
|
||||||
var properties: RealmDictionary<String> = RealmDictionary()
|
var properties: RealmDictionary<String> = RealmDictionary()
|
||||||
|
@Ignore
|
||||||
var tileX: RealmSet<Int> = RealmSet() // x方向的tile编码
|
var tileX: RealmSet<Int> = RealmSet() // x方向的tile编码
|
||||||
|
@Ignore
|
||||||
var tileY: RealmSet<Int> = RealmSet() // y方向的tile编码
|
var tileY: RealmSet<Int> = RealmSet() // y方向的tile编码
|
||||||
var taskId: Int = 0 //任务ID
|
var taskId: Int = 0 //任务ID
|
||||||
var zoomMin: Int = 18 //显示最小级别
|
var zoomMin: Int = 18 //显示最小级别
|
||||||
var zoomMax: Int = 23 //显示最大级别
|
var zoomMax: Int = 23 //显示最大级别
|
||||||
var enable:Int = 0 // 默认0不是显示 1为渲染显示 2为常显
|
var enable:Int = 0 // 默认0不是显示 1为渲染显示 2为常显
|
||||||
var catchEnable:Int = 0 // 0不捕捉 1捕捉
|
var catchEnable:Int = 0 // 0不捕捉 1捕捉
|
||||||
|
@Index
|
||||||
lateinit var linkPid: String // RenderEntity关联的linkPid集合(可能会关联多个)
|
lateinit var linkPid: String // RenderEntity关联的linkPid集合(可能会关联多个)
|
||||||
var linkRelation: LinkRelation? = null
|
var linkRelation: LinkRelation? = null
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user