增加车道中心线扩充面业务

This commit is contained in:
qiji4215 2023-09-26 16:14:30 +08:00
parent 4b91feca22
commit 1f34a8f306
9 changed files with 46 additions and 16 deletions

View File

@ -523,6 +523,7 @@
"table": "OMDB_LANE_LINK_LG",
"code": 5001,
"name": "车道中心线",
"catch":false,
"checkLinkId": false,
"zoomMin": 18,
"zoomMax": 20,

View File

@ -6,7 +6,6 @@ import com.navinfo.collect.library.data.entity.RenderEntity
import com.navinfo.collect.library.utils.GeometryTools
import com.navinfo.omqs.Constant
import io.realm.Realm
import io.realm.RealmConfiguration
import org.json.JSONArray
import org.json.JSONObject
import org.locationtech.jts.algorithm.Angle
@ -583,9 +582,9 @@ class ImportPreProcess {
angleReference.renderEntityId = renderEntity.id
angleReference.name = "${renderEntity.name}车道中线面"
angleReference.table = renderEntity.table
angleReference.geometry = renderEntity.geometry
angleReference.geometry = GeometryTools.computeLine(0.00002,0.00002,renderEntity.geometry)
angleReference.properties["qi_table"] = renderEntity.table
angleReference.properties["width"] = "3"
angleReference.properties["widthProperties"] = "3"
angleReference.zoomMin = renderEntity.zoomMin
angleReference.zoomMax = renderEntity.zoomMax
angleReference.taskId = renderEntity.taskId

View File

@ -14,6 +14,7 @@ import com.google.gson.Gson
import com.google.gson.reflect.TypeToken
import com.navinfo.collect.library.data.entity.RenderEntity
import com.navinfo.collect.library.data.entity.TaskBean
import com.navinfo.collect.library.utils.GeometryTools
import com.navinfo.omqs.Constant
import com.navinfo.omqs.bean.LoginUserBean
import com.navinfo.omqs.bean.SysUserBean
@ -132,6 +133,7 @@ class LoginViewModel @Inject constructor(
}
//不指定IO会在主线程里运行
jobLogin = viewModelScope.launch(Dispatchers.IO) {
//Log.e("qj", "computeline==${GeometryTools.computeLine(0.003,0.003,"LINESTRING(116.2730063860964 40.09052257957624 36.75, 116.27376497186042 40.090072453495395 38.34, 116.27413076766412 40.089855289361786 39.01, 116.27417239035157 40.08983061650492 39.15, 116.27466896728139 40.089535645040385 39.99, 116.2751211296483 40.089267551829636 40.67, 116.27545352868347 40.089070581974944 40.98, 116.27589660200627 40.088807594767246 41.28, 116.27604819769634 40.088718103405185 41.34, 116.27667570485863 40.08834486145473 41.43, 116.2770275412774 40.08813642434714 41.36, 116.27745673745146 40.087882150865546 41.14, 116.27778797172138 40.08768490714857 40.89, 116.2781675465249 40.087459905560266 40.45, 116.2783819045443 40.087332076220086 40.02, 116.27880692426884 40.0870801193608 39.32, 116.27943180930261 40.08670963506418 38.04, 116.27977508323622 40.08650562397605 37.39, 116.28016410016664 40.08627485623695 36.77, 116.28057924586821 40.0860283164225 36.29)")}")
loginCheck(context, userName, password)
}

View File

@ -1,9 +1,6 @@
package com.navinfo.omqs.ui.activity.map
import android.app.Activity
import android.content.ClipData
import android.content.ClipboardManager
import android.content.Context
import android.content.Intent
import android.os.Build
import android.os.Bundle
@ -11,7 +8,6 @@ import android.speech.tts.TextToSpeech
import android.util.Log
import android.view.MotionEvent
import android.view.View
import android.view.View.OnLongClickListener
import android.widget.EditText
import android.widget.TextView
import android.widget.Toast
@ -27,9 +23,9 @@ import com.blankj.utilcode.util.ClipboardUtils
import com.google.android.material.dialog.MaterialAlertDialogBuilder
import com.google.android.material.tabs.TabLayout
import com.navinfo.collect.library.data.entity.RenderEntity
import com.navinfo.collect.library.data.entity.TaskBean
import com.navinfo.collect.library.map.NIMapController
import com.navinfo.collect.library.map.handler.MeasureLayerHandler
import com.navinfo.collect.library.utils.GeometryTools
import com.navinfo.omqs.Constant
import com.navinfo.omqs.R
import com.navinfo.omqs.bean.ImportConfig
@ -39,7 +35,6 @@ import com.navinfo.omqs.databinding.ActivityMainBinding
import com.navinfo.omqs.http.offlinemapdownload.OfflineMapDownloadManager
import com.navinfo.omqs.tools.LayerConfigUtils
import com.navinfo.omqs.ui.activity.BaseActivity
import com.navinfo.omqs.ui.dialog.LoadingDialog
import com.navinfo.omqs.ui.fragment.console.ConsoleFragment
import com.navinfo.omqs.ui.fragment.itemlist.ItemListFragment
import com.navinfo.omqs.ui.fragment.offlinemap.OfflineMapFragment
@ -792,7 +787,9 @@ class MainActivity : BaseActivity() {
* zoomin
*/
fun zoomInOnclick(view: View) {
mapController.animationHandler.zoomIn()
Log.e("qj", "computeline==${GeometryTools.computeLine(0.00003,0.00003,"LINESTRING(116.2730063860964 40.09052257957624 36.75, 116.27376497186042 40.090072453495395 38.34, 116.27413076766412 40.089855289361786 39.01, 116.27417239035157 40.08983061650492 39.15, 116.27466896728139 40.089535645040385 39.99, 116.2751211296483 40.089267551829636 40.67, 116.27545352868347 40.089070581974944 40.98, 116.27589660200627 40.088807594767246 41.28, 116.27604819769634 40.088718103405185 41.34, 116.27667570485863 40.08834486145473 41.43, 116.2770275412774 40.08813642434714 41.36, 116.27745673745146 40.087882150865546 41.14, 116.27778797172138 40.08768490714857 40.89, 116.2781675465249 40.087459905560266 40.45, 116.2783819045443 40.087332076220086 40.02, 116.27880692426884 40.0870801193608 39.32, 116.27943180930261 40.08670963506418 38.04, 116.27977508323622 40.08650562397605 37.39, 116.28016410016664 40.08627485623695 36.77, 116.28057924586821 40.0860283164225 36.29)")}")
//mapController.animationHandler.zoomIn()
}
/**

View File

@ -2,6 +2,7 @@ package com.navinfo.omqs.ui.fragment.tasklist
import android.annotation.SuppressLint
import android.graphics.Color
import android.text.TextUtils
import android.util.Log
import android.view.LayoutInflater
import android.view.View
@ -225,6 +226,9 @@ class TaskListAdapter(
binding.taskUploadBtn.stopAnimator()
binding.taskUploadBtn.setText("重新同步")
binding.taskUploadBtn.setProgress(100)
if(!TextUtils.isEmpty(taskBean.errMsg)){
Toast.makeText(binding.root.context,taskBean.errMsg,Toast.LENGTH_LONG).show()
}
}
FileUploadStatus.NONE -> {

View File

@ -503,7 +503,9 @@ class TaskViewModel @Inject constructor(
}
}
}
realm.close()
if(result==1){
liveDataTaskUpload.postValue(map)
withContext(Dispatchers.Main) {
val mDialog = FirstDialog(context)
mDialog.setTitle("提示?")
@ -517,6 +519,7 @@ class TaskViewModel @Inject constructor(
mDialog.show()
}
}else if(result==2){
liveDataTaskUpload.postValue(map)
withContext(Dispatchers.Main) {
val mDialog = FirstDialog(context)
mDialog.setTitle("提示?")
@ -537,7 +540,6 @@ class TaskViewModel @Inject constructor(
map[taskBean] = true
liveDataTaskUpload.postValue(map)
}
realm.close()
}
}

View File

@ -1587,12 +1587,12 @@
<!--车道中心线-->
<m v="OMDB_LANE_LINK_LG">
<m k="width" v="~">
<line stroke="#7A88A0" width="2.8" />
<!--
<line stroke="#7A88A0" width="2.5" />
-->
<m k="widthProperties">
<area use="obj-area" stroke="#7A88A0" repeat="true" src="assets:omdb/icon_5001_1.png" longEdge="t"></area>
</m>
<!-- <m k="width" v="~">
<line stroke="#4624FF" width="0.1" />
</m>-->
</m>
<!-- 检查点 -->

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

View File

@ -2,6 +2,7 @@ package com.navinfo.collect.library.utils;
import android.graphics.Point;
import android.os.Build;
import android.text.TextUtils;
import android.util.Log;
import org.locationtech.jts.geom.Coordinate;
@ -13,6 +14,8 @@ import org.locationtech.jts.geom.MultiPoint;
import org.locationtech.jts.geom.MultiPolygon;
import org.locationtech.jts.geom.Polygon;
import org.locationtech.jts.io.WKTReader;
import org.locationtech.jts.operation.buffer.BufferOp;
import org.locationtech.jts.operation.buffer.BufferParameters;
import org.locationtech.jts.operation.linemerge.LineMerger;
import org.oscim.core.GeoPoint;
import org.oscim.core.MercatorProjection;
@ -1505,6 +1508,28 @@ public class GeometryTools {
}
/**
* @param distLeft 单位km
* @param distRight 单位km
* @param wkt 几何
* @return
*/
public static String computeLine(Double distLeft,Double distRight,String wkt){
if(!TextUtils.isEmpty(wkt)){
Geometry lineString1 = GeometryTools.createGeometry(wkt);
BufferParameters parameters1 = new BufferParameters();
parameters1.setEndCapStyle(BufferParameters.CAP_FLAT);
parameters1.setSingleSided(true);
Geometry buffer = BufferOp.bufferOp(lineString1, distLeft, parameters1);
Geometry buffer2 = BufferOp.bufferOp(lineString1, -distRight, parameters1);
String bufferWkt = buffer.union(buffer2).toString();
Log.e("qj",bufferWkt);
return bufferWkt;
}
return "";
}
public static FootAndDistance pointToLineDistance(GeoPoint point, Geometry geometry) {
//定义垂线
FootAndDistance pointPairDistance = new FootAndDistance(point);