Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/google-maps/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google maps 绘制谷歌路线图:修复路线中的错误_Google Maps_Gps_Geocoding - Fatal编程技术网

Google maps 绘制谷歌路线图:修复路线中的错误

Google maps 绘制谷歌路线图:修复路线中的错误,google-maps,gps,geocoding,Google Maps,Gps,Geocoding,现在我正在开发一个移动应用程序,它在一定的时间间隔内获取gps位置并将位置数据发送到服务器。服务器根据这些信息绘制谷歌路线图 请帮我解决以下情况 有时,在相反路线上标记的gps坐标实际移动,使路线完全错误 例如,我乘飞机旅行 但我明白了 在平行道路上提取/标记点B 我怎样才能解决这个问题 试试亚历山大图书馆的route drow 编译'com.github.jd:library:1.1.0' 例如: private void startRouting(){ LatLng原点=新LatLng

现在我正在开发一个移动应用程序,它在一定的时间间隔内获取gps位置并将位置数据发送到服务器。服务器根据这些信息绘制谷歌路线图

请帮我解决以下情况

有时,在相反路线上标记的gps坐标实际移动,使路线完全错误

例如,我乘飞机旅行

但我明白了

在平行道路上提取/标记点B


我怎样才能解决这个问题

试试亚历山大图书馆的route drow

编译'com.github.jd:library:1.1.0'

例如:

private void startRouting(){
LatLng原点=新LatLng(18.01455,-77.499333);
LatLng目的地=新LatLng(18.0145600,-77.491333);
路由=new Routing.Builder()
.travelMode(路由、travelMode、驾驶)
.备选路线(错误)
.withListener(新路由侦听器(){
@凌驾
路由失败时公共无效(路由例外e){
Log.e(“onRoutingFailure:,e.getMessage());
}
@凌驾
在RoutingStart()上公开作废{
}
@凌驾
public void on RoutingSuccess(ArrayList routes,int shortestRouteIndex){
if(routes!=null&&routes.size()>0){
用于(路线:路线){
List latlngs=route.getPoints();
试一试{
随机rnd=新随机();
int color=color.argb(200,rnd.nextInt(256),rnd.nextInt(256),0);
/*int color1=Color.argb(225,rnd.nextInt(256),rnd.nextInt(256),rnd.nextInt(256));
int color2=Color.argb(225,rnd.nextInt(256),rnd.nextInt(256),rnd.nextInt(256));
int color3=Color.argb(225,rnd.nextInt(256),rnd.nextInt(256),rnd.nextInt(256))*/
mMap.addPolyline(新的PolylineOptions().addAll(latlngs).color(color).width(12.0f));
}捕获(例外e){
e、 printStackTrace();
Log.e(“onRoutingSuccess:,e.getMessage());
Toast.makeText(MainActivity.this,“发生内部错误!”,Toast.LENGTH_SHORT.show();
}
}
//showBottomSheet(routes.get(shortestRouteIndex));
}
}
@凌驾
路由上的公共无效已取消(){
Log.e(“onRoutingCancelled:,“Routing cancelled”);
}
})
.航路点(起点、终点)
.build();
routing.execute();

}
是否将该点移动到正确的道路上?如果您有太多数据需要手动执行,则需要创建一个算法来检测错误点并修复它(这并不容易)。@geocodezip您是否知道删除错误点的任何类似算法或逻辑。如果我知道,我会向您指出。