| | |
| | | //拦截手动引导
|
| | | ArdCameraNoGuideZone ardCameraNoGuideZone = new ArdCameraNoGuideZone();
|
| | | ardCameraNoGuideZone.setCameraId(cmd.getCameraId());
|
| | | ardCameraNoGuideZone.setEnabled("1");
|
| | | //获取当前相机的禁引可视域列表
|
| | | List<ArdCameraNoGuideZone> ardCameraNoGuideZones = ardCameraNoGuideZoneService.selectArdCameraNoGuideZoneList(ardCameraNoGuideZone);
|
| | | if (ardCameraNoGuideZones.size() > 0) {
|
| | | //获取到当前相机的坐标集合
|
| | | List<Point> pointList = new ArrayList<>();
|
| | | for(ArdCameraNoGuideZone zone:ardCameraNoGuideZones) {
|
| | | String[] parts = zone.getPoi().split(",");
|
| | | List<Point> pointList = new ArrayList<>();
|
| | | for (int i = 0; i < parts.length; i += 3) {
|
| | | Point point = new Point();
|
| | | point.setLongitude(Double.valueOf(parts[i]));
|
| | | point.setLatitude(Double.valueOf(parts[i + 1]));
|
| | | pointList.add(point);
|
| | | }
|
| | | }
|
| | | double lon = cmd.getTargetPosition()[0];
|
| | | double lat = cmd.getTargetPosition()[1];
|
| | | Point targetPoint = new Point(lon, lat);
|
| | | //判断引导目标是否在坐标集合组成的多边形内
|
| | | boolean inPolygon = GisUtil.isInPolygon(targetPoint, pointList);
|
| | | if(inPolygon)
|
| | | {
|
| | | return AjaxResult.error("引导坐标位于禁引可视域内");
|
| | | double lon = cmd.getTargetPosition()[0];
|
| | | double lat = cmd.getTargetPosition()[1];
|
| | | Point targetPoint = new Point(lon, lat);
|
| | | //判断引导目标是否在坐标集合组成的多边形内
|
| | | boolean inPolygon = GisUtil.isInPolygon(targetPoint, pointList);
|
| | | if(inPolygon)
|
| | | {
|
| | | return AjaxResult.error("引导坐标位于禁引可视域内");
|
| | | }
|
| | | }
|
| | | }
|
| | | return toAjax(cameraSdkService.guideTargetPosition(cmd));
|