package com.genersoft.iot.vmp.utils; 
 | 
  
 | 
import java.io.BufferedReader; 
 | 
import java.io.InputStreamReader; 
 | 
import java.io.OutputStream; 
 | 
import java.net.Socket; 
 | 
import java.util.Base64; 
 | 
  
 | 
import com.genersoft.iot.vmp.gb28181.bean.BaiduPoint; 
 | 
import org.slf4j.Logger; 
 | 
import org.slf4j.LoggerFactory; 
 | 
  
 | 
public class GpsUtil { 
 | 
  
 | 
    private static Logger logger = LoggerFactory.getLogger(GpsUtil.class); 
 | 
  
 | 
    public static BaiduPoint Wgs84ToBd09(String xx, String yy) { 
 | 
  
 | 
  
 | 
        double lng = Double.parseDouble(xx); 
 | 
        double lat = Double.parseDouble(yy); 
 | 
        Double[] gcj02 = Coordtransform.WGS84ToGCJ02(lng, lat); 
 | 
        Double[] doubles = Coordtransform.GCJ02ToBD09(gcj02[0], gcj02[1]); 
 | 
        BaiduPoint bdPoint= new BaiduPoint(); 
 | 
        bdPoint.setBdLng(doubles[0] + ""); 
 | 
        bdPoint.setBdLat(doubles[1] + ""); 
 | 
        return bdPoint; 
 | 
    } 
 | 
  
 | 
    /** 
 | 
     * BASE64解码 
 | 
     * @param str 
 | 
     * @return string 
 | 
     */ 
 | 
    public static byte[] decode(String str) { 
 | 
        byte[] bt = null; 
 | 
        final Base64.Decoder decoder = Base64.getDecoder(); 
 | 
        bt = decoder.decode(str); // .decodeBuffer(str); 
 | 
        return bt; 
 | 
    } 
 | 
} 
 |