|  |  | 
 |  |  |                     if (lon == null || lat == null) { | 
 |  |  |                         continue; | 
 |  |  |                     } | 
 |  |  |                     Point point2D=new Point(lon,lat); | 
 |  |  |                     Point point2D=new Point(); | 
 |  |  |                     point2D.setLongitude(lon); | 
 |  |  |                     point2D.setLatitude(lat); | 
 |  |  |                     boolean inPolygon = GisTool.isInPolygon(point2D, partitionLocation); | 
 |  |  |                     if (inPolygon) { | 
 |  |  |                         Map<String, Object> params = new HashMap<>(); | 
 
 |  |  | 
 |  |  |                     continue; | 
 |  |  |                 } | 
 |  |  |                 /*判断坐标是否在多边形范围内*/ | 
 |  |  |                 Point camPosition=new Point(camera.getLongitude(), camera.getLatitude()); | 
 |  |  |                 Point camPosition=new Point(); | 
 |  |  |                 camPosition.setLongitude(camera.getLongitude()); | 
 |  |  |                 camPosition.setLatitude(camera.getLatitude()); | 
 |  |  |                 boolean inPolygon = GisTool.isInPolygon(camPosition, partitionLocation); | 
 |  |  |                 if (inPolygon) { | 
 |  |  |                     /*获取通道列表*/ | 
 
 |  |  | 
 |  |  |                 List<Map<String, Object>> carGPSMap = (List<Map<String, Object>>) carGPSTrack.get("list"); | 
 |  |  |                 Double lng = Double.valueOf((String) carGPSMap.get(0).get("lng")); | 
 |  |  |                 Double lat = Double.valueOf((String) carGPSMap.get(0).get("lat")); | 
 |  |  |                 Point point = new Point(lng, lat); | 
 |  |  |                 Point point = new Point(); | 
 |  |  |                 point.setLongitude(lng); | 
 |  |  |                 point.setLatitude(lat); | 
 |  |  |                 boolean inPolygon = GisTool.isInPolygon(point, partitionLocation); | 
 |  |  |                 if (inPolygon) { | 
 |  |  |                     carMap.put("longitude", lng); | 
 
 |  |  | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     public static void main(String[] args) { | 
 |  |  |         // 被检测的经纬度点 | 
 |  |  |         Point point= new Point(126.649261,45.687377); | 
 |  |  |         // 商业区域(百度多边形区域经纬度集合) | 
 |  |  |         List<Point> partitionLocation = new ArrayList<>(); | 
 |  |  |         partitionLocation.add(new Point(126.64459,45.688548)); | 
 |  |  |         partitionLocation.add(new Point(126.653376,45.68938)); | 
 |  |  |         partitionLocation.add(new Point(126.645776,45.685048)); | 
 |  |  |         partitionLocation.add(new Point(126.654184,45.685778)); | 
 |  |  |         System.out.println(isInPolygon(point,partitionLocation)); | 
 |  |  | //        // 被检测的经纬度点 | 
 |  |  | //        Point point= new Point(126.649261,45.687377); | 
 |  |  | //        // 商业区域(百度多边形区域经纬度集合) | 
 |  |  | //        List<Point> partitionLocation = new ArrayList<>(); | 
 |  |  | //        partitionLocation.add(new Point(126.64459,45.688548)); | 
 |  |  | //        partitionLocation.add(new Point(126.653376,45.68938)); | 
 |  |  | //        partitionLocation.add(new Point(126.645776,45.685048)); | 
 |  |  | //        partitionLocation.add(new Point(126.654184,45.685778)); | 
 |  |  | //        System.out.println(isInPolygon(point,partitionLocation)); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     /** | 
 
 |  |  | 
 |  |  |     private static final long serialVersionUID = 1L; | 
 |  |  |     private Double longitude; | 
 |  |  |     private Double latitude; | 
 |  |  |  | 
 |  |  |     public Point(Double x, Double y) { | 
 |  |  |         this.longitude = x; | 
 |  |  |         this.latitude = y; | 
 |  |  |     } | 
 |  |  | } | 
 
 |  |  | 
 |  |  |                         SysUser sysUser = sysUserService.selectUserById(currentOperator); | 
 |  |  |                         if(StringUtils.isNull(sysUser)) | 
 |  |  |                         { | 
 |  |  |                             return false; | 
 |  |  |                             return true; | 
 |  |  |                         } | 
 |  |  |                         currentLevel = Integer.valueOf(sysUser.getCameraPriority()); | 
 |  |  |                     } |