Merge branch 'master' of gitlab.navinfo.com:CollectVehicle/OneMapQS
Conflicts: app/src/main/java/com/navinfo/omqs/ui/activity/map/MainViewModel.kt
This commit is contained in:
commit
c2e2d33025
28 files changed
+918
-210
No files matched your search
@@ -107,6 +107,7 @@ dependencies {
|
||||
// implementation 'javax.xml.stream:stax-api:1.0-2'
|
||||
// implementation 'com.bea.xml.stream:com.bea.xml.stream:1.0.0'
|
||||
implementation 'commons-io:commons-io:2.11.0'
|
||||
implementation 'com.alibaba:fastjson:1.2.73'
|
||||
|
||||
// 读取spatialite文件
|
||||
implementation 'com.github.sevar83:android-spatialite:2.0.1'
|
||||
|
||||
@@ -150,17 +150,23 @@
|
||||
"code": 2092,
|
||||
"name": "车道类型",
|
||||
"catch": true,
|
||||
"isDependOnOtherTable": true,
|
||||
"isDependOnOtherTable": false,
|
||||
"zoomMin": 18,
|
||||
"zoomMax": 20,
|
||||
"transformer": [
|
||||
{
|
||||
"k": "geometry",
|
||||
"v": "~",
|
||||
"klib": "geometry",
|
||||
"vlib": "generateLaneTypeAccessS2ERefPoint()"
|
||||
}
|
||||
]
|
||||
"transformer": [
|
||||
{
|
||||
"k": "geometry",
|
||||
"v": "~",
|
||||
"klib": "geometry",
|
||||
"vlib": "filterLaneTypeAccess()"
|
||||
},
|
||||
{
|
||||
"k": "geometry",
|
||||
"v": "~",
|
||||
"klib": "geometry",
|
||||
"vlib": "generateLaneTypeAccessS2ERefPoint()"
|
||||
}
|
||||
]
|
||||
},
|
||||
"2097": {
|
||||
"table": "OMDB_PHY_LANENUM",
|
||||
@@ -173,7 +179,7 @@
|
||||
"name": "桥",
|
||||
"catch": true,
|
||||
"existSubCode": true,
|
||||
"isDependOnOtherTable": true,
|
||||
"isDependOnOtherTable": false,
|
||||
"zoomMin": 15,
|
||||
"zoomMax": 20,
|
||||
"transformer": [
|
||||
@@ -350,7 +356,7 @@
|
||||
"code": 4001,
|
||||
"name": "路口",
|
||||
"zoomMin": 15,
|
||||
"isDependOnOtherTable": true,
|
||||
"isDependOnOtherTable": false,
|
||||
"zoomMax": 17,
|
||||
"catch": true,
|
||||
"transformer": [
|
||||
@@ -492,7 +498,7 @@
|
||||
"code": 4009,
|
||||
"name": "警示信息",
|
||||
"catch": true,
|
||||
"isDependOnOtherTable": true,
|
||||
"isDependOnOtherTable": false,
|
||||
"zoomMin": 15,
|
||||
"zoomMax": 20,
|
||||
"transformer": [
|
||||
@@ -581,7 +587,7 @@
|
||||
"code": 4601,
|
||||
"name": "车信",
|
||||
"catch": true,
|
||||
"isDependOnOtherTable": true,
|
||||
"isDependOnOtherTable": false,
|
||||
"zoomMin": 15,
|
||||
"zoomMax": 17,
|
||||
"transformer": [
|
||||
@@ -609,8 +615,8 @@
|
||||
"table": "OMDB_LANE_LINK_LG",
|
||||
"code": 5001,
|
||||
"name": "车道中心线",
|
||||
"catch": false,
|
||||
"isDependOnOtherTable": true,
|
||||
"catch": true,
|
||||
"isDependOnOtherTable": false,
|
||||
"checkLinkId": false,
|
||||
"zoomMin": 18,
|
||||
"zoomMax": 20,
|
||||
|
||||
@@ -40,12 +40,19 @@ class Constant {
|
||||
*/
|
||||
lateinit var USER_DATA_PATH: String
|
||||
|
||||
/**
|
||||
* 用户数据安装标识
|
||||
*/
|
||||
var INSTALL_DATA: Boolean = false
|
||||
|
||||
/**
|
||||
* 轨迹渲染个数统计
|
||||
*/
|
||||
var TRACE_COUNT : Int = 0
|
||||
|
||||
var TRACE_COUNT_TIME : Int = 10
|
||||
var TRACE_COUNT_TIME : Int = 9
|
||||
|
||||
var TRACE_COUNT_MORE_TIME : Int = 24
|
||||
|
||||
/**
|
||||
* 当前安装任务
|
||||
|
||||
@@ -3,12 +3,13 @@ package com.navinfo.omqs.db
|
||||
import android.content.Context
|
||||
import android.database.Cursor.*
|
||||
import android.util.Log
|
||||
import com.alibaba.fastjson.JSON
|
||||
import com.blankj.utilcode.util.ZipUtils
|
||||
import com.google.gson.Gson
|
||||
import com.google.gson.reflect.TypeToken
|
||||
import com.navinfo.collect.library.data.entity.*
|
||||
import com.navinfo.collect.library.enums.DataCodeEnum
|
||||
import com.navinfo.collect.library.utils.StrZipUtil
|
||||
import com.navinfo.collect.library.utils.DeflaterUtil
|
||||
import com.navinfo.omqs.Constant
|
||||
import com.navinfo.omqs.Constant.Companion.currentInstallTaskConfig
|
||||
import com.navinfo.omqs.Constant.Companion.currentInstallTaskFolder
|
||||
@@ -24,18 +25,34 @@ import io.realm.Realm
|
||||
import io.realm.RealmConfiguration
|
||||
import kotlinx.coroutines.*
|
||||
import kotlinx.coroutines.channels.Channel
|
||||
import kotlinx.coroutines.flow.Flow
|
||||
import kotlinx.coroutines.flow.FlowCollector
|
||||
import kotlinx.coroutines.flow.channelFlow
|
||||
import kotlinx.coroutines.flow.flow
|
||||
import kotlinx.coroutines.sync.Mutex
|
||||
import org.spatialite.database.SQLiteDatabase
|
||||
import kotlinx.coroutines.channels.awaitClose
|
||||
import kotlinx.coroutines.channels.trySendBlocking
|
||||
import kotlinx.coroutines.flow.callbackFlow
|
||||
import kotlinx.coroutines.flow.conflate
|
||||
import java.io.BufferedReader
|
||||
import java.io.File
|
||||
import java.io.FileReader
|
||||
import java.util.*
|
||||
import javax.inject.Inject
|
||||
|
||||
|
||||
//定义一个接口
|
||||
sealed interface Event
|
||||
class OnProgress(val value:Int):Event
|
||||
class OnError(val t:Throwable):Event
|
||||
class OnResult<T>(val value:T):Event
|
||||
object OnComplete:Event
|
||||
|
||||
interface MultiPathsCallback<T>{
|
||||
fun onProgress(value: Int)
|
||||
|
||||
fun onResult(value: T)
|
||||
|
||||
fun onError(t:Throwable)
|
||||
|
||||
fun onComplete()
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入omdb数据的帮助类
|
||||
* */
|
||||
@@ -147,8 +164,9 @@ class ImportOMDBHelper @AssistedInject constructor(
|
||||
* @param configFile 对应的配置文件
|
||||
* */
|
||||
suspend fun importOmdbZipFile(
|
||||
omdbZipFile: File, task: TaskBean, scope: CoroutineScope
|
||||
): Boolean {
|
||||
omdbZipFile: File, task: TaskBean, scope: CoroutineScope,callback: MultiPathsCallback<String>
|
||||
) {
|
||||
|
||||
val channel = Channel<List<RenderEntity>>(Channel.RENDEZVOUS)
|
||||
|
||||
installTaskid = task.id.toString()
|
||||
@@ -190,7 +208,11 @@ class ImportOMDBHelper @AssistedInject constructor(
|
||||
mutableMapOf<MutableMap.MutableEntry<String, TableInfo>, ImportConfig>()
|
||||
//协程池
|
||||
val listJob = mutableListOf<Job>()
|
||||
|
||||
try {
|
||||
CMLog.writeLogtoFile(ImportOMDBHelper::class.java.name, "数据安装", "开始安装数据")
|
||||
Constant.INSTALL_DATA = true
|
||||
|
||||
for (importConfig in importConfigList) {
|
||||
for ((index, currentEntry) in importConfig.tableMap.entries.withIndex()) {
|
||||
if (currentEntry.value.isDependOnOtherTable) {
|
||||
@@ -198,14 +220,64 @@ class ImportOMDBHelper @AssistedInject constructor(
|
||||
continue
|
||||
}
|
||||
val job = scope.launch(Dispatchers.IO) {
|
||||
importData(
|
||||
startTaskAsFlow(
|
||||
channel,
|
||||
unZipFiles,
|
||||
currentEntry,
|
||||
task,
|
||||
importConfig,
|
||||
hashMap
|
||||
)
|
||||
hashMap,
|
||||
true).collect{
|
||||
when(it){
|
||||
OnComplete->{
|
||||
processIndex ++
|
||||
callback.onResult("$processIndex|$tableNum")
|
||||
Log.e("jingo", "安装==$processIndex===$tableNum")
|
||||
if(tableNum-processIndex==listDependOnEntry.size){
|
||||
for ((currentEntry, importConfig) in listDependOnEntry) {
|
||||
processIndex++
|
||||
if(processIndex==tableNum){
|
||||
importData(
|
||||
channel,
|
||||
unZipFiles,
|
||||
currentEntry,
|
||||
task,
|
||||
importConfig,
|
||||
hashMap,
|
||||
false, callback
|
||||
)
|
||||
}else{
|
||||
callback.onResult("$processIndex|$tableNum")
|
||||
importData(
|
||||
channel,
|
||||
unZipFiles,
|
||||
currentEntry,
|
||||
task,
|
||||
importConfig,
|
||||
hashMap,
|
||||
false, null)
|
||||
}
|
||||
}
|
||||
Log.e("jingo", "安装结束")
|
||||
|
||||
CMLog.writeLogtoFile(ImportOMDBHelper::class.java.name, "数据安装", "安装结束")
|
||||
|
||||
Constant.INSTALL_DATA = false
|
||||
}
|
||||
}
|
||||
is OnProgress->{
|
||||
callback.onProgress(it.value)
|
||||
Log.e("qj","progress==${it.value}")
|
||||
}
|
||||
is OnResult<*>->{
|
||||
callback.onResult(it.value.toString())
|
||||
}
|
||||
is OnError->{
|
||||
callback.onError(it.t)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
listJob.add(job)
|
||||
}
|
||||
@@ -220,31 +292,49 @@ class ImportOMDBHelper @AssistedInject constructor(
|
||||
}
|
||||
realm.close()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
listJob.joinAll()
|
||||
channel.close()
|
||||
channelJob.join()
|
||||
Log.e("jingo", "channel close 等待结束")
|
||||
for ((currentEntry, importConfig) in listDependOnEntry) {
|
||||
importData(
|
||||
channel,
|
||||
unZipFiles,
|
||||
currentEntry,
|
||||
task,
|
||||
importConfig,
|
||||
hashMap,
|
||||
false
|
||||
)
|
||||
}
|
||||
Log.e("jingo", "安装结束")
|
||||
} catch (e: Exception) {
|
||||
Log.e("jingo", "安装报错1 ${e.message}")
|
||||
return false
|
||||
|
||||
callback.onError(e)
|
||||
|
||||
Constant.INSTALL_DATA = false
|
||||
}
|
||||
return true
|
||||
}
|
||||
private fun startTaskAsFlow(
|
||||
f: Channel<List<RenderEntity>>,
|
||||
unZipFiles: List<File>,
|
||||
currentEntry: MutableMap.MutableEntry<String, TableInfo>,
|
||||
task: TaskBean,
|
||||
importConfig: ImportConfig,
|
||||
hashMap: HashMap<Long, HadLinkDvoBean>,
|
||||
isEmit: Boolean = true) = callbackFlow <Event>{
|
||||
val cancellable= importData(f,unZipFiles,currentEntry,task,importConfig,hashMap,isEmit,object :MultiPathsCallback<String>{
|
||||
override fun onProgress(value: Int) {
|
||||
trySendBlocking(OnProgress(value))
|
||||
Log.e("jingo","=====$value")
|
||||
}
|
||||
|
||||
override fun onError(t: Throwable) {
|
||||
trySendBlocking(OnError(t))
|
||||
}
|
||||
|
||||
override fun onComplete() {
|
||||
trySendBlocking(OnComplete)
|
||||
}
|
||||
|
||||
override fun onResult(value: String) {
|
||||
trySendBlocking(OnResult(value))
|
||||
}
|
||||
})
|
||||
|
||||
awaitClose {
|
||||
|
||||
}
|
||||
}.conflate()
|
||||
|
||||
private suspend fun importData(
|
||||
f: Channel<List<RenderEntity>>,
|
||||
@@ -253,18 +343,20 @@ class ImportOMDBHelper @AssistedInject constructor(
|
||||
task: TaskBean,
|
||||
importConfig: ImportConfig,
|
||||
hashMap: HashMap<Long, HadLinkDvoBean>,
|
||||
isEmit: Boolean = true
|
||||
) {
|
||||
isEmit: Boolean = true, callback: MultiPathsCallback<String>?
|
||||
):NonCancellable {
|
||||
val resHashMap: HashMap<String, RenderEntity> = HashMap() //define empty hashmap
|
||||
var listRenderEntity = mutableListOf<RenderEntity>()
|
||||
//单个表要素统计
|
||||
var elementIndex = 0
|
||||
val currentConfig = currentEntry.value
|
||||
// CMLog.writeLogtoFile(
|
||||
// ImportOMDBHelper::class.java.name,
|
||||
// "importOmdbZipFile",
|
||||
// "${currentConfig.table}开始"
|
||||
// )
|
||||
|
||||
CMLog.writeLogtoFile(
|
||||
ImportOMDBHelper::class.java.name,
|
||||
"importOmdbZipFile",
|
||||
"${currentConfig.table}开始"
|
||||
)
|
||||
|
||||
try {
|
||||
var realm: Realm? = null
|
||||
if (!isEmit) {
|
||||
@@ -286,12 +378,18 @@ class ImportOMDBHelper @AssistedInject constructor(
|
||||
continue
|
||||
}
|
||||
newTime = System.currentTimeMillis()
|
||||
Log.e(
|
||||
"jingo",
|
||||
"安装数据 ${currentConfig.table} $elementIndex ${listRenderEntity.size} ${newTime - time}"
|
||||
)
|
||||
|
||||
if (elementIndex % 50 == 0) {
|
||||
Log.e(
|
||||
"jingo",
|
||||
"安装数据 ${currentConfig.table} $elementIndex ${listRenderEntity.size} ${newTime - time}"
|
||||
)
|
||||
}
|
||||
|
||||
time = newTime
|
||||
|
||||
elementIndex += 1
|
||||
|
||||
val map = gson.fromJson<Map<String, Any>>(
|
||||
line, object : TypeToken<Map<String, Any>>() {}.type
|
||||
).toMutableMap()
|
||||
@@ -480,6 +578,8 @@ class ImportOMDBHelper @AssistedInject constructor(
|
||||
|
||||
// 对renderEntity做预处理后再保存
|
||||
val resultEntity = importConfig.transformProperties(renderEntity, realm)
|
||||
|
||||
//车道中心线不在主表写入
|
||||
if (resultEntity != null) {
|
||||
|
||||
//对code编码需要特殊处理 存在多个属性值时,渲染优先级:SA>PA,存在多个属性值时,渲染优先级:FRONTAGE>MAIN_SIDE_A CCESS
|
||||
@@ -526,6 +626,7 @@ class ImportOMDBHelper @AssistedInject constructor(
|
||||
when (renderEntity.properties["bridgeType"]) {
|
||||
"1" -> renderEntity.code =
|
||||
DataCodeEnum.OMDB_BRIDGE_1.code
|
||||
|
||||
"2" -> renderEntity.code =
|
||||
DataCodeEnum.OMDB_BRIDGE_2.code
|
||||
// "3" -> renderEntity.code = DataCodeEnum.OMDB_BRIDGE_3.code
|
||||
@@ -669,6 +770,21 @@ class ImportOMDBHelper @AssistedInject constructor(
|
||||
renderEntity.properties.remove("linkPid")
|
||||
}
|
||||
|
||||
//去掉暂用控件较大的字段多余属性字段
|
||||
if (renderEntity.properties.containsKey("shapeList")) {
|
||||
renderEntity.properties.remove("shapeList")
|
||||
}
|
||||
|
||||
//只保留link表相关的pid
|
||||
if (currentConfig.code != DataCodeEnum.OMDB_RD_LINK.code.toInt() && currentConfig.code != DataCodeEnum.OMDB_RD_LINK_KIND.code.toInt() && renderEntity.properties.containsKey(
|
||||
"linkPid"
|
||||
)
|
||||
) {
|
||||
if (renderEntity.properties.containsKey("mesh")) {
|
||||
renderEntity.properties.remove("mesh")
|
||||
}
|
||||
}
|
||||
|
||||
// 如果当前解析的是OMDB_RD_LINK数据,将其缓存在预处理类中,以便后续处理其他要素时使用
|
||||
if (currentConfig.code == DataCodeEnum.OMDB_RD_LINK.code.toInt()) {
|
||||
if (renderEntity.linkRelation == null) {
|
||||
@@ -681,15 +797,11 @@ class ImportOMDBHelper @AssistedInject constructor(
|
||||
renderEntity.properties["enodePid"]
|
||||
}
|
||||
|
||||
//去掉暂用控件较大的字段多余属性字段
|
||||
if (renderEntity.properties.containsKey("shapeList")) {
|
||||
renderEntity.properties.remove("shapeList")
|
||||
}
|
||||
renderEntity.propertiesDb =
|
||||
DeflaterUtil.zipString(JSON.toJSONString(renderEntity.properties))
|
||||
|
||||
renderEntity.propertiesDb = StrZipUtil.compress(
|
||||
gson.toJson(renderEntity.properties).toString()
|
||||
)
|
||||
listRenderEntity.add(renderEntity)
|
||||
|
||||
}
|
||||
|
||||
if (listRenderEntity.size > 20000) {
|
||||
@@ -700,32 +812,36 @@ class ImportOMDBHelper @AssistedInject constructor(
|
||||
if (isEmit) {
|
||||
f.send(listRenderEntity)
|
||||
delay(20)
|
||||
callback?.onProgress(elementIndex)
|
||||
} else {
|
||||
realm!!.copyToRealm(listRenderEntity)
|
||||
realm!!.commitTransaction()
|
||||
realm!!.close()
|
||||
realm = Realm.getInstance(currentInstallTaskConfig)
|
||||
realm.beginTransaction()
|
||||
callback?.onProgress(elementIndex)
|
||||
}
|
||||
listRenderEntity = mutableListOf()
|
||||
//
|
||||
}
|
||||
line = bufferedReader.readLine()
|
||||
}
|
||||
// CMLog.writeLogtoFile(
|
||||
// ImportOMDBHelper::class.java.name,
|
||||
// "importOmdbZipFile",
|
||||
// "结束===总量$elementIndex"
|
||||
// )
|
||||
|
||||
CMLog.writeLogtoFile(
|
||||
ImportOMDBHelper::class.java.name,
|
||||
"importOmdbZipFile",
|
||||
"${currentConfig.table}结束===总量$elementIndex"
|
||||
)
|
||||
|
||||
if (isEmit) {
|
||||
f.send(listRenderEntity)
|
||||
delay(20)
|
||||
|
||||
callback?.onProgress(elementIndex)
|
||||
} else {
|
||||
bufferedReader.close()
|
||||
realm!!.copyToRealm(listRenderEntity)
|
||||
realm!!.commitTransaction()
|
||||
callback?.onProgress(elementIndex)
|
||||
}
|
||||
}
|
||||
if (!isEmit) {
|
||||
@@ -735,7 +851,12 @@ class ImportOMDBHelper @AssistedInject constructor(
|
||||
Log.e("jingo", "安装报错 ${currentConfig.table} ${elementIndex} ${e.message}")
|
||||
throw e
|
||||
}
|
||||
|
||||
Log.e("jingo", "完成 ${currentConfig.table}")
|
||||
|
||||
callback?.onComplete()
|
||||
|
||||
return NonCancellable
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
package com.navinfo.omqs.db
|
||||
|
||||
import android.util.Log
|
||||
import com.alibaba.fastjson.JSON
|
||||
import com.google.gson.Gson
|
||||
import com.navinfo.collect.library.data.entity.LinkRelation
|
||||
import com.navinfo.collect.library.data.entity.ReferenceEntity
|
||||
import com.navinfo.collect.library.data.entity.RenderEntity
|
||||
import com.navinfo.collect.library.enums.DataCodeEnum
|
||||
import com.navinfo.collect.library.utils.DeflaterUtil
|
||||
import com.navinfo.collect.library.utils.GeometryTools
|
||||
import com.navinfo.collect.library.utils.StrZipUtil
|
||||
import com.navinfo.omqs.Constant
|
||||
@@ -240,19 +242,32 @@ class ImportPreProcess {
|
||||
startEndReference.properties["qi_table"] = renderEntity.table
|
||||
startEndReference.properties["type"] = "s_2_e"
|
||||
val listResult = mutableListOf<ReferenceEntity>()
|
||||
startEndReference.propertiesDb = StrZipUtil.compress(
|
||||
gson.toJson(startEndReference.properties).toString()
|
||||
)
|
||||
listResult.add(startEndReference)
|
||||
insertData(listResult)
|
||||
startEndReference.propertiesDb = DeflaterUtil.zipString(JSON.toJSONString(startEndReference.properties))
|
||||
renderEntity.referenceEntitys?.add(startEndReference)
|
||||
//listResult.add(startEndReference)
|
||||
//insertData(listResult)
|
||||
}
|
||||
|
||||
/**
|
||||
* 过滤车道类型数据,只保留加速车道、减速车道和自行车道
|
||||
* */
|
||||
fun filterLaneTypeAccess(renderEntity: RenderEntity): Boolean {
|
||||
if (renderEntity.properties["laneType"]!!.toInt() and (0b1100) > 0 || renderEntity.properties["laneType"]!!.toInt() and (0b1 shl 19) > 0) { // 是加速车道/减速车道/自行车道
|
||||
// 如果是自行车道,需要在properties中增加新的属性,用于渲染自行车道的特殊线型
|
||||
if (renderEntity.properties["laneType"]!!.toInt() and (0b1 shl 19) > 0) {
|
||||
renderEntity.properties["bike"] = "true"
|
||||
}
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成车道类型起终点参考数据
|
||||
* */
|
||||
fun generateLaneTypeAccessS2ERefPoint(renderEntity: RenderEntity) {
|
||||
// 如果车道类型非常规车道(第0bit的数据),则需要生成辅助数据
|
||||
if (renderEntity.properties["laneType"]!!.toInt()>0) {
|
||||
// 只需要生成加速车道和减速车道的起终点辅助数据
|
||||
if (renderEntity.properties["laneType"]!!.toInt() and (0b1100) > 0) { // 是加速车道或者减速车道
|
||||
val geometry = GeometryTools.createGeometry(renderEntity.properties["geometry"])
|
||||
|
||||
val pointEnd = geometry!!.coordinates[geometry.numPoints - 1] // 获取这个geometry对应的结束点坐标
|
||||
@@ -273,7 +288,7 @@ class ImportPreProcess {
|
||||
startReference.geometry =
|
||||
GeometryTools.createGeometry(GeoPoint(pointStart.y, pointStart.x)).toString()
|
||||
startReference.properties["qi_table"] = renderEntity.table
|
||||
startReference.properties["type"] = "s_2_p"
|
||||
startReference.properties["type"] = "s${if (renderEntity.properties["laneType"]!!.toInt() and (0b1000)>0) "_dec" else "_acc"}"
|
||||
startReference.properties["geometry"] = startReference.geometry
|
||||
listResult.add(startReference)
|
||||
|
||||
@@ -291,11 +306,11 @@ class ImportPreProcess {
|
||||
endReference.geometry =
|
||||
GeometryTools.createGeometry(GeoPoint(pointEnd.y, pointEnd.x)).toString()
|
||||
endReference.properties["qi_table"] = renderEntity.table
|
||||
endReference.properties["type"] = "e_2_p"
|
||||
endReference.properties["type"] = "e${if (renderEntity.properties["laneType"]!!.toInt() and (0b1000)>0) "_dec" else "_acc"}"
|
||||
endReference.properties["geometry"] = endReference.geometry
|
||||
|
||||
listResult.add(endReference)
|
||||
insertData(listResult)
|
||||
renderEntity.referenceEntitys?.add(endReference)
|
||||
//listResult.add(endReference)
|
||||
//insertData(listResult)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -344,9 +359,7 @@ class ImportPreProcess {
|
||||
Log.e("qj", "generateS2EReferencePoint===${startReference.geometry}")
|
||||
|
||||
startReference.properties["geometry"] = startReference.geometry
|
||||
startReference.propertiesDb = StrZipUtil.compress(
|
||||
gson.toJson(startReference.properties).toString()
|
||||
)
|
||||
startReference.propertiesDb = DeflaterUtil.zipString(JSON.toJSONString(startReference.properties))
|
||||
listResult.add(startReference)
|
||||
|
||||
Log.e("qj", "generateS2EReferencePoint===1")
|
||||
@@ -381,12 +394,11 @@ class ImportPreProcess {
|
||||
Log.e("qj", "generateS2EReferencePoint===e_2_p${renderEntity.name}")
|
||||
}
|
||||
endReference.properties["geometry"] = endReference.geometry
|
||||
endReference.propertiesDb = StrZipUtil.compress(
|
||||
gson.toJson(endReference.properties).toString()
|
||||
)
|
||||
listResult.add(endReference)
|
||||
endReference.propertiesDb = DeflaterUtil.zipString(JSON.toJSONString(endReference.properties))
|
||||
renderEntity.referenceEntitys?.add(endReference)
|
||||
//listResult.add(endReference)
|
||||
Log.e("qj", "generateS2EReferencePoint===4")
|
||||
insertData(listResult)
|
||||
//insertData(listResult)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -482,12 +494,11 @@ class ImportPreProcess {
|
||||
WKTWriter(3).write(GeometryTools.createLineString(arrayOf(pointStart, coorEnd)))
|
||||
angleReference.properties["qi_table"] = renderEntity.table
|
||||
angleReference.properties["type"] = "angle"
|
||||
angleReference.propertiesDb = StrZipUtil.compress(
|
||||
gson.toJson(angleReference.properties).toString()
|
||||
)
|
||||
listResult.add(angleReference)
|
||||
angleReference.propertiesDb = DeflaterUtil.zipString(JSON.toJSONString(angleReference.properties))
|
||||
renderEntity.referenceEntitys?.add(angleReference)
|
||||
//listResult.add(angleReference)
|
||||
}
|
||||
insertData(listResult)
|
||||
//insertData(listResult)
|
||||
}
|
||||
|
||||
fun addAngleFromGeometry(renderEntity: RenderEntity): String {
|
||||
@@ -642,12 +653,11 @@ class ImportPreProcess {
|
||||
referenceEntity.properties["symbol"] =
|
||||
"assets:omdb/4601/${type}/1301_${referenceEntity.properties["currentDirect"]}.svg"
|
||||
Log.d("unpackingLaneInfo", referenceEntity.properties["symbol"].toString())
|
||||
referenceEntity.propertiesDb = StrZipUtil.compress(
|
||||
gson.toJson(referenceEntity.properties).toString()
|
||||
)
|
||||
listResult.add(referenceEntity)
|
||||
referenceEntity.propertiesDb = DeflaterUtil.zipString(JSON.toJSONString(referenceEntity.properties))
|
||||
renderEntity.referenceEntitys?.add(referenceEntity)
|
||||
//listResult.add(referenceEntity)
|
||||
}
|
||||
insertData(listResult)
|
||||
//insertData(listResult)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -745,9 +755,8 @@ class ImportPreProcess {
|
||||
angleReference.table = renderEntity.table
|
||||
angleReference.code = renderEntity.code
|
||||
Log.e("jingo", "几何转换开始")
|
||||
angleReference.geometry =
|
||||
GeometryTools.createGeometry(renderEntity.geometry).buffer(0.000010)
|
||||
.toString()//GeometryTools.computeLine(0.000035,0.000035,renderEntity.geometry)
|
||||
//angleReference.geometry = renderEntity.geometry
|
||||
angleReference.geometry = GeometryTools.computeLine(0.000035,0.000035,renderEntity.geometry)
|
||||
Log.e("jingo", "几何转换结束")
|
||||
angleReference.properties["qi_table"] = renderEntity.table
|
||||
angleReference.properties["widthProperties"] = "3"
|
||||
@@ -756,12 +765,10 @@ class ImportPreProcess {
|
||||
angleReference.taskId = renderEntity.taskId
|
||||
angleReference.enable = renderEntity.enable
|
||||
val listResult = mutableListOf<ReferenceEntity>()
|
||||
angleReference.propertiesDb = StrZipUtil.compress(
|
||||
gson.toJson(angleReference.properties).toString()
|
||||
)
|
||||
listResult.add(angleReference)
|
||||
insertData(listResult)
|
||||
|
||||
angleReference.propertiesDb = DeflaterUtil.zipString(JSON.toJSONString(angleReference.properties))
|
||||
renderEntity.referenceEntitys?.add(angleReference)
|
||||
//listResult.add(angleReference)
|
||||
//insertData(listResult)
|
||||
}
|
||||
|
||||
|
||||
@@ -790,12 +797,11 @@ class ImportPreProcess {
|
||||
GeometryTools.createGeometry(nodeJSONObject["geometry"].toString()).toString()
|
||||
intersectionReference.properties["qi_table"] = renderEntity.table
|
||||
intersectionReference.properties["type"] = "node"
|
||||
intersectionReference.propertiesDb = StrZipUtil.compress(
|
||||
gson.toJson(intersectionReference.properties).toString()
|
||||
)
|
||||
listResult.add(intersectionReference)
|
||||
intersectionReference.propertiesDb = DeflaterUtil.zipString(JSON.toJSONString(intersectionReference.properties))
|
||||
renderEntity.referenceEntitys?.add(intersectionReference)
|
||||
//listResult.add(intersectionReference)
|
||||
}
|
||||
insertData(listResult)
|
||||
//insertData(listResult)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -962,12 +968,11 @@ class ImportPreProcess {
|
||||
dynamicSrcReference.properties["type"] = "dynamicSrc"
|
||||
val code = renderEntity.properties[codeName]
|
||||
dynamicSrcReference.properties["src"] = "${prefix}${code}${suffix}"
|
||||
dynamicSrcReference.propertiesDb = StrZipUtil.compress(
|
||||
gson.toJson(dynamicSrcReference.properties).toString()
|
||||
)
|
||||
listResult.add(dynamicSrcReference)
|
||||
dynamicSrcReference.propertiesDb = DeflaterUtil.zipString(JSON.toJSONString(dynamicSrcReference.properties))
|
||||
renderEntity.referenceEntitys?.add(dynamicSrcReference)
|
||||
//listResult.add(dynamicSrcReference)
|
||||
}
|
||||
insertData(listResult)
|
||||
//insertData(listResult)
|
||||
}
|
||||
|
||||
private fun insertData(list: List<RealmModel>) {
|
||||
@@ -1111,4 +1116,118 @@ class ImportPreProcess {
|
||||
renderEntity.properties["ref"] = "${renderEntity.properties["maxSpeed"]}|${renderEntity.properties["minSpeed"]}"
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成立交的辅助图层数据
|
||||
* */
|
||||
fun obtainZLevelReference(renderEntity: RenderEntity) {
|
||||
if(renderEntity!=null&&renderEntity.properties.containsKey("zlevelList")) {
|
||||
// 获取ZLevelList数据
|
||||
val zLevelList = JSONArray(renderEntity.properties["zlevelList"])
|
||||
for (i in 0 until zLevelList.length()) {
|
||||
val zLevelObject = zLevelList.getJSONObject(i)
|
||||
// 获取ZLevelObject的startEnd字段值
|
||||
val startEnd = zLevelObject.optInt("startEnd", 0)
|
||||
val zLevel = zLevelObject.optInt("zlevel", 0)
|
||||
val shpSeqNum = zLevelObject.optInt("shpSeqNum", 0)
|
||||
val linkGeometry = GeometryTools.createGeometry(zLevelObject.optString("linkGeometry"))
|
||||
val coordinates = linkGeometry!!.coordinates
|
||||
val referenceEntityList = mutableListOf<ReferenceEntity>()
|
||||
// 判断当前数据的startEnd,如果是0则向前和向后都绘制线,如果是1(起点)则只绘制前两个点组成的线,如果是2(终点)则只绘制后两个点组成的线
|
||||
if (startEnd == 0 || startEnd == 1) { // 处理向后的线
|
||||
val zLevelReference = createZLevelReference(renderEntity)
|
||||
zLevelReference.properties["type"] = "zlevelLine"
|
||||
// zLevelReference.properties["name"] = zLevel.toString()
|
||||
// 根据shpSeqNum获取对应的点位
|
||||
if (shpSeqNum < coordinates.size-1) {
|
||||
val currentCoordinate = coordinates[shpSeqNum]
|
||||
var nextCoordinate = coordinates[shpSeqNum+1]
|
||||
// 计算两个点的距离,如果小于指定阈值,程序按照方向计算延长线
|
||||
// if (GeometryTools.getDistance(currentCoordinate.y, currentCoordinate.x, nextCoordinate.y, nextCoordinate.x) < 3.0) {
|
||||
// 获取当前点到下一个点的线方向
|
||||
val angle = Angle.angle(currentCoordinate, nextCoordinate)
|
||||
// 计算偏移距离
|
||||
val dx: Double = GeometryTools.convertDistanceToDegree(
|
||||
3.0,
|
||||
currentCoordinate.y!!
|
||||
) * Math.cos(angle)
|
||||
val dy: Double = GeometryTools.convertDistanceToDegree(
|
||||
3.0,
|
||||
currentCoordinate.y!!
|
||||
) * Math.sin(angle)
|
||||
|
||||
// 计算偏移后的点
|
||||
nextCoordinate =
|
||||
Coordinate(currentCoordinate.getX() + dx, currentCoordinate.getY() + dy)
|
||||
// }
|
||||
zLevelReference.geometry = GeometryTools.createLineString(arrayListOf(GeoPoint(currentCoordinate.y, currentCoordinate.x), GeoPoint(nextCoordinate.y, nextCoordinate.x))).toString()
|
||||
|
||||
referenceEntityList.add(zLevelReference)
|
||||
|
||||
val zLevelNameReference = createZLevelReference(renderEntity)
|
||||
zLevelNameReference.properties["type"] = "zlevelName"
|
||||
zLevelNameReference.properties["name"] = zLevel.toString()
|
||||
zLevelNameReference.geometry = GeometryTools.createGeometry(GeoPoint(nextCoordinate.y, nextCoordinate.x)).toString()
|
||||
referenceEntityList.add(zLevelNameReference)
|
||||
}
|
||||
}
|
||||
|
||||
if (startEnd == 0 || startEnd == 2) { // 处理向前的线
|
||||
val zLevelReference = createZLevelReference(renderEntity)
|
||||
zLevelReference.properties["type"] = "zlevelLine"
|
||||
// zLevelReference.properties["name"] = zLevel.toString()
|
||||
// 根据shpSeqNum获取对应的点位
|
||||
if (shpSeqNum < coordinates.size&&shpSeqNum>0) {
|
||||
val currentCoordinate = coordinates[shpSeqNum]
|
||||
var preCoordinate = coordinates[shpSeqNum-1]
|
||||
// 计算两个点的距离,如果小于指定阈值,程序按照方向计算延长线
|
||||
// if (GeometryTools.getDistance(currentCoordinate.y, currentCoordinate.x, preCoordinate.y, preCoordinate.x) < 3.0) {
|
||||
// 获取当前点到下一个点的线方向
|
||||
val angle = Angle.angle(currentCoordinate, preCoordinate)
|
||||
// 计算偏移距离
|
||||
val dx: Double = GeometryTools.convertDistanceToDegree(
|
||||
3.0,
|
||||
currentCoordinate.y!!
|
||||
) * Math.cos(angle)
|
||||
val dy: Double = GeometryTools.convertDistanceToDegree(
|
||||
3.0,
|
||||
currentCoordinate.y!!
|
||||
) * Math.sin(angle)
|
||||
|
||||
// 计算偏移后的点
|
||||
preCoordinate =
|
||||
Coordinate(currentCoordinate.getX() + dx, currentCoordinate.getY() + dy)
|
||||
// }
|
||||
zLevelReference.geometry = GeometryTools.createLineString(arrayListOf(GeoPoint(currentCoordinate.y, currentCoordinate.x), GeoPoint(preCoordinate.y, preCoordinate.x))).toString()
|
||||
referenceEntityList.add(zLevelReference)
|
||||
|
||||
val zLevelNameReference = createZLevelReference(renderEntity)
|
||||
zLevelNameReference.properties["type"] = "zlevelName"
|
||||
zLevelNameReference.properties["name"] = zLevel.toString()
|
||||
zLevelNameReference.geometry = GeometryTools.createGeometry(GeoPoint(preCoordinate.y, preCoordinate.x)).toString()
|
||||
referenceEntityList.add(zLevelNameReference)
|
||||
}
|
||||
}
|
||||
|
||||
insertData(referenceEntityList)
|
||||
// 移除zlevelList,减小原始数据大小
|
||||
renderEntity.properties.remove("zlevelList")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun createZLevelReference(renderEntity: RenderEntity): ReferenceEntity {
|
||||
val zLevelReference = ReferenceEntity()
|
||||
zLevelReference.renderEntityId = renderEntity.id
|
||||
zLevelReference.name = "${renderEntity.name}参考点"
|
||||
zLevelReference.code = renderEntity.code
|
||||
zLevelReference.table = renderEntity.table
|
||||
zLevelReference.zoomMin = renderEntity.zoomMin
|
||||
zLevelReference.zoomMax = renderEntity.zoomMax
|
||||
zLevelReference.taskId = renderEntity.taskId
|
||||
zLevelReference.enable = renderEntity.enable
|
||||
|
||||
zLevelReference.properties["qi_table"] = renderEntity.table
|
||||
return zLevelReference
|
||||
}
|
||||
}
|
||||
@@ -1,14 +1,18 @@
|
||||
package com.navinfo.omqs.http.taskdownload
|
||||
|
||||
import android.os.Handler
|
||||
import android.os.Message
|
||||
import android.util.Log
|
||||
import androidx.lifecycle.LifecycleOwner
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import androidx.lifecycle.Observer
|
||||
import androidx.lifecycle.viewmodel.viewModelFactory
|
||||
import com.blankj.utilcode.util.MapUtils
|
||||
import com.navinfo.collect.library.data.entity.TaskBean
|
||||
import com.navinfo.collect.library.utils.MapParamUtils
|
||||
import com.navinfo.omqs.Constant
|
||||
import com.navinfo.omqs.db.ImportOMDBHelper
|
||||
import com.navinfo.omqs.db.MultiPathsCallback
|
||||
import com.navinfo.omqs.db.RealmOperateHelper
|
||||
import com.navinfo.omqs.tools.FileManager
|
||||
import com.navinfo.omqs.tools.FileManager.Companion.FileDownloadStatus
|
||||
@@ -155,20 +159,50 @@ class TaskDownloadScope(
|
||||
fileNew
|
||||
)
|
||||
if (task != null) {
|
||||
if (importOMDBHelper.importOmdbZipFile(importOMDBHelper.omdbFile, task, this)) {
|
||||
// if (it == "finish") {
|
||||
change(FileDownloadStatus.DONE)
|
||||
Log.e("jingo", "数据安装结束")
|
||||
withContext(Dispatchers.Main) {
|
||||
//任务与当前一致,需要更新渲染图层
|
||||
if (MapParamUtils.getTaskId() == taskBean.id) {
|
||||
downloadManager.mapController.layerManagerHandler.updateOMDBVectorTileLayer()
|
||||
importOMDBHelper.importOmdbZipFile(
|
||||
importOMDBHelper.omdbFile,
|
||||
task,
|
||||
this,
|
||||
object : MultiPathsCallback<String> {
|
||||
override fun onProgress(value: Int) {
|
||||
Log.e("jingo", "安装====$value")
|
||||
}
|
||||
}
|
||||
} else {
|
||||
change(FileDownloadStatus.IMPORTING, "anzhuang")
|
||||
}
|
||||
// }
|
||||
|
||||
override fun onError(t: Throwable) {
|
||||
}
|
||||
|
||||
override fun onComplete() {
|
||||
taskBean.status = FileDownloadStatus.DONE
|
||||
downloadData.postValue(taskBean)
|
||||
//任务与当前一致,需要更新渲染图层
|
||||
if (MapParamUtils.getTaskId() == taskBean.id) {
|
||||
downloadManager.mapController.layerManagerHandler.updateOMDBVectorTileLayer()
|
||||
}
|
||||
val realm = realmOperateHelper.getRealmDefaultInstance()
|
||||
realm.executeTransaction { r ->
|
||||
val newTask =
|
||||
realm.where(TaskBean::class.java).equalTo("id", taskBean.id)
|
||||
.findFirst()
|
||||
newTask?.let {
|
||||
it.syncStatus = taskBean.syncStatus
|
||||
it.status = taskBean.status
|
||||
it.errMsg = taskBean.errMsg
|
||||
//赋值时间,用于查询过滤
|
||||
it.operationTime = taskBean.operationTime
|
||||
r.copyToRealmOrUpdate(it)
|
||||
taskBean = realm.copyFromRealm(it)
|
||||
}
|
||||
}
|
||||
realm.close()
|
||||
}
|
||||
|
||||
override fun onResult(value: String) {
|
||||
taskBean.status = FileDownloadStatus.IMPORTING
|
||||
taskBean.message = value
|
||||
downloadData.postValue(taskBean)
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
Log.e("jingo", "数据安装失败 ${e.toString()}")
|
||||
|
||||
@@ -27,6 +27,7 @@ import com.google.android.material.tabs.TabLayout
|
||||
import com.navinfo.collect.library.data.entity.RenderEntity
|
||||
import com.navinfo.collect.library.map.NIMapController
|
||||
import com.navinfo.collect.library.map.handler.MeasureLayerHandler
|
||||
import com.navinfo.collect.library.utils.DeflaterUtil
|
||||
import com.navinfo.collect.library.utils.GeometryTools
|
||||
import com.navinfo.omqs.Constant
|
||||
import com.navinfo.omqs.R
|
||||
@@ -56,6 +57,8 @@ import kotlinx.coroutines.launch
|
||||
import org.oscim.core.GeoPoint
|
||||
import org.oscim.renderer.GLViewport
|
||||
import org.videolan.vlc.Util
|
||||
import sun.misc.BASE64Decoder
|
||||
import sun.misc.BASE64Encoder
|
||||
import java.math.BigDecimal
|
||||
import java.math.RoundingMode
|
||||
import javax.inject.Inject
|
||||
@@ -190,7 +193,8 @@ class MainActivity : BaseActivity() {
|
||||
viewModel.speakMode = SpeakMode(this)
|
||||
// 在mapController初始化前获取当前OMDB图层显隐
|
||||
viewModel.refreshOMDBLayer(LayerConfigUtils.getLayerConfigList())
|
||||
mapController.mMapView.vtmMap.viewport().maxZoomLevel = com.navinfo.collect.library.system.Constant.MAX_ZOOM
|
||||
mapController.mMapView.vtmMap.viewport().maxZoomLevel =
|
||||
com.navinfo.collect.library.system.Constant.MAX_ZOOM
|
||||
//关联生命周期
|
||||
binding.lifecycleOwner = this
|
||||
//给xml转递对象
|
||||
@@ -344,17 +348,17 @@ class MainActivity : BaseActivity() {
|
||||
}
|
||||
}
|
||||
viewModel.liveDataAutoLocation.observe(this) {
|
||||
if (it == true&&Constant.INDOOR_IP==null|| Constant.INDOOR_IP == "") {
|
||||
if (it == true && Constant.INDOOR_IP == null || Constant.INDOOR_IP == "") {
|
||||
onClickLocation()
|
||||
}
|
||||
}
|
||||
viewModel.liveDataSignMoreInfo.observe(this) {
|
||||
|
||||
if(!rightController.backQueue.isEmpty()){
|
||||
if (!rightController.backQueue.isEmpty()) {
|
||||
rightController.navigateUp()
|
||||
}
|
||||
|
||||
lifecycleScope.launch{
|
||||
lifecycleScope.launch {
|
||||
delay(100)
|
||||
|
||||
val bundle = Bundle()
|
||||
@@ -367,8 +371,10 @@ class MainActivity : BaseActivity() {
|
||||
supportFragmentManager.beginTransaction()
|
||||
.replace(R.id.main_activity_sign_more_info_fragment, SignMoreInfoFragment())
|
||||
.commit()
|
||||
}else{
|
||||
supportFragmentManager.beginTransaction().add(R.id.main_activity_sign_more_info_fragment, SignMoreInfoFragment()).commit()
|
||||
} else {
|
||||
supportFragmentManager.beginTransaction()
|
||||
.add(R.id.main_activity_sign_more_info_fragment, SignMoreInfoFragment())
|
||||
.commit()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -437,10 +443,12 @@ class MainActivity : BaseActivity() {
|
||||
if (loadingDialog.isShowing)
|
||||
loadingDialog.dismiss()
|
||||
}
|
||||
|
||||
NaviStatus.NAVI_STATUS_PATH_PLANNING -> {
|
||||
if (!loadingDialog.isShowing)
|
||||
loadingDialog.show()
|
||||
}
|
||||
|
||||
NaviStatus.NAVI_STATUS_PATH_ERROR_NODE -> {
|
||||
Toast.makeText(
|
||||
this,
|
||||
@@ -458,9 +466,11 @@ class MainActivity : BaseActivity() {
|
||||
).show()
|
||||
loadingDialog.dismiss()
|
||||
}
|
||||
|
||||
NaviStatus.NAVI_STATUS_PATH_SUCCESS -> {
|
||||
loadingDialog.dismiss()
|
||||
}
|
||||
|
||||
NaviStatus.NAVI_STATUS_DISTANCE_OFF -> {
|
||||
Toast.makeText(
|
||||
this,
|
||||
@@ -468,6 +478,7 @@ class MainActivity : BaseActivity() {
|
||||
Toast.LENGTH_SHORT
|
||||
).show()
|
||||
}
|
||||
|
||||
NaviStatus.NAVI_STATUS_DIRECTION_OFF -> {
|
||||
}
|
||||
}
|
||||
@@ -494,6 +505,18 @@ class MainActivity : BaseActivity() {
|
||||
}
|
||||
}
|
||||
|
||||
viewModel.liveDataLoadData.observe(this) {
|
||||
when (it) {
|
||||
LoadDataStatus.LOAD_DATA_STATUS_BEGIN -> {
|
||||
showLoadingDialog("正在加载数据...")
|
||||
}
|
||||
|
||||
LoadDataStatus.LOAD_DATA_STATUS_FISISH -> {
|
||||
hideLoadingDialog()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
lifecycleScope.launch {
|
||||
// 初始化地图图层控制接收器
|
||||
FlowEventBus.subscribe<List<ImportConfig>>(
|
||||
@@ -791,6 +814,9 @@ class MainActivity : BaseActivity() {
|
||||
*/
|
||||
fun zoomInOnclick(view: View) {
|
||||
//Log.e("qj", "computeline==${GeometryTools.computeLine(175.0/1000000000,"LINESTRING(116.71523523056109 39.92252072202544 16.08, 116.7152446525368 39.922528935578065 16.04, 116.7152492633007 39.92253304221301 16.03, 116.71525397428678 39.922537148987885 16.02, 116.7152585850368 39.92254115561753 16, 116.71526319579864 39.9225452622508 15.99, 116.7152678065473 39.92254926887934 15.99, 116.71527241730776 39.92255337551149 15.97, 116.71527702806752 39.9225574821431 15.96, 116.71528163882658 39.92256158877415 15.94, 116.71528624957249 39.92256559540047 15.92, 116.7152908603302 39.92256970203041 15.91, 116.7152954710872 39.9225738086598 15.9, 116.71529998162082 39.92257791514826 15.88, 116.71530459237646 39.92258202177656 15.87, 116.71530920313141 39.9225861284043 15.86, 116.71531381388567 39.92259023503148 15.85, 116.7153183244166 39.92259434151779 15.84, 116.71532293516951 39.92259844814387 15.82, 116.71532754590925 39.92260245476522 15.82, 116.71533205643817 39.92260656124991 15.8, 116.71533666718902 39.922610667874345 15.79, 116.71534127793919 39.92261477449822 15.78, 116.71534588868865 39.922618881121544 15.77, 116.7153503992149 39.92262298760407 15.76, 116.715355009963 39.92262709422631 15.75, 116.71535962071042 39.922631200847974 15.75, 116.71536423144467 39.9226352074649 15.74, 116.71536884219071 39.922639314085465 15.73, 116.71537335271358 39.922643420565294 15.72, 116.71537796345827 39.92264752718475 15.72, 116.71538257420224 39.92265163380365 15.72, 116.71538718494553 39.92265574042201 15.71, 116.71539179567566 39.92265974703562 15.71, 116.71539640641758 39.92266385365286 15.7, 116.7154010171588 39.92266796026954 15.7, 116.71540562789932 39.92267206688567 15.7, 116.71541023862667 39.92267607349705 15.69, 116.71541484936583 39.922680180112074 15.68, 116.7154194601043 39.922684286726536 15.68, 116.71542407084206 39.92268839334044 15.67, 116.71542868157914 39.92269249995378 15.66, 116.71543339252533 39.922696506702415 15.66, 116.715438003261 39.92270061331464 15.65, 116.71544261399599 39.92270471992631 15.64, 116.7154472247178 39.92270872653324 15.64, 116.71545193567363 39.92271283328377 15.63, 116.71545654640653 39.92271693989375 15.62, 116.71546115712626 39.922720946499005 15.62, 116.71546586806747 39.92272495324363 15.61, 116.71547047879827 39.92272905985193 15.6, 116.71547518973806 39.92273306659542 15.59, 116.71547990067711 39.92273707333831 15.59, 116.71548461161544 39.922741080080634 15.58, 116.71548922233096 39.9227450866825 15.58, 116.71549393326787 39.92274909342366 15.57, 116.71549854398198 39.9227531000244 15.57, 116.71550325491746 39.922757106764415 15.56, 116.71550796583975 39.922761013499674 15.55, 116.71551267677377 39.92276502023853 15.55, 116.71551738770708 39.9227690269768 15.54, 116.71552209863965 39.9227730337145 15.54, 116.71552680957151 39.922777040451614 15.53, 116.71553152050265 39.92278104718814 15.52, 116.71553633164253 39.922784954059665 15.52, 116.7155410425722 39.92278896079502 15.51, 116.71554575350116 39.92279296752979 15.51, 116.71555046442938 39.92279697426398 15.5, 116.71555527556629 39.92280088113311 15.49, 116.71555998648057 39.92280478786194 15.48, 116.71556469740662 39.922808794594374 15.48, 116.71556940831947 39.92281270132205 15.47, 116.7155742194534 39.922816608188796 15.47, 116.71557893037725 39.922820614919466 15.47, 116.71558374150969 39.92282452178501 15.46, 116.71558855264136 39.92282842864994 15.46, 116.71559326356302 39.92283243537885 15.45, 116.71559807469322 39.922836342242576 15.45, 116.71560288582265 39.922840249105704 15.44, 116.7156076969638 39.9228442559724 15.43, 116.71561250809172 39.92284816283432 15.43, 116.71561731921888 39.922852069695615 15.42, 116.7156221303453 39.92285597655631 15.42, 116.71562684124932 39.922859883276885 15.42, 116.71563165237423 39.92286379013638 15.41, 116.71563646349838 39.92286769699527 15.41, 116.7156411744002 39.922871603714064 15.41, 116.71564598552287 39.92287551057175 15.41, 116.71565079664477 39.922879417428824 15.4, 116.71565560776592 39.922883324285294 15.4, 116.71566041888632 39.922887231141154 15.39, 116.71566512978445 39.922891137856986 15.39, 116.71567004112484 39.922895044851046 15.39, 116.71567485224296 39.92289895170508 15.38, 116.71567966334786 39.92290275855433 15.38, 116.71568457468592 39.92290666554651 15.38, 116.71568938580177 39.922910572398706 15.37, 116.71569429712578 39.92291437938545 15.37, 116.7156992084615 39.922918286375754 15.37, 116.71570411978394 39.92292209336123 15.36, 116.71570903110559 39.92292590034607 15.36, 116.7157140426478 39.92292970746958 15.36, 116.71571895396787 39.92293351445314 15.35, 116.71572396550846 39.92293732157533 15.35, 116.71572887682693 39.92294112855762 15.35, 116.71573388835341 39.92294483567432 15.34, 116.71573889989156 39.922948642794545 15.34, 116.71574391142887 39.922952449914106 15.33, 116.7157489229529 39.92295615702883 15.33, 116.71575383426735 39.92295996400789 15.32, 116.71575884578974 39.9229636711213 15.32, 116.7157638573238 39.92296747823824Line truncated
|
||||
val geometryStr = "LINESTRING(116.71523523056109 39.92252072202544 16.08, 116.7152446525368 39.922528935578065 16.04, 116.7152492633007 39.92253304221301 16.03, 116.71525397428678 39.922537148987885 16.02, 116.7152585850368 39.92254115561753 16, 116.71526319579864 39.9225452622508 15.99, 116.7152678065473 39.92254926887934 15.99, 116.71527241730776 39.92255337551149 15.97, 116.71527702806752 39.9225574821431 15.96, 116.71528163882658 39.92256158877415 15.94, 116.71528624957249 39.92256559540047 15.92, 116.7152908603302 39.92256970203041 15.91, 116.7152954710872 39.9225738086598 15.9, 116.71529998162082 39.92257791514826 15.88, 116.71530459237646 39.92258202177656 15.87, 116.71530920313141 39.9225861284043 15.86, 116.71531381388567 39.92259023503148 15.85, 116.7153183244166 39.92259434151779 15.84, 116.71532293516951 39.92259844814387 15.82, 116.71532754590925 39.92260245476522 15.82, 116.71533205643817 39.92260656124991 15.8, 116.71533666718902 39.922610667874345 15.79, 116.71534127793919 39.92261477449822 15.78, 116.71534588868865 39.922618881121544 15.77, 116.7153503992149 39.92262298760407 15.76, 116.715355009963 39.92262709422631 15.75, 116.71535962071042 39.922631200847974 15.75, 116.71536423144467 39.9226352074649 15.74, 116.71536884219071 39.922639314085465 15.73, 116.71537335271358 39.922643420565294 15.72, 116.71537796345827 39.92264752718475 15.72, 116.71538257420224 39.92265163380365 15.72, 116.71538718494553 39.92265574042201 15.71, 116.71539179567566 39.92265974703562 15.71, 116.71539640641758 39.92266385365286 15.7, 116.7154010171588 39.92266796026954 15.7, 116.71540562789932 39.92267206688567 15.7, 116.71541023862667 39.92267607349705 15.69, 116.71541484936583 39.922680180112074 15.68, 116.7154194601043 39.922684286726536 15.68, 116.71542407084206 39.92268839334044 15.67, 116.71542868157914 39.92269249995378 15.66, 116.71543339252533 39.922696506702415 15.66, 116.715438003261 39.92270061331464 15.65, 116.71544261399599 39.92270471992631 15.64, 116.7154472247178 39.92270872653324 15.64, 116.71545193567363 39.92271283328377 15.63, 116.71545654640653 39.92271693989375 15.62, 116.71546115712626 39.922720946499005 15.62, 116.71546586806747 39.92272495324363 15.61, 116.71547047879827 39.92272905985193 15.6, 116.71547518973806 39.92273306659542 15.59, 116.71547990067711 39.92273707333831 15.59, 116.71548461161544 39.922741080080634 15.58, 116.71548922233096 39.9227450866825 15.58, 116.71549393326787 39.92274909342366 15.57, 116.71549854398198 39.9227531000244 15.57, 116.71550325491746 39.922757106764415 15.56, 116.71550796583975 39.922761013499674 15.55, 116.71551267677377 39.92276502023853 15.55, 116.71551738770708 39.9227690269768 15.54, 116.71552209863965 39.9227730337145 15.54, 116.71552680957151 39.922777040451614 15.53, 116.71553152050265 39.92278104718814 15.52, 116.71553633164253 39.922784954059665 15.52, 116.7155410425722 39.92278896079502 15.51, 116.71554575350116 39.92279296752979 15.51, 116.71555046442938 39.92279697426398 15.5, 116.71555527556629 39.92280088113311 15.49, 116.71555998648057 39.92280478786194 15.48, 116.71556469740662 39.922808794594374 15.48, 116.71556940831947 39.92281270132205 15.47, 116.7155742194534 39.922816608188796 15.47, 116.71557893037725 39.922820614919466 15.47, 116.71558374150969 39.92282452178501 15.46, 116.71558855264136 39.92282842864994 15.46, 116.71559326356302 39.92283243537885 15.45, 116.71559807469322 39.922836342242576 15.45, 116.71560288582265 39.922840249105704 15.44, 116.7156076969638 39.9228442559724 15.43, 116.71561250809172 39.92284816283432 15.43, 116.71561731921888 39.922852069695615 15.42, 116.7156221303453 39.92285597655631 15.42, 116.71562684124932 39.922859883276885 15.42, 116.71563165237423 39.92286379013638 15.41, 116.71563646349838 39.92286769699527 15.41, 116.7156411744002 39.922871603714064 15.41, 116.71564598552287 39.92287551057175 15.41, 116.71565079664477 39.922879417428824 15.4, 116.71565560776592 39.922883324285294 15.4, 116.71566041888632 39.922887231141154 15.39, 116.71566512978445 39.922891137856986 15.39, 116.71567004112484 39.922895044851046 15.39, 116.71567485224296 39.92289895170508 15.38, 116.71567966334786 39.92290275855433 15.38, 116.71568457468592 39.92290666554651 15.38, 116.71568938580177 39.922910572398706 15.37, 116.71569429712578 39.92291437938545 15.37, 116.7156992084615 39.922918286375754 15.37, 116.71570411978394 39.92292209336123 15.36, 116.71570903110559 39.92292590034607 15.36, 116.7157140426478 39.92292970746958 15.36, 116.71571895396787 39.92293351445314 15.35, 116.71572396550846 39.92293732157533 15.35, 116.71572887682693 39.92294112855762 15.35, 116.71573388835341 39.92294483567432 15.34, 116.71573889989156 39.922948642794545 15.34, 116.71574391142887 39.922952449914106 15.33, 116.7157489229529 39.92295615702883 15.33, 116.71575383426735 39.92295996400789 15.32, 116.71575884578974 39.9229636711213 15.32, 116.7157638573238 39.92296747823824 15.32, 116.71576886884453 39.922971185350335 15.32, 11Line truncated
|
||||
val geoByteArray = DeflaterUtil.zipString(geometryStr)
|
||||
Log.e("qj","字节转化===${DeflaterUtil.unzipString(geoByteArray)}")
|
||||
mapController.animationHandler.zoomIn()
|
||||
}
|
||||
|
||||
@@ -1034,7 +1060,6 @@ class MainActivity : BaseActivity() {
|
||||
binding.mainActivitySnapshotRewind.isEnabled = value
|
||||
binding.mainActivitySnapshotNext.isEnabled = value
|
||||
binding.mainActivitySnapshotPause.isEnabled = value
|
||||
binding.mainActivitySnapshotFinish.isEnabled = value
|
||||
viewModel.cancelTrace()
|
||||
}
|
||||
|
||||
@@ -1149,7 +1174,6 @@ class MainActivity : BaseActivity() {
|
||||
}
|
||||
|
||||
private fun setIndoorGroupEnable(enable: Boolean) {
|
||||
binding.mainActivitySnapshotFinish.isEnabled = enable
|
||||
binding.mainActivityTraceSnapshotPoints.isEnabled = enable
|
||||
//binding.mainActivitySnapshotMediaFlag.isEnabled = enable
|
||||
binding.mainActivitySnapshotRewind.isEnabled = enable
|
||||
@@ -1223,10 +1247,10 @@ class MainActivity : BaseActivity() {
|
||||
/**
|
||||
* 隐藏更多信息面板
|
||||
*/
|
||||
fun backSignMoreInfo(){
|
||||
fun backSignMoreInfo() {
|
||||
val fragment =
|
||||
supportFragmentManager.findFragmentById(R.id.main_activity_sign_more_info_fragment)
|
||||
if(fragment!=null&&!fragment.isHidden){
|
||||
if (fragment != null && !fragment.isHidden) {
|
||||
supportFragmentManager.beginTransaction().remove(fragment).commit()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -70,6 +70,18 @@ import kotlin.concurrent.fixedRateTimer
|
||||
* 创建Activity全局viewmode
|
||||
*/
|
||||
|
||||
enum class LoadDataStatus {
|
||||
/**
|
||||
* 加载开始
|
||||
*/
|
||||
LOAD_DATA_STATUS_BEGIN,
|
||||
|
||||
/**
|
||||
* 加载结束
|
||||
*/
|
||||
LOAD_DATA_STATUS_FISISH,
|
||||
}
|
||||
|
||||
@HiltViewModel
|
||||
class MainViewModel @Inject constructor(
|
||||
private val mapController: NIMapController,
|
||||
@@ -97,6 +109,9 @@ class MainViewModel @Inject constructor(
|
||||
//地图点击捕捉到的轨迹列表
|
||||
val liveDataNILocationList = MutableLiveData<NiLocation>()
|
||||
|
||||
//加载数据
|
||||
val liveDataLoadData = MutableLiveData<LoadDataStatus>()
|
||||
|
||||
//左侧看板数据
|
||||
val liveDataSignList = MutableLiveData<List<SignBean>>()
|
||||
|
||||
@@ -251,8 +266,6 @@ class MainViewModel @Inject constructor(
|
||||
private val naviMutex = Mutex()
|
||||
private var testRealm: Realm? = null;
|
||||
|
||||
private var traceCount = 0
|
||||
|
||||
init {
|
||||
mapController.mMapView.vtmMap.events.bind(Map.UpdateListener { e, mapPosition ->
|
||||
when (e) {
|
||||
@@ -279,6 +292,10 @@ class MainViewModel @Inject constructor(
|
||||
object : OnGeoPointClickListener {
|
||||
override fun onMapClick(tag: String, point: GeoPoint) {
|
||||
if (tag == TAG) {
|
||||
//数据安装时不允许操作数据
|
||||
if(Constant.INSTALL_DATA){
|
||||
return
|
||||
}
|
||||
if (bMeasuringTool) {
|
||||
mapController.measureLayerHandler.addPoint(measuringType, point)
|
||||
} else {
|
||||
@@ -329,6 +346,7 @@ class MainViewModel @Inject constructor(
|
||||
})
|
||||
|
||||
viewModelScope.launch(Dispatchers.IO) {
|
||||
liveDataLoadData.postValue(LoadDataStatus.LOAD_DATA_STATUS_BEGIN)
|
||||
getTaskBean()
|
||||
//初始化选中的任务高亮高亮
|
||||
if (currentTaskBean != null) {
|
||||
@@ -337,6 +355,7 @@ class MainViewModel @Inject constructor(
|
||||
initQsRecordData()
|
||||
initNoteData()
|
||||
initNILocationData()
|
||||
liveDataLoadData.postValue(LoadDataStatus.LOAD_DATA_STATUS_FISISH)
|
||||
}
|
||||
sharedPreferences.registerOnSharedPreferenceChangeListener(this)
|
||||
MapParamUtils.setTaskId(sharedPreferences.getInt(Constant.SELECT_TASK_ID, -1))
|
||||
@@ -568,12 +587,18 @@ class MainViewModel @Inject constructor(
|
||||
for (location in list) {
|
||||
Constant.TRACE_COUNT++
|
||||
|
||||
if(Constant.TRACE_COUNT%Constant.TRACE_COUNT_MORE_TIME==0){
|
||||
mapController.markerHandle.addNiLocationMarkerItemRough(location)
|
||||
Log.e("qj","${Constant.TRACE_COUNT}===轨迹")
|
||||
}
|
||||
|
||||
if(Constant.TRACE_COUNT%Constant.TRACE_COUNT_TIME==0){
|
||||
mapController.markerHandle.addNiLocationMarkerItemSimple(location)
|
||||
Log.e("qj","${Constant.TRACE_COUNT}===轨迹")
|
||||
}
|
||||
|
||||
mapController.markerHandle.addNiLocationMarkerItem(location)
|
||||
|
||||
if (Constant.TRACE_COUNT % Constant.TRACE_COUNT_TIME == 0) {
|
||||
mapController.markerHandle.addNiLocationMarkerItemSimple(location)
|
||||
Log.e("qj", "$traceCount===轨迹")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -636,23 +661,22 @@ class MainViewModel @Inject constructor(
|
||||
lastNiLocaion!!.longitude
|
||||
)
|
||||
}
|
||||
//室内整理工具时不能进行轨迹存储,判断轨迹间隔要超过2.5并小于60米
|
||||
if (Constant.INDOOR_IP.isEmpty() && (disance == 0.0 || (disance > 2.5 && disance < 60))) {
|
||||
traceCount++
|
||||
//室内整理工具时不能进行轨迹存储,判断轨迹间隔要超过6并小于60米
|
||||
if (Constant.INDOOR_IP.isEmpty() && (disance == 0.0 || (disance > 6.0 && disance < 60))) {
|
||||
Log.e("jingo", "轨迹插入开始")
|
||||
CMLog.writeLogtoFile(MainViewModel::class.java.name, "insertTrace", "开始")
|
||||
CMLog.writeLogtoFile(MainViewModel::class.java.name,"insertTrace","开始")
|
||||
traceDataBase.niLocationDao.insert(location)
|
||||
mapController.markerHandle.addNiLocationMarkerItem(location)
|
||||
if (Constant.TRACE_COUNT % Constant.TRACE_COUNT_TIME == 0) {
|
||||
|
||||
if(Constant.TRACE_COUNT%Constant.TRACE_COUNT_TIME==0){
|
||||
mapController.markerHandle.addNiLocationMarkerItemSimple(location)
|
||||
}
|
||||
if(Constant.TRACE_COUNT%Constant.TRACE_COUNT_MORE_TIME==0){
|
||||
mapController.markerHandle.addNiLocationMarkerItemRough(location)
|
||||
}
|
||||
mapController.mMapView.vtmMap.updateMap(true)
|
||||
lastNiLocaion = location
|
||||
CMLog.writeLogtoFile(
|
||||
MainViewModel::class.java.name,
|
||||
"insertTrace",
|
||||
gson.toJson(location)
|
||||
)
|
||||
CMLog.writeLogtoFile(MainViewModel::class.java.name,"insertTrace",gson.toJson(location))
|
||||
Log.e("jingo", "轨迹插入结束")
|
||||
}
|
||||
}
|
||||
@@ -830,7 +854,7 @@ class MainViewModel @Inject constructor(
|
||||
*/
|
||||
private suspend fun captureLink(point: GeoPoint) {
|
||||
|
||||
if (captureLinkState) {
|
||||
if (captureLinkState||Constant.INSTALL_DATA) {
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -196,7 +196,7 @@ class PersonalCenterFragment(private var indoorDataListener: ((Boolean) -> Unit?
|
||||
// 定位到指定位置
|
||||
niMapController.mMapView.vtmMap.animator()
|
||||
// .animateTo(GeoPoint( 40.05108004733645, 116.29187746293708 ))
|
||||
.animateTo(GeoPoint(31.205913609396507, 121.56955739056055 ))
|
||||
.animateTo(GeoPoint(39.63769191655024, 115.58991663847937))
|
||||
}
|
||||
|
||||
R.id.personal_center_menu_open_all_layer -> {
|
||||
|
||||
+28
-2
@@ -11,6 +11,7 @@ import com.navinfo.omqs.bean.ScProblemTypeBean
|
||||
import com.navinfo.omqs.bean.ScRootCauseAnalysisBean
|
||||
import com.navinfo.omqs.bean.ScWarningCodeBean
|
||||
import com.navinfo.omqs.db.ImportOMDBHelper
|
||||
import com.navinfo.omqs.db.MultiPathsCallback
|
||||
import com.navinfo.omqs.db.RealmOperateHelper
|
||||
import com.navinfo.omqs.db.RoomAppDatabase
|
||||
import com.navinfo.omqs.tools.MetadataUtils
|
||||
@@ -152,11 +153,36 @@ class PersonalCenterViewModel @Inject constructor(
|
||||
viewModelScope.launch(Dispatchers.IO) {
|
||||
Log.d("OMQSApplication", "开始导入数据")
|
||||
if (task != null) {
|
||||
importOMDBHelper.importOmdbZipFile(importOMDBHelper.omdbFile, task, this)
|
||||
importOMDBHelper.importOmdbZipFile(importOMDBHelper.omdbFile, task, this,object :MultiPathsCallback<String>{
|
||||
override fun onProgress(value: Int) {
|
||||
}
|
||||
|
||||
override fun onResult(value: String) {
|
||||
}
|
||||
|
||||
override fun onError(t: Throwable) {
|
||||
}
|
||||
|
||||
override fun onComplete() {
|
||||
}
|
||||
})
|
||||
} else {
|
||||
val newTask = TaskBean()
|
||||
newTask.id = -1
|
||||
importOMDBHelper.importOmdbZipFile(importOMDBHelper.omdbFile, newTask, this)
|
||||
importOMDBHelper.importOmdbZipFile(importOMDBHelper.omdbFile, newTask, this,object :MultiPathsCallback<String>{
|
||||
override fun onProgress(value: Int) {
|
||||
|
||||
}
|
||||
|
||||
override fun onResult(value: String) {
|
||||
}
|
||||
|
||||
override fun onError(t: Throwable) {
|
||||
}
|
||||
|
||||
override fun onComplete() {
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
Log.d("OMQSApplication", "导入数据完成")
|
||||
|
||||
@@ -325,18 +325,19 @@ class TaskListAdapter(
|
||||
if (binding.taskProgressText.visibility != View.VISIBLE) binding.taskProgressText.visibility =
|
||||
View.VISIBLE
|
||||
binding.taskDownloadBtn.setText("安装中")
|
||||
Log.e("jingo", "更新进度条 ${taskBean.message}")
|
||||
val split = taskBean.message.split("/")
|
||||
if (split.size == 2) {
|
||||
try {
|
||||
val index = split[0].toInt()
|
||||
val count = split[1].toInt()
|
||||
binding.taskProgressText.text =
|
||||
"${index * 100 / count}%"
|
||||
Log.e("jingo", "更新进度条 $index====$count")
|
||||
binding.taskProgressText.text = "${index * 100 / count}%"
|
||||
} catch (e: Exception) {
|
||||
Log.e("jingo", "更新进度条 $e")
|
||||
}
|
||||
} else {
|
||||
binding.taskProgressText.text = "0%"
|
||||
binding.taskProgressText.text = taskBean.message
|
||||
}
|
||||
val errMsg = taskBean.errMsg
|
||||
if (errMsg != null && errMsg.isNotEmpty()) {
|
||||
|
||||
@@ -145,6 +145,17 @@ class TaskListFragment : BaseFragment() {
|
||||
binding.taskListRecyclerview.smoothScrollToPosition(position)
|
||||
}
|
||||
|
||||
viewModel.liveDataLoadTask.observe(viewLifecycleOwner){
|
||||
when(it){
|
||||
TaskLoadStatus.TASK_LOAD_STATUS_BEGIN->{
|
||||
showLoadingDialog("正在切换任务")
|
||||
}
|
||||
TaskLoadStatus.TASK_LOAD_STATUS_FISISH->{
|
||||
hideLoadingDialog()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
viewModel.liveDataCloseTask.observe(viewLifecycleOwner){
|
||||
when(it){
|
||||
TaskDelStatus.TASK_DEL_STATUS_BEGIN->{
|
||||
|
||||
@@ -59,6 +59,18 @@ enum class TaskDelStatus {
|
||||
TASK_DEL_STATUS_CANCEL,
|
||||
}
|
||||
|
||||
enum class TaskLoadStatus {
|
||||
/**
|
||||
* 加载开始
|
||||
*/
|
||||
TASK_LOAD_STATUS_BEGIN,
|
||||
|
||||
/**
|
||||
* 加载结束
|
||||
*/
|
||||
TASK_LOAD_STATUS_FISISH,
|
||||
}
|
||||
|
||||
@HiltViewModel
|
||||
class TaskViewModel @Inject constructor(
|
||||
private val networkService: NetworkService,
|
||||
@@ -90,6 +102,11 @@ class TaskViewModel @Inject constructor(
|
||||
*/
|
||||
val liveDataCloseTask = MutableLiveData<TaskDelStatus>()
|
||||
|
||||
/**
|
||||
* 用来确定是否加载
|
||||
*/
|
||||
val liveDataLoadTask = MutableLiveData<TaskLoadStatus>()
|
||||
|
||||
/**
|
||||
* 用来更新任务
|
||||
*/
|
||||
@@ -317,7 +334,11 @@ class TaskViewModel @Inject constructor(
|
||||
currentSelectTaskBean = taskBean
|
||||
|
||||
liveDataTaskLinks.value = taskBean.hadLinkDvoList
|
||||
|
||||
liveDataLoadTask.postValue(TaskLoadStatus.TASK_LOAD_STATUS_BEGIN)
|
||||
|
||||
showTaskLinks(taskBean)
|
||||
|
||||
//重新加载轨迹
|
||||
viewModelScope.launch(Dispatchers.IO) {
|
||||
Constant.TRACE_COUNT = 0
|
||||
@@ -328,22 +349,30 @@ class TaskViewModel @Inject constructor(
|
||||
|
||||
Constant.TRACE_COUNT ++
|
||||
|
||||
mapController.markerHandle.addNiLocationMarkerItem(it)
|
||||
if(Constant.TRACE_COUNT%Constant.TRACE_COUNT_MORE_TIME==0){
|
||||
mapController.markerHandle.addNiLocationMarkerItemRough(it)
|
||||
}
|
||||
|
||||
if(Constant.TRACE_COUNT%Constant.TRACE_COUNT_TIME==0){
|
||||
mapController.markerHandle.addNiLocationMarkerItemSimple(it)
|
||||
}
|
||||
|
||||
mapController.markerHandle.addNiLocationMarkerItem(it)
|
||||
|
||||
}
|
||||
liveDataLoadTask.postValue(TaskLoadStatus.TASK_LOAD_STATUS_FISISH)
|
||||
withContext(Dispatchers.Main){
|
||||
MapParamUtils.setTaskId(taskBean.id)
|
||||
Constant.currentSelectTaskFolder = File(Constant.USER_DATA_PATH + "/${taskBean.id}")
|
||||
Constant.currentSelectTaskConfig =
|
||||
RealmConfiguration.Builder().directory(Constant.currentSelectTaskFolder)
|
||||
.name("OMQS.realm").encryptionKey(Constant.PASSWORD).allowQueriesOnUiThread(true)
|
||||
.schemaVersion(2).build()
|
||||
MapParamUtils.setTaskConfig(Constant.currentSelectTaskConfig)
|
||||
mapController.layerManagerHandler.updateOMDBVectorTileLayer()
|
||||
mapController.mMapView.updateMap(true)
|
||||
}
|
||||
}
|
||||
MapParamUtils.setTaskId(taskBean.id)
|
||||
Constant.currentSelectTaskFolder = File(Constant.USER_DATA_PATH + "/${taskBean.id}")
|
||||
Constant.currentSelectTaskConfig =
|
||||
RealmConfiguration.Builder().directory(Constant.currentSelectTaskFolder)
|
||||
.name("OMQS.realm").encryptionKey(Constant.PASSWORD).allowQueriesOnUiThread(true)
|
||||
.schemaVersion(2).build()
|
||||
MapParamUtils.setTaskConfig(Constant.currentSelectTaskConfig)
|
||||
mapController.layerManagerHandler.updateOMDBVectorTileLayer()
|
||||
mapController.mMapView.updateMap(true)
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -120,6 +120,7 @@ dependencies {
|
||||
api 'org.locationtech.jts:jts-core:1.19.0'
|
||||
implementation 'com.squareup.okhttp3:okhttp:5.0.0-alpha.11'
|
||||
implementation 'com.squareup.okio:okio:3.3.0'
|
||||
implementation 'com.alibaba:fastjson:1.2.73'
|
||||
|
||||
implementation "com.fasterxml.jackson.core:jackson-annotations:2.9.9"
|
||||
implementation "com.fasterxml.jackson.core:jackson-core:2.9.9"
|
||||
|
||||
@@ -1558,11 +1558,6 @@
|
||||
<symbol repeat="false" repeat-start="0" repeat-gap="2000"
|
||||
src="@symbol" symbol-height="24" degree="90"></symbol>
|
||||
</m>
|
||||
<!-- 车信CLM -->
|
||||
<m v="OMDB_CLM_LANEINFO" >
|
||||
<symbol repeat="false" repeat-start="0" repeat-gap="2000"
|
||||
src="@symbol" symbol-height="24" degree="90"></symbol>
|
||||
</m>
|
||||
<!-- 杆状物 -->
|
||||
<m v="OMDB_POLE">
|
||||
<symbol src="assets:omdb/icon_pole_3006.svg" symbol-height="56" symbol-width="56"></symbol>
|
||||
@@ -2063,17 +2058,38 @@
|
||||
</m>
|
||||
</m>
|
||||
|
||||
<!-- zLevel -->
|
||||
<m v="OMDB_ZLEVEL">
|
||||
<m k="type" v="zlevelLine">
|
||||
<line stroke="#59feb8" width="0.2" />
|
||||
</m>
|
||||
<m k="type" v="zlevelName">
|
||||
<caption k="name" fill="#000000" stroke="#f1fe59" size="12" priority="0" ></caption>
|
||||
</m>
|
||||
<m k="linkPid">
|
||||
<circle radius="3" stroke="#000000" fill="#ffffff"></circle>
|
||||
</m>
|
||||
</m>
|
||||
|
||||
<!-- 车道类型 -->
|
||||
<m v="OMDB_LANE_TYPE_ACCESS">
|
||||
<m k="laneLinkPid">
|
||||
<line width="0.1" stroke="#cccccc" stipple-width="0.1" stipple-stroke="#cccccc"></line>
|
||||
<m k="bike">
|
||||
<line fix="true" width="3" stroke="#cccccc"></line>
|
||||
</m>
|
||||
<m k="type" v="s_2_p">
|
||||
<symbol src="assets:omdb/icon_2092_s.svg" symbol-height="32"
|
||||
<m k="type" v="s_acc">
|
||||
<symbol src="assets:omdb/icon_2092_acc_s.svg" symbol-height="32"
|
||||
symbol-width="32" gland="true"></symbol>
|
||||
</m>
|
||||
<m k="type" v="e_2_p">
|
||||
<symbol src="assets:omdb/icon_2092_e.svg" symbol-height="32"
|
||||
<m k="type" v="e_acc">
|
||||
<symbol src="assets:omdb/icon_2092_acc_e.svg" symbol-height="32"
|
||||
symbol-width="32" gland="true"></symbol>
|
||||
</m>
|
||||
<m k="type" v="s_dec">
|
||||
<symbol src="assets:omdb/icon_2092_dec_s.svg" symbol-height="32"
|
||||
symbol-width="32" gland="true"></symbol>
|
||||
</m>
|
||||
<m k="type" v="e_dec">
|
||||
<symbol src="assets:omdb/icon_2092_dec_e.svg" symbol-height="32"
|
||||
symbol-width="32" gland="true"></symbol>
|
||||
</m>
|
||||
</m>
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?><svg id="b" xmlns="http://www.w3.org/2000/svg" width="51" height="51" viewBox="0 0 51 51"><g id="c"><circle cx="25.5" cy="25.5" r="24.5" style="fill:#0e992b; stroke-width:0px;"/><path d="m25.5,2c13,0,23.5,10.5,23.5,23.5s-10.5,23.5-23.5,23.5S2,38.5,2,25.5,12.5,2,25.5,2m0-2h0C11.4,0,0,11.4,0,25.5h0c0,14.1,11.4,25.5,25.5,25.5h0c14.1,0,25.5-11.4,25.5-25.5h0C51,11.4,39.6,0,25.5,0h0Z" style="fill:#02441e; stroke-width:0px;"/><path d="m6.4,16.1c.2.1.7.6,1.1.9l1.2-1.4,4,3.6c.7.7.6,1,0,1.8l-.3.4-.9-.4.3-.4c.3-.4.3-.6-.1-1-.3-.3-2.7-2.5-3-2.7l-.7.8c2.1,2,2.8,3,3.6,5l-.9.3c-.6-1.8-1.3-2.8-3.3-4.6l-.6.8-.7-.6.7-.8c-.4-.4-.9-.8-1.1-1l.6-.6Zm4.3-3.6l5.4,4.6-.6.6-.5-.4-.9,1.1.5.4-.6.7-5.4-4.6,2-2.4Zm3.7,4.3l-3.6-3-.9,1.1,3.6,3,.9-1.1Z" style="fill:#fff; stroke-width:0px;"/><path d="m17.1,10.6c-.3-.4-1.1-1.1-1.5-1.4l.5-.6c.4.3,1.1.9,1.5,1.3l-.5.7Zm7.4,2.8v.9c-1.2.4-2.4.7-3.6,1-1.1.3-1.7.2-2.5-.4-.2.5-.5,1-.7,1.4l-.7-.6c.3-.5.6-.9.8-1.4l-.6-2.3-.9.2-.2-.9,1.7-.5.8,3.1c.7.6,1.2.7,2.3.4,1.3-.3,2.5-.7,3.7-1.1Zm-5.8.4c.6-.5,1.2-1.3,1.5-2l-1.5.4-.6-2.3,1.8-.5-.2-.6-2,.5-.2-.8,2-.5-.2-.8.8-.2.2.7,2.1-.5.2.8-2.1.5.2.6,1.8-.5.6,2.3-1.8.5v.5c.1,0,.3-.5.3-.5.5.2,1.5.6,2.2.8l-.2.9c-.6-.3-1.5-.7-2.1-.9l.4,1.6-.8.2-.4-1.6c-.3.7-.8,1.3-1.3,1.8l-.7-.6Zm.6-2.5l1-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1.5.6c-.6,1.5-1.7,3.5-2.4,4.5.3,0,1.1,0,1.7-.1.5-.9.9-1.7,1.2-2.4l1.4.6c-.9,2-2.6,4.9-3.4,6.2.6-.1,2-.4,2.4-.5v1.7c-.3,0-2.4.4-3.3.6-.4,0-.8.2-1.1.2l-.4-1.8c.6-.2.6-.3.9-.7.5-.6,1-1.5,1.5-2.4-.6,0-1.3,0-1.6.1-.3,0-.5,0-.8.1Zm16.1,2.2l-.6,1.8c-2.1-.8-3.7-1.7-5.1-2.8-.6.5-1.3,1-2.2,1.4,1.2.3,3.5,1.2,4.8,1.7l-.6,1.7c-1.1-.5-3.5-1.3-4.9-1.7l.4-1.4c-.7.4-1.4.7-2.2,1.1l-.8-1.6c1.8-.7,3.1-1.4,4.2-2.2-.6-.6-1.2-1.3-1.7-2.1-.4.7-1,1.3-1.5,1.9l-.9-1.2c1.4-1.5,2.8-4,3.4-5.7l1.5.4c-.2.4-.3.8-.5,1.3h5.2v1.7c-.9,1.5-1.7,2.6-2.8,3.8,1.2.8,2.6,1.5,4.4,2.1Zm-9.5,3.6c1.8.5,5.3,1.7,7.1,2.4l-.5,1.7c-1.8-.7-5.2-2-7.1-2.4l.5-1.7Zm1.7-9.2c.6.9,1.2,1.7,2,2.5.9-.8,1.6-1.7,2.2-2.7h-4.1v.3Z" style="fill:#fff; stroke-width:0px;"/></g></svg>
|
||||
|
After Width: | Height: | Size: 3.0 KiB |
@@ -0,0 +1 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?><svg id="b" xmlns="http://www.w3.org/2000/svg" width="51" height="51" viewBox="0 0 51 51"><g id="c"><path d="m25.5,50C12,50,1,39,1,25.5S12,1,25.5,1s24.5,11,24.5,24.5-11,24.5-24.5,24.5Z" style="fill:#0e992b; stroke-width:0px;"/><path d="m25.5,2c13,0,23.5,10.5,23.5,23.5s-10.5,23.5-23.5,23.5S2,38.5,2,25.5,12.5,2,25.5,2m0-2h0C11.4,0,0,11.4,0,25.5s11.4,25.5,25.5,25.5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6,0,8.5-.1Zm-3.2-11.7h-4.7v-1.7h6.4v6.1h-4.7v3.1c0,1,.2,1.2,1,1.2.4,0,.9,0,1.3,0,1,0,1.2-.2,1.3-1.1,0-.3.1-.8.1-1.3l1.6.6c0,.4,0,.7-.2,1.3-.3,1.8-.7,2.2-2.5,2.2-.7,0-1.5,0-2.2,0-1.7,0-2.2-.7-2.2-2.6v-5.2h4.7v-2.8Z" style="fill:#fff; stroke-width:0px;"/></g></svg>
|
||||
|
After Width: | Height: | Size: 2.8 KiB |
@@ -0,0 +1 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?><svg id="b" xmlns="http://www.w3.org/2000/svg" width="51" height="51" viewBox="0 0 51 51"><g id="c"><circle cx="25.5" cy="25.5" r="24.5" style="fill:#f24643; stroke-width:0px;"/><path d="m25.5,2c13,0,23.5,10.5,23.5,23.5s-10.5,23.5-23.5,23.5S2,38.5,2,25.5,12.5,2,25.5,2m0-2h0C11.4,0,0,11.4,0,25.5h0c0,14.1,11.4,25.5,25.5,25.5h0c14.1,0,25.5-11.4,25.5-25.5h0C51,11.4,39.6,0,25.5,0h0Z" style="fill:#510710; stroke-width:0px;"/><path d="m7.9,18.9c-.6-.3-1.8-.7-2.4-.9l.3-.8c.6.2,1.7.6,2.3.9l-.2.8Zm6.9-3.3c.2.2.4.4.6.7.6.8.6,1.1.3,1.3-.2.3-.6.4-1.5.2-.1,0-.2,0-.3-.1.1.6.2,1.2.2,1.9h-.8c0-.3,0-.5,0-.8l-1,1.1-2.1-1.8,1.2-1.4,1.8,1.5c0-.3,0-.6-.2-.9-.9-.5-1.9-1.2-3.2-2.1l-1.5,1.7,2.4,2c.7.6,1.6,1.8,1.9,2.7l-.9.2c-.3-.9-.8-1.7-1.5-2.3l-3-2.6,1.9-2.2-1-.7.5-.6.9.7.5-.6c-.3,0-.7,0-1,0v-.7c.4,0,.9,0,1.2,0v.4s.4-.5.4-.5l.6.5-1.1,1.3c.8.6,1.6,1.1,2.2,1.5-.3-.6-.7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1.2.3,3.5,1.2,4.8,1.7l-.6,1.7c-1.1-.5-3.5-1.3-4.9-1.7l.4-1.4c-.7.4-1.4.7-2.2,1.1l-.8-1.6c1.8-.7,3.1-1.4,4.2-2.2-.6-.6-1.2-1.3-1.7-2.1-.4.7-1,1.3-1.5,1.9l-.9-1.2c1.4-1.5,2.8-4,3.4-5.7l1.5.4c-.2.4-.3.8-.5,1.3h5.2v1.7c-.9,1.5-1.7,2.6-2.8,3.8,1.2.8,2.6,1.5,4.4,2.1Zm-9.5,3.6c1.8.5,5.3,1.7,7.1,2.4l-.5,1.7c-1.8-.7-5.2-2-7.1-2.4l.5-1.7Zm1.7-9.2c.6.9,1.2,1.7,2,2.5.9-.8,1.6-1.7,2.2-2.7h-4.1v.3Z" style="fill:#fff; stroke-width:0px;"/></g></svg>
|
||||
|
After Width: | Height: | Size: 3.4 KiB |
@@ -0,0 +1 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?><svg id="b" xmlns="http://www.w3.org/2000/svg" width="51" height="51" viewBox="0 0 51 51"><g id="c"><path d="m25.5,50C12,50,1,39,1,25.5S12,1,25.5,1s24.5,11,24.5,24.5-11,24.5-24.5,24.5Z" style="fill:#f24643; stroke-width:0px;"/><path d="m25.5,2c13,0,23.5,10.5,23.5,23.5s-10.5,23.5-23.5,23.5S2,38.5,2,25.5,12.5,2,25.5,2m0-2h0C11.4,0,0,11.4,0,25.5s11.4,25.5,25.5,25.5h0c14.1,0,25.5-11.4,25.5-25.5S39.6,0,25.5,0h0Z" style="fill:#510710; stroke-width:0px;"/><path d="m7.9,18.9c-.6-.3-1.8-.7-2.4-.9l.3-.8c.6.2,1.7.6,2.3.9l-.2.8Zm6.9-3.3c.2.2.4.4.6.7.6.8.6,1.1.3,1.3-.2.3-.6.4-1.5.2-.1,0-.2,0-.3-.1.1.6.2,1.2.2,1.9h-.8c0-.3,0-.5,0-.8l-1,1.1-2.1-1.8,1.2-1.4,1.8,1.5c0-.3,0-.6-.2-.9-.9-.5-1.9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2.1h2.4v1.6h-2.4v2.1h2.9v1.7h-2.6v2.3h2.4v1.7h-2.4v2.6c.6.2,1.4.2,2.3.3,2.8,0,5.6,0,8.5-.1Zm-3.2-11.7h-4.7v-1.7h6.4v6.1h-4.7v3.1c0,1,.2,1.2,1,1.2.4,0,.9,0,1.3,0,1,0,1.2-.2,1.3-1.1,0-.3.1-.8.1-1.3l1.6.6c0,.4,0,.7-.2,1.3-.3,1.8-.7,2.2-2.5,2.2-.7,0-1.5,0-2.2,0-1.7,0-2.2-.7-2.2-2.6v-5.2h4.7v-2.8Z" style="fill:#fff; stroke-width:0px;"/></g></svg>
|
||||
|
After Width: | Height: | Size: 3.1 KiB |
@@ -1 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?><svg id="b" xmlns="http://www.w3.org/2000/svg" width="131.3" height="131.3" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 131.3 131.3"><defs><linearGradient id="f" x1="63.4" y1="54.8" x2="68.2" y2="54.8" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#989898"/><stop offset="0" stop-color="#a3a3a3"/><stop offset=".1" stop-color="#c4c5c5"/><stop offset=".2" stop-color="#d8d9d9"/><stop offset=".3" stop-color="#e0e1e1"/><stop offset=".4" stop-color="#dbdcdc"/><stop offset=".5" stop-color="#cccece"/><stop offset=".6" stop-color="#b5b6b7"/><stop offset=".7" stop-color="#949697"/><stop offset=".8" stop-color="#6a6c6f"/><stop offset=".8" stop-color="#3f4246"/><stop offset="1" stop-color="#404247"/><stop offset="1" stop-color="#43434a"/></linearGradient><linearGradient id="g" x1="41.1" y1="26.7" x2="90.2" y2="26.7" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#afbacb"/><stop offset=".1" stop-color="#c1ccda"/><stop offset=".4" stop-color="#d9e6f0"/><stop offset=".5" stop-color="#e3f0f8"/><stop offset=".6" stop-color="#dde9f2"/><stop offset=".8" stop-color="#ccd8e4"/><stop offset="1" stop-color="#b1bbcc"/><stop offset="1" stop-color="#aeb8c9"/></linearGradient></defs><g id="c"><g><rect width="131.3" height="131.3" style="fill:none;"/><g><ellipse id="d" cx="65.7" cy="66.2" rx="14.4" ry="3.7" style="fill:#262d34; isolation:isolate; opacity:.2;"/><ellipse id="e" cx="65.7" cy="66.2" rx="7.5" ry="3" style="fill:#535a60;"/><path d="M65.7,42.6h0c1.4,0,2.6,1.2,2.6,2.6v19.2c0,1.4-1.1,2.5-2.5,2.5h-.3c-1.4,0-2.5-1.1-2.5-2.5v-19.3c0-1.4,1.2-2.6,2.6-2.6Z" style="fill:url(#f);"/><rect x="41.1" y="1" width="49" height="51.4" rx="24.5" ry="24.5" style="fill:url(#g); stroke:#8b9fae; stroke-miterlimit:10; stroke-width:1.1px;"/><rect x="41.7" y="3.3" width="48" height="48.5" rx="24" ry="24" style="fill:#f24643; stroke:#510710; stroke-miterlimit:10;"/><g><path d="M55.5,17.7l-2.3,2.6,1.2,1-.7,.7-1.2-1-2.5,2.9-.7-.6,2.5-2.9-1-.9-1.9,2.1-.7-.6c-.1-.6-.4-1.3-.6-2.1l-1.1,1.3-.7-.6,1.4-1.6c-.2-.5-.5-1-.7-1.3l.9-.5c.2,.3,.4,.7,.5,1.1l2.8-3.2,.7,.6-3.1,3.5c.3,.8,.6,1.5,.7,2l1.1-1.3-1.1-1,.7-.7,1.1,.9,1.7-1.9,.7,.6-1.7,1.9,1,.9,2.3-2.6,.7,.6Z" style="fill:#fff;"/><path d="M57.8,11.7c-.4-.4-1.2-1.2-1.7-1.5l.6-.7c.4,.3,1.2,1,1.6,1.4l-.6,.8Zm8,3.2v.9c-1.4,.4-2.7,.7-4.1,1-1.2,.3-1.8,.2-2.7-.5-.3,.5-.5,1-.8,1.5l-.8-.6c.3-.5,.6-1,.9-1.6l-.6-2.4-1,.2-.2-.9,1.8-.4,.8,3.3c.7,.7,1.3,.7,2.4,.5,1.4-.3,2.8-.7,4.1-1.1Zm-5-4.6l-2.2,.5-.2-.8,1.5-.4c-.2-.2-.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1-2.4l.5-1.7Zm1.7-9.2c.6,.9,1.2,1.7,2,2.5,.9-.8,1.6-1.7,2.2-2.7h-4.1v.3Z" style="fill:#fff;"/></g></g></g></svg>
|
||||
|
Before Width: | Height: | Size: 4.6 KiB |
@@ -1 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?><svg id="b" xmlns="http://www.w3.org/2000/svg" width="131.3" height="131.3" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 131.3 131.3"><defs><linearGradient id="f" x1="63.4" y1="54.8" x2="68.2" y2="54.8" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#989898"/><stop offset="0" stop-color="#a3a3a3"/><stop offset=".1" stop-color="#c4c5c5"/><stop offset=".2" stop-color="#d8d9d9"/><stop offset=".3" stop-color="#e0e1e1"/><stop offset=".4" stop-color="#dbdcdc"/><stop offset=".5" stop-color="#cccece"/><stop offset=".6" stop-color="#b5b6b7"/><stop offset=".7" stop-color="#949697"/><stop offset=".8" stop-color="#6a6c6f"/><stop offset=".8" stop-color="#3f4246"/><stop offset="1" stop-color="#404247"/><stop offset="1" stop-color="#43434a"/></linearGradient><linearGradient id="g" x1="41.1" y1="26.7" x2="90.2" y2="26.7" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#afbacb"/><stop offset=".1" stop-color="#c1ccda"/><stop offset=".4" stop-color="#d9e6f0"/><stop offset=".5" stop-color="#e3f0f8"/><stop offset=".6" stop-color="#dde9f2"/><stop offset=".8" stop-color="#ccd8e4"/><stop offset="1" stop-color="#b1bbcc"/><stop offset="1" stop-color="#aeb8c9"/></linearGradient></defs><g id="c"><g><rect width="131.3" height="131.3" style="fill:none;"/><g><ellipse id="d" cx="65.7" cy="66.2" rx="14.4" ry="3.7" style="fill:#262d34; isolation:isolate; opacity:.2;"/><ellipse id="e" cx="65.7" cy="66.2" rx="7.5" ry="3" style="fill:#535a60;"/><path d="M65.7,42.6h0c1.4,0,2.6,1.2,2.6,2.6v19.2c0,1.4-1.1,2.5-2.5,2.5h-.3c-1.4,0-2.5-1.1-2.5-2.5v-19.3c0-1.4,1.2-2.6,2.6-2.6Z" style="fill:url(#f);"/><rect x="41.1" y="1" width="49" height="51.4" rx="24.5" ry="24.5" style="fill:url(#g); stroke:#8b9fae; stroke-miterlimit:10; stroke-width:1.1px;"/><g><path d="M65.7,51.3c-12.9,0-23.5-10.5-23.5-23.5v-.6c0-12.9,10.5-23.5,23.5-23.5s23.5,10.5,23.5,23.5v.6c0,12.9-10.5,23.5-23.5,23.5Z" style="fill:#0e992b;"/><path d="M65.7,4.3c12.7,0,23,10.3,23,23v.6c0,12.7-10.3,23-23,23s-23-10.3-23-23v-.6c0-12.7,10.3-23,23-23m0-1h0c-13.2,0-24,10.7-24,24v.6c0,13.2,10.7,24,24,24h0c13.2,0,24-10.7,24-24v-.6c0-13.2-10.7-24-24-24h0Z" style="fill:#02441e;"/></g><g><path d="M55.5,17.7l-2.3,2.6,1.2,1-.7,.7-1.2-1-2.5,2.9-.7-.6,2.5-2.9-1-.9-1.9,2.1-.7-.6c-.1-.6-.4-1.3-.6-2.1l-1.1,1.3-.7-.6,1.4-1.6c-.2-.5-.5-1-.7-1.3l.9-.5c.2,.3,.4,.7,.5,1.1l2.8-3.2,.7,.6-3.1,3.5c.3,.8,.6,1.5,.7,2l1.1-1.3-1.1-1,.7-.7,1.1,.9,1.7-1.9,.7,.6-1.7,1.9,1,.9,2.3-2.6,.7,.6Z" style="fill:#fff;"/><path d="M57.8,11.7c-.4-.4-1.2-1.2-1.7-1.5l.6-.7c.4,.3,1.2,1,1.6,1.4l-.6,.8Zm8,3.2v.9c-1.4,.4-2.7,.7-4.1,1-1.2,.3-1.8,.2-2.7-.5-.3,.5-.5,1-.8,1.5l-.8-.6c.3-.5,.6-1,.9-1.6l-.6-2.4-1,.2-.2-.9,1.8-.4,.8,3.3c.7,.7,1.3,.7,2.4,.5,1.4-.3,2.8-.7,4.1-1.1Zm-5-4.6l-2.2,.5-.2-.8,1.5-.4c-.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.7,.7-.5,2.5,3.7-.7,.5-.5-.7-1.1,.7,.6,.8-.7,.5-.6-.8-1.4,.9-.5-.7,1.4-.9-.6-.9c-.8,.4-1.5,.5-2.5,.3v-.9Zm3.8,4.1l.4,.6c.3,.3,.4,.4,.8,.2l3-2,.5,.8-3.2,2.1c-.7,.5-1,.4-1.6-.4l-.4-.6,.6-.7Zm-.5-3.9l.6,.9,1.1-.7-.6-.9-.8,.6h-.2Zm1.1,4.2l-.5-.7,2.8-1.9,.5,.7-2.8,1.8Z" style="fill:#fff;"/></g><path d="M74.2,39.7l-.3,1.7c-2.8,.1-5.5,.2-8.3,.1-2.7,0-4.5-.6-5.4-2.5-.3,1-.6,2-1.1,3.1l-1.5-.6c1.1-2.5,1.6-4,1.6-7.6h1.6c0,1,0,1.9-.1,2.7,.3,1,.7,1.6,1.2,2.1v-5.7h-3.5v-1.7h3.2v-2.1h-2.6v-1.6h2.6v-2.1h1.7v2.1h2.4v1.6h-2.4v2.1h2.9v1.7h-2.6v2.3h2.4v1.7h-2.4v2.6c.6,.2,1.4,.2,2.3,.3,2.8,0,5.6,0,8.5-.1Zm-3.2-11.7h-4.7v-1.7h6.4v6.1h-4.7v3.1c0,1,.2,1.2,1,1.2,.4,0,.9,0,1.3,0,1,0,1.2-.2,1.3-1.1,0-.3,.1-.8,.1-1.3l1.6,.6c0,.4,0,.7-.2,1.3-.3,1.8-.7,2.2-2.5,2.2-.7,0-1.5,0-2.2,0-1.7,0-2.2-.7-2.2-2.6v-5.2h4.7v-2.8Z" style="fill:#fff;"/></g></g></g></svg>
|
||||
|
Before Width: | Height: | Size: 4.6 KiB |
+3
-2
@@ -3,6 +3,7 @@ package com.navinfo.collect.library.data.entity
|
||||
import android.util.Log
|
||||
import com.google.gson.Gson
|
||||
import com.google.gson.reflect.TypeToken
|
||||
import com.navinfo.collect.library.utils.DeflaterUtil
|
||||
import com.navinfo.collect.library.utils.GeometryTools
|
||||
import com.navinfo.collect.library.utils.GeometryToolsKt
|
||||
import com.navinfo.collect.library.utils.StrZipUtil
|
||||
@@ -79,11 +80,11 @@ open class ReferenceEntity() : RealmObject() {
|
||||
@Ignore
|
||||
var properties: RealmDictionary<String> = RealmDictionary()
|
||||
get() {
|
||||
if (propertiesDb.isNotEmpty() && field.isEmpty()) {
|
||||
if (propertiesDb != null && propertiesDb!!.isNotEmpty() && field.isEmpty()) {
|
||||
try {
|
||||
val gson = Gson()
|
||||
val type = object : TypeToken<RealmDictionary<String>>() {}.type
|
||||
field = gson.fromJson(StrZipUtil.uncompress(propertiesDb), type)
|
||||
field = gson.fromJson(DeflaterUtil.unzipString(propertiesDb), type)
|
||||
} catch (e: Exception) {
|
||||
Log.e("jingo","ReferenceEntity 转 properties $e")
|
||||
}
|
||||
|
||||
+5
-8
@@ -2,9 +2,10 @@ package com.navinfo.collect.library.data.entity
|
||||
|
||||
import android.os.Parcelable
|
||||
import android.util.Log
|
||||
import com.alibaba.fastjson.JSON
|
||||
import com.google.gson.Gson
|
||||
import com.google.gson.reflect.TypeToken
|
||||
import com.navinfo.collect.library.system.Constant
|
||||
import com.navinfo.collect.library.utils.DeflaterUtil
|
||||
import com.navinfo.collect.library.utils.GeometryTools
|
||||
import com.navinfo.collect.library.utils.GeometryToolsKt
|
||||
import com.navinfo.collect.library.utils.StrZipUtil
|
||||
@@ -13,13 +14,8 @@ import io.realm.RealmObject
|
||||
import io.realm.RealmSet
|
||||
import io.realm.annotations.Ignore
|
||||
import io.realm.annotations.Index
|
||||
import io.realm.annotations.PrimaryKey
|
||||
import kotlinx.parcelize.Parcelize
|
||||
import org.locationtech.jts.geom.Coordinate
|
||||
import org.locationtech.jts.geom.Geometry
|
||||
import org.oscim.core.MercatorProjection
|
||||
import java.util.*
|
||||
import java.util.zip.GZIPInputStream
|
||||
|
||||
/**
|
||||
* 渲染要素对应的实体
|
||||
@@ -82,11 +78,11 @@ open class RenderEntity() : RealmObject(), Parcelable {
|
||||
@Ignore
|
||||
var properties: RealmDictionary<String> = RealmDictionary()
|
||||
get() {
|
||||
if (propertiesDb != null && propertiesDb.isNotEmpty() && field.isEmpty()) {
|
||||
if (propertiesDb != null && propertiesDb!!.isNotEmpty()&& field.isEmpty()) {
|
||||
try {
|
||||
val gson = Gson()
|
||||
val type = object : TypeToken<RealmDictionary<String>>() {}.type
|
||||
field = gson.fromJson(StrZipUtil.uncompress(propertiesDb), type)
|
||||
field = gson.fromJson(DeflaterUtil.unzipString(propertiesDb), type)
|
||||
} catch (e: Exception) {
|
||||
Log.e("jingo","RenderEntity 转 properties $e")
|
||||
}
|
||||
@@ -112,6 +108,7 @@ open class RenderEntity() : RealmObject(), Parcelable {
|
||||
@Index
|
||||
var linkPid: String = "" // RenderEntity关联的linkPid集合(可能会关联多个)
|
||||
var linkRelation: LinkRelation? = null
|
||||
var referenceEntitys: RealmSet<ReferenceEntity>? = RealmSet()//
|
||||
|
||||
constructor(name: String) : this() {
|
||||
this.name = name
|
||||
|
||||
+60
-10
@@ -190,6 +190,37 @@ class MarkHandler(context: AppCompatActivity, mapView: NIMapView) :
|
||||
layer
|
||||
}
|
||||
|
||||
/**
|
||||
* 评测精简数据marker 图层
|
||||
*/
|
||||
private val niLocationItemizedLayerRough: ItemizedLayer by lazy {
|
||||
|
||||
val symbol = MarkerSymbol(niLocationBitmap, MarkerSymbol.HotspotPlace.CENTER)
|
||||
val layerRough = ItemizedLayer(
|
||||
mapView.vtmMap,
|
||||
symbol,
|
||||
)
|
||||
layerRough.setOnItemGestureListener(object : OnItemGestureListener<MarkerInterface> {
|
||||
override fun onItemSingleTapUp(index: Int, item: MarkerInterface?): Boolean {
|
||||
val tag = mMapView.listenerTagList.last()
|
||||
val listenerList = mMapView.listenerList[tag]
|
||||
if (listenerList != null) {
|
||||
for (listener in listenerList) {
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
override fun onItemLongPress(index: Int, item: MarkerInterface?): Boolean {
|
||||
return true
|
||||
}
|
||||
|
||||
})
|
||||
layerRough.isEnabled = false
|
||||
addLayer(layerRough, NIMapView.LAYER_GROUPS.OPERATE_MARKER)
|
||||
layerRough
|
||||
}
|
||||
|
||||
/**
|
||||
* 评测精简数据marker 图层
|
||||
*/
|
||||
@@ -206,14 +237,6 @@ class MarkHandler(context: AppCompatActivity, mapView: NIMapView) :
|
||||
val listenerList = mMapView.listenerList[tag]
|
||||
if (listenerList != null) {
|
||||
for (listener in listenerList) {
|
||||
/* if (listener is OnNiLocationItemListener) {
|
||||
listener.onNiLocation(
|
||||
tag,
|
||||
index,
|
||||
(niLocationItemizedLayerSimple.itemList[index] as MarkerItem).uid as NiLocation
|
||||
)
|
||||
break
|
||||
}*/
|
||||
}
|
||||
}
|
||||
return true
|
||||
@@ -333,11 +356,13 @@ class MarkHandler(context: AppCompatActivity, mapView: NIMapView) :
|
||||
qsRecordItemizedLayer.isEnabled = false
|
||||
}
|
||||
if (traceMarkerEnable) {
|
||||
niLocationItemizedLayer.isEnabled = mapPosition.getZoomLevel() in 17..20
|
||||
niLocationItemizedLayerSimple.isEnabled = mapPosition.getZoomLevel() in 12..16
|
||||
niLocationItemizedLayer.isEnabled = mapPosition.getZoomLevel() in 18..20
|
||||
niLocationItemizedLayerSimple.isEnabled = mapPosition.getZoomLevel() in 14..17
|
||||
niLocationItemizedLayerRough.isEnabled = mapPosition.getZoomLevel() in 12..13
|
||||
} else {
|
||||
niLocationItemizedLayer.isEnabled = false
|
||||
niLocationItemizedLayerSimple.isEnabled = false
|
||||
niLocationItemizedLayerRough.isEnabled = false
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -450,9 +475,11 @@ class MarkHandler(context: AppCompatActivity, mapView: NIMapView) :
|
||||
fun setTraceMarkEnable(enable: Boolean) {
|
||||
niLocationItemizedLayer.isEnabled = enable
|
||||
niLocationItemizedLayerSimple.isEnabled = enable
|
||||
niLocationItemizedLayerRough.isEnabled = enable
|
||||
traceMarkerEnable = enable
|
||||
niLocationItemizedLayer.populate()
|
||||
niLocationItemizedLayerSimple.populate()
|
||||
niLocationItemizedLayerRough.populate()
|
||||
mMapView.updateMap(true)
|
||||
}
|
||||
|
||||
@@ -604,6 +631,15 @@ class MarkHandler(context: AppCompatActivity, mapView: NIMapView) :
|
||||
niLocationItemizedLayerSimple.update()
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加质检数据marker
|
||||
*/
|
||||
fun addNiLocationMarkerItemRough(niLocation: NiLocation) {
|
||||
var geoMarkerItem = createNILocationBitmap(niLocation)
|
||||
niLocationItemizedLayerRough.addItem(geoMarkerItem)
|
||||
niLocationItemizedLayerRough.update()
|
||||
}
|
||||
|
||||
private fun createNILocationBitmap(niLocation: NiLocation): MarkerItem {
|
||||
|
||||
val direction: Double = niLocation.direction
|
||||
@@ -870,6 +906,8 @@ class MarkHandler(context: AppCompatActivity, mapView: NIMapView) :
|
||||
niLocationItemizedLayer.update()
|
||||
niLocationItemizedLayerSimple.removeAllItems()
|
||||
niLocationItemizedLayerSimple.update()
|
||||
niLocationItemizedLayerRough.removeAllItems()
|
||||
niLocationItemizedLayerRough.update()
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -896,6 +934,18 @@ class MarkHandler(context: AppCompatActivity, mapView: NIMapView) :
|
||||
}
|
||||
}
|
||||
|
||||
fun getNILocationItemizedLayerRoughSize(): Int {
|
||||
return niLocationItemizedLayerRough.itemList.size
|
||||
}
|
||||
|
||||
fun getNILocationRough(index: Int): NiLocation? {
|
||||
return if (index > -1 && index < getNILocationItemizedLayerRoughSize()) {
|
||||
((niLocationItemizedLayerRough.itemList[index]) as MarkerItem).uid as NiLocation
|
||||
} else {
|
||||
null
|
||||
}
|
||||
}
|
||||
|
||||
fun getNILocation(index: Int): NiLocation? {
|
||||
return if (index > -1 && index < getNILocationItemizedLayerSize()) {
|
||||
((niLocationItemizedLayer.itemList[index]) as MarkerItem).uid as NiLocation
|
||||
|
||||
+11
-1
@@ -4,10 +4,13 @@ import static org.oscim.core.MercatorProjection.latitudeToY;
|
||||
import static org.oscim.core.MercatorProjection.longitudeToX;
|
||||
|
||||
import android.os.Build;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.annotation.RequiresApi;
|
||||
|
||||
import com.navinfo.collect.library.data.entity.RenderEntity;
|
||||
import com.navinfo.collect.library.enums.DataCodeEnum;
|
||||
import com.navinfo.collect.library.utils.GeometryTools;
|
||||
|
||||
import org.locationtech.jts.geom.Coordinate;
|
||||
import org.locationtech.jts.geom.Geometry;
|
||||
@@ -103,7 +106,14 @@ public class OMDBDataDecoder extends TileDecoder {
|
||||
processCoordinateArray(multiPoint.getGeometryN(i).getCoordinates(), false);
|
||||
}
|
||||
} else if (geometry instanceof LineString) {
|
||||
processLineString((LineString) geometry);
|
||||
//将车道中心进行转化面渲染
|
||||
if(layerName!=null&&layerName.equals(DataCodeEnum.OMDB_LANE_LINK_LG.name())){
|
||||
Log.e("qj","车道中心线转化开始");
|
||||
processPolygon((Polygon) GeometryTools.createGeometry(GeometryTools.computeLine(0.000035,0.000035,geometry.toString())));
|
||||
Log.e("qj","车道中心线转化结束");
|
||||
}else{
|
||||
processLineString((LineString) geometry);
|
||||
}
|
||||
} else if (geometry instanceof MultiLineString) {
|
||||
MultiLineString multiLineString = (MultiLineString) geometry;
|
||||
for (int i = 0; i < multiLineString.getNumGeometries(); i++) {
|
||||
|
||||
+11
-1
@@ -4,10 +4,13 @@ import static org.oscim.core.MercatorProjection.latitudeToY;
|
||||
import static org.oscim.core.MercatorProjection.longitudeToX;
|
||||
|
||||
import android.os.Build;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.annotation.RequiresApi;
|
||||
|
||||
import com.navinfo.collect.library.data.entity.ReferenceEntity;
|
||||
import com.navinfo.collect.library.enums.DataCodeEnum;
|
||||
import com.navinfo.collect.library.utils.GeometryTools;
|
||||
|
||||
import org.locationtech.jts.geom.Coordinate;
|
||||
import org.locationtech.jts.geom.Geometry;
|
||||
@@ -100,7 +103,14 @@ public class OMDBReferenceDecoder extends TileDecoder {
|
||||
processCoordinateArray(multiPoint.getGeometryN(i).getCoordinates(), false);
|
||||
}
|
||||
} else if (geometry instanceof LineString) {
|
||||
processLineString((LineString) geometry);
|
||||
//将车道中心进行转化面渲染
|
||||
if(layerName!=null&&layerName.equals(DataCodeEnum.OMDB_LANE_LINK_LG.name())){
|
||||
Log.e("qj","车道中心线转化开始");
|
||||
processPolygon((Polygon)GeometryTools.createGeometry(GeometryTools.computeLine(0.000035,0.000035,geometry.toString())));
|
||||
Log.e("qj","车道中心线转化结束");
|
||||
}else{
|
||||
processLineString((LineString) geometry);
|
||||
}
|
||||
} else if (geometry instanceof MultiLineString) {
|
||||
MultiLineString multiLineString = (MultiLineString) geometry;
|
||||
for (int i = 0; i < multiLineString.getNumGeometries(); i++) {
|
||||
|
||||
@@ -0,0 +1,218 @@
|
||||
package com.navinfo.collect.library.utils;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.zip.Deflater;
|
||||
import java.util.zip.Inflater;
|
||||
import org.apache.commons.net.util.Base64;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.zip.DataFormatException;
|
||||
import java.util.zip.Deflater;
|
||||
import java.util.zip.Inflater;
|
||||
|
||||
/**
|
||||
* DeflaterUtils 压缩字符串
|
||||
*/
|
||||
|
||||
public class DeflaterUtil{
|
||||
|
||||
private DeflaterUtil() {
|
||||
|
||||
}
|
||||
|
||||
private static final int BUFFER_SIZE = 8192;
|
||||
|
||||
/**
|
||||
* 压缩
|
||||
*/
|
||||
|
||||
public static String zipString(String unzipString) {
|
||||
|
||||
/*
|
||||
|
||||
* https://www.yiibai.com/javazip/javazip_deflater.html#article-start
|
||||
|
||||
* 0 ~ 9 压缩等级 低到高
|
||||
|
||||
* public static final int BEST_COMPRESSION = 9; 最佳压缩的压缩级别。
|
||||
|
||||
* public static final int BEST_SPEED = 1; 压缩级别最快的压缩。
|
||||
|
||||
* public static final int DEFAULT_COMPRESSION = -1; 默认压缩级别。
|
||||
|
||||
* public static final int DEFAULT_STRATEGY = 0; 默认压缩策略。
|
||||
|
||||
* public static final int DEFLATED = 8; 压缩算法的压缩方法(目前唯一支持的压缩方法)。
|
||||
|
||||
* public static final int FILTERED = 1; 压缩策略最适用于大部分数值较小且数据分布随机分布的数据。
|
||||
|
||||
* public static final int FULL_FLUSH = 3; 压缩刷新模式,用于清除所有待处理的输出并重置拆卸器。
|
||||
|
||||
* public static final int HUFFMAN_ONLY = 2; 仅用于霍夫曼编码的压缩策略。
|
||||
|
||||
* public static final int NO_COMPRESSION = 0; 不压缩的压缩级别。
|
||||
|
||||
* public static final int NO_FLUSH = 0; 用于实现最佳压缩结果的压缩刷新模式。
|
||||
|
||||
* public static final int SYNC_FLUSH = 2; 用于清除所有未决输出的压缩刷新模式; 可能会降低某些压缩算法的压缩率。
|
||||
|
||||
*/
|
||||
|
||||
//使用指定的压缩级别创建一个新的压缩器。
|
||||
|
||||
Deflater deflater = new Deflater(Deflater.BEST_COMPRESSION);
|
||||
|
||||
//设置压缩输入数据。
|
||||
|
||||
deflater.setInput(unzipString.getBytes(StandardCharsets.UTF_8));
|
||||
|
||||
//当被调用时,表示压缩应该以输入缓冲区的当前内容结束。
|
||||
|
||||
deflater.finish();
|
||||
|
||||
final byte[] bytes = new byte[512];
|
||||
|
||||
ByteArrayOutputStream outputStream = new ByteArrayOutputStream(512);
|
||||
|
||||
try {
|
||||
|
||||
while (!deflater.finished()) {
|
||||
|
||||
//压缩输入数据并用压缩数据填充指定的缓冲区。
|
||||
|
||||
int length = deflater.deflate(bytes);
|
||||
|
||||
outputStream.write(bytes, 0, length);
|
||||
|
||||
}
|
||||
|
||||
deflater.end();
|
||||
|
||||
return Base64.encodeBase64String(outputStream.toByteArray());
|
||||
|
||||
}catch (Exception e){
|
||||
return null;
|
||||
}finally {
|
||||
try {
|
||||
outputStream.close();
|
||||
}catch (Exception e){
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 解压缩
|
||||
*/
|
||||
|
||||
public static String unzipString(String zipString) {
|
||||
|
||||
byte[] decode = Base64.decodeBase64(zipString);
|
||||
|
||||
//创建一个新的解压缩器 https://www.yiibai.com/javazip/javazip_inflater.html
|
||||
|
||||
Inflater inflater = new Inflater();
|
||||
|
||||
//设置解压缩的输入数据。
|
||||
|
||||
inflater.setInput(decode);
|
||||
|
||||
final byte[] bytes = new byte[512];
|
||||
|
||||
ByteArrayOutputStream outputStream = new ByteArrayOutputStream(512);
|
||||
|
||||
try {
|
||||
|
||||
//finished() 如果已到达压缩数据流的末尾,则返回true。
|
||||
|
||||
while (!inflater.finished()) {
|
||||
|
||||
//将字节解压缩到指定的缓冲区中。
|
||||
|
||||
int length = inflater.inflate(bytes);
|
||||
|
||||
outputStream.write(bytes, 0, length);
|
||||
|
||||
}
|
||||
|
||||
} catch (DataFormatException e) {
|
||||
|
||||
e.printStackTrace();
|
||||
|
||||
return null;
|
||||
|
||||
} finally {
|
||||
|
||||
//关闭解压缩器并丢弃任何未处理的输入。
|
||||
|
||||
inflater.end();
|
||||
|
||||
}
|
||||
|
||||
try {
|
||||
|
||||
return outputStream.toString("UTF-8");
|
||||
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
|
||||
e.printStackTrace();
|
||||
|
||||
return null;
|
||||
|
||||
}finally {
|
||||
try {
|
||||
outputStream.close();
|
||||
}catch (Exception e){
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
public static byte[] compress(byte[] bytes) {
|
||||
if (bytes == null) {
|
||||
throw new NullPointerException("bytes is null");
|
||||
}
|
||||
int lenght = 0;
|
||||
Deflater deflater = new Deflater();
|
||||
deflater.setInput(bytes);
|
||||
deflater.finish();
|
||||
byte[] outputBytes = new byte[BUFFER_SIZE];
|
||||
try (ByteArrayOutputStream bos = new ByteArrayOutputStream()) {
|
||||
while (!deflater.finished()) {
|
||||
lenght = deflater.deflate(outputBytes);
|
||||
bos.write(outputBytes, 0, lenght);
|
||||
}
|
||||
deflater.end();
|
||||
return bos.toByteArray();
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException("Deflater compress error", e);
|
||||
}
|
||||
}
|
||||
|
||||
public static byte[] decompress(byte[] bytes) {
|
||||
if (bytes == null) {
|
||||
throw new NullPointerException("bytes is null");
|
||||
}
|
||||
int length = 0;
|
||||
Inflater inflater = new Inflater();
|
||||
inflater.setInput(bytes);
|
||||
byte[] outputBytes = new byte[BUFFER_SIZE];
|
||||
try (ByteArrayOutputStream bos = new ByteArrayOutputStream();) {
|
||||
while (!inflater.finished()) {
|
||||
length = inflater.inflate(outputBytes);
|
||||
if (length == 0) {
|
||||
break;
|
||||
}
|
||||
bos.write(outputBytes, 0, length);
|
||||
}
|
||||
inflater.end();
|
||||
return bos.toByteArray();
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException("Deflater decompress error", e);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
+1
-1
Submodule vtm updated: c046e788f5...ee88167c7d.
Reference in new issue
Block a user