建立一个算法,通过四组lat长度来寻找一个多边形...并且通过当前经纬度来查找一组lat长度是否属于该多边形。但目前的经纬度并不准确。在android中使用GPS和网络系统来跟踪当前的经纬度。想用GPS经纬度建立考勤跟踪系统
public void find current_lat_long(){
com.example.gps.AppLocationService appLocationService = new com.example.gps.AppLocationService(
Map_Location.this);
Location gpsLocation = appLocationService
.getLocation(LocationManager.GPS_PROVIDER);
Location nwLocation = appLocationService
.getLocation(LocationManager.NETWORK_PROVIDER);
if (gpsLocation != null) {
latitude_gps_calc_lat = gpsLocation.getLatitude();
longitude_gpa_calc_lng = gpsLocation.getLongitude();
constant.lat=String.valueOf(gpsLocation.getLatitude());
constant.longitude=String.valueOf(gpsLocation.getLongitude());
constant.flag_gps=false;
String latlong_gps = String.valueOf(gpsLocation.getLatitude())+String.valueOf(gpsLocation.getLongitude());
// lat1_string=constant.lat;
// long_1_string=constant.longitude;
lat4_string=constant.lat;
long_4_string=constant.longitude;
return true;
}
else if (nwLocation != null)
{
latitude_network_provider = nwLocation.getLatitude();
longitude_network_provider = nwLocation.getLongitude();
constant.flag_network=false;
latlong__network_provider =String.valueOf(latitude_network_provider)+String.valueOf(longitude_network_provider);
constant.lat=String.valueOf(latitude_network_provider);
constant.longitude=String.valueOf(longitude_network_provider);
lat4.setText(constant.lat+constant.longitude);
lat4_string=constant.lat;
long_4_string=constant.longitude;
return true;
}
}
请帮忙找准确的经纬度长时间追踪Lat Long网属于特定的多边形。
那你到底要?请说明你的需求 – 2014-11-25 05:47:11
你想找到那些经纬度长点吗?或者检查一个新点是否属于这个多边形? – 2014-11-25 05:49:39
只是模糊了你想要做什么的图片,请** **点**你的要求,或编码怀疑等 – nobalG 2014-11-25 05:54:36