Merge branch 'master' of https://gitlab.navinfo.com/CollectVehicle/OneMapQS
Conflicts: collect-library/src/main/java/com/navinfo/collect/library/map/source/OMDBTileSource.java vtm
This commit is contained in:
@@ -9,6 +9,7 @@ import androidx.room.Update;
|
||||
|
||||
import com.navinfo.collect.library.data.entity.Element;
|
||||
import com.navinfo.collect.library.data.entity.NiLocation;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
@@ -42,13 +43,16 @@ public interface INiLocationDao {
|
||||
List<NiLocation> findList(int minx, int maxx, int miny, int maxy);
|
||||
|
||||
@Query("SELECT * FROM niLocation where tilex>=:minx and tilex<=:maxx and tiley>=:miny and tiley <=:maxy and time>=:startTime and time<=:endTime")
|
||||
List<NiLocation> timeTofindList(int minx, int maxx, int miny, int maxy,long startTime,long endTime);
|
||||
List<NiLocation> timeTofindList(int minx, int maxx, int miny, int maxy, long startTime, long endTime);
|
||||
|
||||
@Query("SELECT * FROM niLocation")
|
||||
List<NiLocation> findAll();
|
||||
|
||||
@Query("SELECT * FROM niLocation where time>=:startTime and time<=:endTime and taskId=:taskId")
|
||||
List<NiLocation> taskIdAndTimeTofindList(String taskId,long startTime,long endTime);
|
||||
List<NiLocation> taskIdAndTimeTofindList(String taskId, long startTime, long endTime);
|
||||
|
||||
@Query("SELECT * FROM niLocation where timeStamp>:startTime limit:limit ")
|
||||
List<NiLocation> findListWithStartTime(long startTime, int limit);
|
||||
|
||||
@Query("SELECT * FROM niLocation where taskId =:taskId")
|
||||
List<NiLocation> findToTaskIdAll(String taskId);
|
||||
|
||||
@@ -37,6 +37,9 @@ enum class DataCodeEnum(var tableName: String, var code: String) {
|
||||
OMDB_RDBOUND_BOUNDARYTYPE("道路边界类型", "2083"),
|
||||
OMDB_LANE_CONSTRUCTION("车道施工", "2090"),
|
||||
OMDB_BRIDGE("桥", "2201"),
|
||||
OMDB_BRIDGE_1("固定桥", "2201-1"),
|
||||
OMDB_BRIDGE_2("可移动桥", "2201-2"),
|
||||
OMDB_BRIDGE_3("跨线天桥", "2201-2"),
|
||||
OMDB_TUNNEL("隧道", "2202"),
|
||||
OMDB_ROUNDABOUT("环岛", "2204"),
|
||||
OMDB_LINK_FORM1("道路形态1", "2205"),
|
||||
|
||||
@@ -26,6 +26,11 @@ class LocationLayerHandler(context: AppCompatActivity, mapView: NIMapView) :
|
||||
private var bFirst = true
|
||||
private val mLocationLayer: LocationLayer = LocationLayer(mMapView.vtmMap)
|
||||
private lateinit var locationClient: LocationClient
|
||||
|
||||
/**
|
||||
* 定位测试
|
||||
*/
|
||||
private var naviLocationTest = false
|
||||
// private var niLocationListener: NiLocationListener by lazy{
|
||||
//
|
||||
// }
|
||||
@@ -64,6 +69,10 @@ class LocationLayerHandler(context: AppCompatActivity, mapView: NIMapView) :
|
||||
//获取经纬度坐标类型,以LocationClientOption中设置过的坐标类型为准
|
||||
// val coorType = it.coorType
|
||||
//获取定位类型、定位错误返回码,具体信息可参照类参考中BDLocation类中的说明
|
||||
//定位测试开始,后续不再处理
|
||||
if (naviLocationTest)
|
||||
return@MyLocationListener
|
||||
|
||||
val errorCode = it.locType
|
||||
mCurrentLocation = it
|
||||
mLocationLayer.setPosition(it.latitude, it.longitude, it.radius)
|
||||
@@ -215,7 +224,7 @@ private class MyLocationListener(callback: (BDLocation) -> Unit) : BDAbstractLoc
|
||||
val call = callback;
|
||||
override fun onReceiveLocation(location: BDLocation) {
|
||||
call(location)
|
||||
Log.e("jingo", "定位结果:速度=" + location.speed +" 方向=" + location.direction)
|
||||
Log.e("jingo", "定位结果:速度=" + location.speed + " 方向=" + location.direction)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
package com.navinfo.collect.library.map.source;
|
||||
|
||||
import com.navinfo.collect.library.system.Constant;
|
||||
|
||||
import org.oscim.map.Viewport;
|
||||
import org.oscim.tiling.ITileDataSource;
|
||||
import org.oscim.tiling.OverzoomTileDataSource;
|
||||
|
||||
public class OMDBReferenceTileSource extends RealmDBTileSource {
|
||||
private OMDBReferenceDataSource omdbReferenceTileSource;
|
||||
@@ -18,7 +15,8 @@ public class OMDBReferenceTileSource extends RealmDBTileSource {
|
||||
@Override
|
||||
public ITileDataSource getDataSource() {
|
||||
//return new OverzoomTileDataSource(new OMDBReferenceDataSource(), Constant.OVER_ZOOM);
|
||||
return new OverzoomTileDataSource(omdbReferenceTileSource, Constant.OVER_ZOOM);
|
||||
// return new OverzoomTileDataSource(omdbReferenceTileSource, Constant.OVER_ZOOM);
|
||||
return omdbReferenceTileSource;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -81,8 +81,8 @@ public class OMDBTileDataSource implements ITileDataSource {
|
||||
// 数据记录的tile号是以正外接tile号列表,此处过滤并未与当前tile相交的数据
|
||||
if (!listResult.isEmpty()) {
|
||||
Polygon tilePolygon = GeometryTools.getTilePolygon(tile);
|
||||
System.out.println("第一条数据的最小x值:" + listResult.get(0).getTileX().stream().min(Integer::compare).get());
|
||||
System.out.println("当前tile的:" + listResult.get(0).getTileX().stream().min(Integer::compare).get());
|
||||
// System.out.println("第一条数据的最小x值:" + listResult.get(0).getTileX().stream().min(Integer::compare).get());
|
||||
// System.out.println("当前tile的:" + listResult.get(0).getTileX().stream().min(Integer::compare).get());
|
||||
listResult = listResult.stream().filter((RenderEntity renderEntity) -> renderEntity.getWkt().intersects(tilePolygon))
|
||||
/*过滤数据,只有最小x(屏幕的最小x或数据的最小x会被渲染,跨Tile的其他数据不再重复渲染)*/
|
||||
// .filter((RenderEntity renderEntity) -> MercatorProjection.longitudeToTileX(viewport.fromScreenPoint(0,0).getLongitude(), (byte) Constant.DATA_ZOOM) == currentTileX || renderEntity.getTileX().stream().min(Integer::compare).get() == currentTileX)
|
||||
|
||||
@@ -3,11 +3,9 @@ package com.navinfo.collect.library.map.source;
|
||||
import android.util.Log;
|
||||
|
||||
import com.navinfo.collect.library.data.entity.RenderEntity;
|
||||
import com.navinfo.collect.library.system.Constant;
|
||||
|
||||
import org.oscim.map.Viewport;
|
||||
import org.oscim.tiling.ITileDataSource;
|
||||
import org.oscim.tiling.OverzoomTileDataSource;
|
||||
|
||||
import io.realm.Realm;
|
||||
|
||||
@@ -23,7 +21,8 @@ public class OMDBTileSource extends RealmDBTileSource {
|
||||
@Override
|
||||
public ITileDataSource getDataSource() {
|
||||
// return new OverzoomTileDataSource(new OMDBTileDataSource(), Constant.OVER_ZOOM);
|
||||
return omdbTileDataSource;
|
||||
// return new OverzoomTileDataSource(omdbTileDataSource, Constant.OVER_ZOOM);
|
||||
return omdbTileDataSource;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user