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

 Conflicts:
	collect-library/build.gradle
This commit is contained in:
squallzhjch
2023-04-21 14:23:29 +08:00
14 changed files with 411 additions and 28 deletions

View File

@@ -14,4 +14,59 @@ open class OMDBEntity(): RealmObject() {
this.table = table
this.properties = properties
}
}
}
class HAD_LINK() {
var LINK_PID: String = ""
var MESH: String = ""
var S_NODE_PID: String = ""
var E_NODE_PID: String = ""
var GEOMETRY: String = ""
}
class HAD_LINK_KIND() {
var LINK_PID: String = ""
var MESH: String = ""
var KIND: Int = 0
var GEOMETRY: String = ""
}
class HAD_LINK_DIRECT() {
var LINK_PID: String = ""
var MESH: String = ""
var DIRECT: Int = 0
var GEOMETRY: String = ""
}
class HAD_SPEEDLIMIT() {
var SPEED_ID: String = ""
var MESH: String = ""
var LINK_PID: String = ""
var GEOMETRY: String = ""
var DIRECT: Int = 0
var SPEED_FLAG: Int = 0
var MAX_SPEED: Int = 0
var MIN_SPEED: Int = 0
}
class HAD_SPEEDLIMIT_COND() {
var SPEED_COND_ID: String = ""
var MESH: String = ""
var LINK_PID: String = ""
var GEOMETRY: String = ""
var DIRECT: Int = 0
var SPEED_FLAG: Int = 0
var MAX_SPEED: Int = 0
var SPEED_DEPENDENT: Int = 0
var VEHICLE_TYPE: Int = 0
var VALID_PERIOD: String = ""
}
class HAD_SPEEDLIMIT_VAR() {
var SPEED_VAR_ID: String = ""
var MESH: String = ""
var LINK_PID: String = ""
var GEOMETRY: String = ""
var DIRECT: Int = 0
var LOCATION: String = ""
}

View File

@@ -10,14 +10,16 @@ import io.realm.annotations.PrimaryKey
import org.locationtech.jts.geom.Coordinate
import org.locationtech.jts.geom.Geometry
import org.oscim.core.MercatorProjection
import java.util.*
/**
* 渲染要素对应的实体
* */
open class RenderEntity(): RealmObject() {
@PrimaryKey
var id: Long = 0 // id
var id: String = UUID.randomUUID().toString() // id
lateinit var name: String //要素名
lateinit var table: String //要素表名
var code: Int = 0 // 要素编码
var geometry: String = ""
get() = field
@@ -27,7 +29,7 @@ open class RenderEntity(): RealmObject() {
GeometryToolsKt.getTileXByGeometry(value, tileX)
GeometryToolsKt.getTileYByGeometry(value, tileY)
}
lateinit var properties: RealmDictionary<String?>
var properties: RealmDictionary<String?> = RealmDictionary()
val tileX: RealmSet<Int> = RealmSet() // x方向的tile编码
val tileY: RealmSet<Int> = RealmSet() // y方向的tile编码

View File

@@ -326,6 +326,26 @@ public class GeometryTools {
return point;
}
/**
* 根据经纬度构建一个Point类型的数据
*
* @param lon 经度
* @param lat 纬度
* @return Point类型的数据
*/
public static org.locationtech.jts.geom.Point createPoint(double lon, double lat) {
// 创建Coordinate对象
Coordinate coordinate = new Coordinate(lon, lat);
// 创建GeometryFactory对象
GeometryFactory geometryFactory = new GeometryFactory();
// 创建Point对象
return geometryFactory.createPoint(coordinate);
}
/**
* 点几何转换为GeoPoint

View File

@@ -11,12 +11,12 @@ class GeometryToolsKt {
/**
* 根据给定的geometry计算其横跨的20级瓦片Y值
*/
fun getTileYByGeometry(wkt: String, tileYSet: MutableSet<Int?>) {
fun getTileYByGeometry(wkt: String, tileYSet: MutableSet<Int>) {
val reader = WKTReader()
val geometry = reader.read(wkt);
var tileYSet: MutableSet<Int?>? = tileYSet
var tileYSet: MutableSet<Int>? = tileYSet
val startTime = System.currentTimeMillis()
if (tileYSet == null) {
tileYSet = RealmSet()
@@ -55,11 +55,11 @@ class GeometryToolsKt {
/**
* 根据给定的geometry计算其横跨的20级瓦片X值
*/
fun getTileXByGeometry(wkt: String, tileXSet: MutableSet<Int?>) {
fun getTileXByGeometry(wkt: String, tileXSet: MutableSet<Int>) {
val reader = WKTReader()
val geometry = reader.read(wkt);
var tileXSet: MutableSet<Int?>? = tileXSet
var tileXSet: MutableSet<Int>? = tileXSet
val startTime = System.currentTimeMillis()
if (tileXSet == null) {
tileXSet = RealmSet()