123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465 |
- //import com.google.gson.Gson;
- //
- //import java.io.FileNotFoundException;
- //import java.util.ArrayList;
- //import java.util.HashMap;
- //import java.util.List;
- //import java.util.Map;
- //
- //public class ExchaneMain {
- //
- // static Map minXYMap;
- //
- // static List<Map> areaList = new ArrayList<>();
- //
- // public static void main(String[] args) throws FileNotFoundException {
- //
- //// getTransDistance("C:\\Users\\16s01\\Desktop\\GPS\\trans\\text.txt");
- // getTransDistance("/Users/haoqianpan/file/programfile/gpsexchange/GPS/trans/text.txt");
- //
- // printArea();
- //
- // printYard();
- //
- // printTml();
- //
- // printBaiscCor();
- //
- // calTemp();
- //
- //
- //
- //
- // }
- //
- // public static void getTransDistance(String dataInputFilePath) throws FileNotFoundException {
- // ReadData readData = new ReadData();
- // readData.setFilePath(dataInputFilePath);
- // List<Map> gpsCorList = readData.readData();
- //
- // int pointsNum = gpsCorList.size();
- //
- //
- // int xm = Integer.MAX_VALUE;
- // int ym = Integer.MAX_VALUE;
- //
- // for (int i = 0 ; i < pointsNum;i++){
- // Map map;
- // map = gpsCorList.get(i);
- // double lat = Double.parseDouble(map.get("lat").toString());
- // double lon = Double.parseDouble(map.get("lon").toString());
- //
- //// System.out.println("lat: " + lat + " lon: " + lon);
- // //墨卡托转换为平面坐标.
- // double[] corArray = new double[2];
- // corArray = GpsConvertMethod.MCT84Bl2xy(lon,lat);
- // System.out.println(corArray[0] + " " + corArray[1]);
- //
- // Map mapTemp = new HashMap();
- // mapTemp.put("x",(int)corArray[0]);
- // mapTemp.put("y",(int)corArray[1]);
- //
- //
- // //平面坐标旋转
- // double[] normalcorArray = new double[2];
- // normalcorArray = GpsConvertMethod.xy2normalxy(corArray[0],corArray[1]);
- //
- //
- // //旋转以后的坐标
- // double normalX = normalcorArray[0];
- // double normalY = normalcorArray[1];
- //
- // System.out.println(normalX + " " + normalY);
- //
- // //找到最小值
- //
- // if (normalX < xm) {
- //
- // xm = (int)Math.ceil(normalX);
- //
- // }
- //
- // if (normalY < ym) {
- //
- // ym = (int)Math.ceil(normalY);
- //
- // }
- //
- // Map normalmapTemp = new HashMap();
- //
- // normalmapTemp.put("x",normalX);
- //
- // normalmapTemp.put("y",normalY);
- // }
- //
- // Map resultMap = new HashMap();
- //
- // resultMap.put("minX",xm - 121);
- //
- // resultMap.put("minY",ym - 12);
- //
- // minXYMap = resultMap;
- //
- // }
- //
- // public static void printArea() throws FileNotFoundException {
- // String sgAName = "首钢A区";
- // String sgBName = "首钢B区";
- // String sgCName = "首钢C区";
- // String sgDBName = "首钢待磅区";
- //
- // String[] areaFileInputPath = new String[4];
- //
- // String[] areaFileOutPutPath = new String[4];
- //
- // String[] areaName = new String[4];
- //
- // String areaFileInputBasicPath ="/Users/haoqianpan/file/programfile/gpsexchange/GPS/area/areaIn";
- //
- // String areaFileOutputBasicPath ="/Users/haoqianpan/file/programfile/gpsexchange/GPS/area/out/areaOut";
- //
- // for (int i = 0 ; i < 4;i++){
- //
- // areaFileInputPath[i] = areaFileInputBasicPath + "-" + (i+1) + ".txt";
- //
- // areaFileOutPutPath[i] = areaFileOutputBasicPath + "-" + (i+1) + ".txt";
- //
- // };
- //
- // areaName[0] = sgAName;
- // areaName[1] = sgBName;
- // areaName[2] = sgCName;
- // areaName[3] = sgDBName;
- //
- //
- // for (int i = 0 ; i < 4 ; i++){
- //
- // Exchange exchange = new Exchange();
- // exchange.setDataInputFilePath(areaFileInputPath[i]);
- // exchange.setMinXY(minXYMap);
- // exchange.setDataOutPutFilePath(areaFileOutPutPath[i]);
- // exchange.execute();
- // Map areaMap = exchange.printArea(areaName[i]);
- // areaList.add(areaMap);
- //
- // }
- // }
- //
- // public static void printYard() throws FileNotFoundException {
- //
- // String[] yardName = {"BY01","BY02","BY03","BY04","BY05","BY06","AY01","AY02","AY03","AY04","AY05","AY06","AY07","CY01","DY01"};
- // String[] yardId = {"首钢B区-Y01","首钢B区-Y02","首钢B区-Y03","首钢B区-Y04","首钢B区-Y05","首钢B区-Y06","首钢A区-Y01","首钢A区-Y02","首钢A区-Y03","首钢A区-Y04","首钢A区-Y05","首钢A区-Y06","首钢A区-Y07","首钢C区-Y01","首钢待磅区-Y01"};
- // String[] yardInputPath = new String[15];
- // String[] yardOutputPath = new String[15];
- // String yardBasicInPutPath = "/Users/haoqianpan/file/programfile/gpsexchange/GPS/yard/yardIn";
- // String yardBasicOutPutPath = "/Users/haoqianpan/file/programfile/gpsexchange/GPS/yard/out/yardOut";
- //
- // for (int i = 0 ; i < 15;i++){
- // yardInputPath[i] = yardBasicInPutPath + "-" + (i+1) + ".txt";
- // yardOutputPath[i] = yardBasicOutPutPath + "-" + (i+1) + ".txt";
- // };
- //
- // for (int i = 0 ; i < 15; i++){
- // Exchange exchange = new Exchange();
- // exchange.setMinXY(minXYMap);
- // exchange.setDataInputFilePath(yardInputPath[i]);
- // exchange.setDataOutPutFilePath(yardOutputPath[i]);
- // exchange.execute();
- // Map yardMap = exchange.printYard(yardName[i],yardId[i]);
- // areaList.add(yardMap);
- // }
- // }
- //
- //
- // public static void printBaiscCor() throws FileNotFoundException {
- // String basicCorOutPutPath = "/Users/haoqianpan/file/programfile/gpsexchange/GPS/basic/out/basicOut.txt";
- //
- // Map basicCor =new HashMap();
- //
- // basicCor.put("angle",55.5);
- //
- // basicCor.put("corRevise",minXYMap);
- //
- // Exchange exchange = new Exchange();
- //
- // exchange.setDataOutPutFilePath(basicCorOutPutPath);
- //
- // exchange.printCor(basicCor);
- //
- //
- // }
- //
- //
- // public static void printTml() throws FileNotFoundException {
- //
- //
- // ////////////////////////////////////
- //
- // String tmlBasicInPutPath = "/Users/haoqianpan/file/programfile/gpsexchange/GPS/tml/in/tmlIn.txt";
- //
- // String tmlBasicOutPutPath = "/Users/haoqianpan/file/programfile/gpsexchange/GPS/tml/out/tmlOut.txt";
- //
- // Exchange exchange = new Exchange();
- //
- // exchange.setMinXY(minXYMap);
- //
- // exchange.setDataInputFilePath(tmlBasicInPutPath);
- //
- // exchange.setDataOutPutFilePath(tmlBasicOutPutPath);
- //
- // exchange.execute();
- //
- // List<Map> tmlCorList = exchange.corAfterTransList;
- //
- // ////////////////////////////////////
- //
- // List<Map> roadInfoMapList = getRoadData();
- //
- // List<Map> trackInfoMapList = getTrackData();
- //
- // List<Map> buildingInfoMapList = getBuildingData();
- //
- // Map resultMap = new HashMap();
- //
- // resultMap.put("TRACK",trackInfoMapList);
- //
- // resultMap.put("ROAD",roadInfoMapList);
- //
- // resultMap.put("BUILDING",buildingInfoMapList);
- //
- // resultMap.put("POINTS",tmlCorList);
- //
- // ////////////////////
- // exchange.printTml(resultMap);
- // ////////////////////
- //
- // }
- //
- // public static List<Map> getRoadData() throws FileNotFoundException {
- //
- // String[] roadName = {"R01","R02","R03","R04","R05","R06","R07","R08","R09","R10"};
- // String[] roadDirection = {"DOWN","UP","UP","UP","UP","UP","UP","UP","LEFT","RIGHT"};
- // String[] roadInputPath = new String[10];
- // String[] roadOutputPath = new String[10];
- // String roadBasicInPutPath = "/Users/haoqianpan/file/programfile/gpsexchange/GPS/road/in/roadIn";
- // String roadBasicOutPutPath = "/Users/haoqianpan/file/programfile/gpsexchange/GPS/road/out/roadOut";
- //
- // List<Map> roadInfoMapList = new ArrayList<>();
- //
- // for (int i = 0 ; i < 10;i++){
- // roadInputPath[i] = roadBasicInPutPath + "-" + (i+1) + ".txt";
- // roadOutputPath[i] = roadBasicOutPutPath + "-" + (i+1) + ".txt";
- // };
- //
- // for (int i = 0 ; i < 10; i++){
- //
- // Exchange exchange = new Exchange();
- //
- // exchange.setMinXY(minXYMap);
- //
- // exchange.setDataInputFilePath(roadInputPath[i]);
- //
- // exchange.setDataOutPutFilePath(roadOutputPath[i]);
- //
- // try {
- // exchange.execute();
- // }
- // catch (Exception e){
- //// throw new Exception("eee");
- // System.out.println(i);
- // }
- //
- //
- // Map tempMap = exchange.getRoadData(roadName[i],roadDirection[i]);
- //
- // roadInfoMapList.add(tempMap);
- //
- // }
- //
- // return roadInfoMapList;
- //
- // }
- //
- //
- // public static List<Map> getTrackData() throws FileNotFoundException {
- //
- // String[] trackName = {"track01","track02","track03","track04","track05","track06"};
- // String[] trackInputPath = new String[6];
- // String[] trackOutputPath = new String[6];
- // String trackBasicInPutPath = "/Users/haoqianpan/file/programfile/gpsexchange/GPS/track/in/trackIn";
- // String trackBasicOutPutPath = "/Users/haoqianpan/file/programfile/gpsexchange/GPS/track/out/trackOut";
- //
- // List<Map> trackInfoMapList = new ArrayList<>();
- //
- // for (int i = 0 ; i < 6;i++){
- // trackInputPath[i] = trackBasicInPutPath + "-" + (i+1) + ".txt";
- // trackOutputPath[i] = trackBasicOutPutPath + "-" + (i+1) + ".txt";
- // };
- //
- // for (int i = 0 ; i < 6 ; i++){
- //
- // Exchange exchange = new Exchange();
- //
- // exchange.setMinXY(minXYMap);
- //
- // exchange.setDataInputFilePath(trackInputPath[i]);
- //
- // exchange.setDataOutPutFilePath(trackOutputPath[i]);
- //
- // exchange.execute();
- //
- // Map tempMap = exchange.getTrackData(trackName[i]);
- //
- // trackInfoMapList.add(tempMap);
- //
- // }
- //
- // return trackInfoMapList;
- //
- // }
- //
- //
- // public static List<Map> getBuildingData() throws FileNotFoundException {
- //
- // String[] buildingName = {"中检公司(北)","中检公司(南)","中控室","矿石1#变电站","洗车房","食堂","候工厅","港机公司","库房(北)","库房(南)","污水处理厂","喷淋泵房","矿石4#变电站","矿石2#变电所","矿石5#变电所"};
- //
- // String[] buildingInputPath = new String[15];
- //
- // String[] buildingOutputPath = new String[15];
- //
- // String buildingBasicInPutPath = "/Users/haoqianpan/file/programfile/gpsexchange/GPS/building/in/buildingIn";
- //
- // String buildingBasicOutPutPath = "/Users/haoqianpan/file/programfile/gpsexchange/GPS/building/out/buildingOut";
- //
- // List<Map> buildingInfoMapList = new ArrayList<>();
- //
- // for (int i = 0 ; i < 15;i++){
- // buildingInputPath[i] = buildingBasicInPutPath + "-" + (i+1) + ".txt";
- // buildingOutputPath[i] = buildingBasicOutPutPath + "-" + (i+1) + ".txt";
- // };
- //
- // for (int i = 0 ; i < 15; i++){
- //
- // Exchange exchange = new Exchange();
- //
- // exchange.setMinXY(minXYMap);
- //
- // exchange.setDataInputFilePath(buildingInputPath[i]);
- //
- // exchange.setDataOutPutFilePath(buildingOutputPath[i]);
- //
- // exchange.execute();
- //
- // Map tempMap = exchange.getBuildingData(buildingName[i]);
- //
- // buildingInfoMapList.add(tempMap);
- //
- // }
- //
- // return buildingInfoMapList;
- //
- // }
- //
- // public static ArrayList<Map> cal(Double xStart,Double yStart,Double xEnd,Double yEnd){
- //
- //
- //
- //
- // Point pointStart = new Point();
- // pointStart.setColX(xStart);
- // pointStart.setColY(yStart);
- //
- // Point pointEnd = new Point();
- // pointEnd.setColX(xEnd);
- // pointEnd.setColY(yEnd);
- //
- // CurveTool curveTool = new CurveTool();
- // ArrayList<Double> lineParamList = curveTool.calLineabc(pointStart,pointEnd);
- //
- // Double k = lineParamList.get(0);
- // Double counterValue = Math.sqrt(25/(Math.pow(k,2) + 1));
- // ArrayList<Map> rulerPointsList = new ArrayList<>();
- //
- // if (xStart >= xEnd){
- //
- // for(int i = 0 ; i < 207; i++){
- //
- // double xTemp = xStart - i * counterValue;
- // double yTemp = curveTool.getLineYValue(xTemp,lineParamList);
- //// Point point = new Point();
- //
- // Map map = new HashMap();
- // map.put("x",xTemp);
- // map.put("y",yTemp);
- //// point.setColX(xTemp);
- //// point.setColY(yTemp);
- // rulerPointsList.add(map);
- //
- // }
- //
- // }
- //
- // if (xStart < xEnd){
- //
- // for(int i = 0 ; i < 207; i++){
- //
- // double xTemp = xStart + i * counterValue;
- // double yTemp = curveTool.getLineYValue(xTemp,lineParamList);
- // Map map = new HashMap();
- // map.put("x",xTemp);
- // map.put("y",yTemp);
- //// point.setColX(xTemp);
- //// point.setColY(yTemp);
- // rulerPointsList.add(map);
- // }
- //
- // }
- // return rulerPointsList;
- // }
- //
- // public static void calTemp() throws FileNotFoundException {
- //
- // String rulerInputFilePathe = "/Users/haoqianpan/file/programfile/gpsexchange/GPS/ruler/in/sr6ein.txt";
- // String rulerInputFilePathw = "/Users/haoqianpan/file/programfile/gpsexchange/GPS/ruler/in/sr6win.txt";
- // ArrayList<String> inputFilePathList = new ArrayList<>();
- // inputFilePathList.add(rulerInputFilePathe);
- // inputFilePathList.add(rulerInputFilePathw);
- //
- // for (int i = 0 ; i < inputFilePathList.size();i++){
- // String rulerName = "";
- // if (i == 0){
- // rulerName = "SR6东";
- // }
- // else if (i ==1){
- //
- // rulerName = "SR6西";
- // }
- //
- // String filePathTemp = inputFilePathList.get(i);
- // Exchange exchange = new Exchange();
- // exchange.setDataInputFilePath(filePathTemp);
- // exchange.setMinXY(minXYMap);
- // exchange.execute();
- // ArrayList<Map> corAfterTransList = exchange.corAfterTransList;
- // Map mapStart = corAfterTransList.get(0);
- // Map mapEnd = corAfterTransList.get(1);
- // Double xStart = Double.parseDouble(mapStart.get("x").toString());
- // Double yStart = Double.parseDouble(mapStart.get("y").toString());
- //
- // Double xEnd = Double.parseDouble(mapEnd.get("x").toString());
- // Double yEnd = Double.parseDouble(mapEnd.get("y").toString());
- // ArrayList<Map> points = cal(xStart,yStart,xEnd,yEnd);
- // Map map1 = new HashMap();
- // map1.put("TYPE","标尺");
- // map1.put("NAME",rulerName);
- // map1.put("POINTS",points);
- // Gson gson = new Gson();
- // String str = gson.toJson(map1);
- // System.out.println("打印ruler");
- // System.out.println(str);
- // System.out.println("打印完毕");
- // }
- //
- //
- // }
- //}
|