java 电子围栏_电子围栏

交易的经纬度,电子围栏的经纬度以及围栏半径

http://blog.csdn.net/kidoo1012/article/details/70214328

比例尺控件:

http://lbsyun.baidu.com/jsdemo.htm#b0_2

应用编号:10591825

百度地图key:hK3Iy5AzEroNSBC9v3CtPXzsREA9fF6E

经纬度定位:http://lbsyun.baidu.com/jsdemo.htm#i8_4

http://lbsyun.baidu.com/jsdemo.htm#d0_1

device_storage

DEVICE_OUT_STORAGE

device_bind

mer_info

select t.sn, t.device_info from mpi_order t where t.device_info is not null;

select a.* from device_storage a left join DEVICE_OUT_STORAGE b on a.sn = b.sn where a.pkid=’14091118282210000001′;

select b.* from DEVICE_OUT_STORAGE b left join device_storage a on b.sn = a.sn where a.pkid=’14091118282210000001′;

select b.* from DEVICE_OUT_STORAGE b where b.sn=’Q0NL01083832′;

select t.* from device_storage t where t.pkid=’14091118282210000001′;

两个经纬度之间的距离:

https://www.cnblogs.com/xinzheng/p/5667364.html

public static double GetDistance(double lng1, double lat1, double lng2, double lat2)

{

double radLat1 = lat1 * RAD;

double radLat2 = lat2 * RAD;

double a = radLat1 – radLat2;

double b = (lng1 – lng2) * RAD;

double s = 2 * Math.Asin(Math.Sqrt(Math.Pow(Math.Sin(a / 2), 2) +

Math.Cos(radLat1) * Math.Cos(radLat2) * Math.Pow(Math.Sin(b / 2), 2)));

s = s * EARTH_RADIUS;

s = Math.Round(s * 10000) / 10000;

return s;

}

public String getLatLngDistance(LatLng start, LatLng end){

//自己实现距离算法:

/**

* 计算两点之间距离

* @param start

* @param end

* @return String  多少m ,  多少km

*/

double lat1 = (Math.PI/180)*start.latitude;

double lat2 = (Math.PI/180)*end.latitude;

double lon1 = (Math.PI/180)*start.longitude;

double lon2 = (Math.PI/180)*end.longitude;

//       double Lat1r = (Math.PI/180)*(gp1.getLatitudeE6()/1E6);

//       double Lat2r = (Math.PI/180)*(gp2.getLatitudeE6()/1E6);

//       double Lon1r = (Math.PI/180)*(gp1.getLongitudeE6()/1E6);

//       double Lon2r = (Math.PI/180)*(gp2.getLongitudeE6()/1E6);

//地球半径

double R = 6371.004;

//两点间距离 m,如果想要米的话,结果*1000就可以了

double dis =  Math.acos(Math.sin(lat1)*Math.sin(lat2)+Math.cos(lat1)*Math.cos(lat2)*Math.cos(lon2-lon1))*R;

NumberFormat nFormat = NumberFormat.getNumberInstance();  //数字格式化对象

if(dis < 1){               //当小于1千米的时候用,用米做单位保留一位小数

nFormat.setMaximumFractionDigits(1);    //已可以设置为0,这样跟百度地图APP中计算的一样

dis *= 1000;

return nFormat.format(dis)+”m”;

}else{

nFormat.setMaximumFractionDigits(2);

return nFormat.format(dis)+”km”;

}

}

转载自:https://blog.csdn.net/Xiaomingbubu3/article/details/82109290

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值