| | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | |
| | | import com.yssh.entity.Coordinate; |
| | | import com.yssh.entity.DistanceSuYuan; |
| | | import com.yssh.entity.MonitorPointPosition; |
| | | import org.geotools.geometry.DirectPosition2D; |
| | | import org.geotools.referencing.CRS; |
| | |
| | | } catch (Exception ex) { |
| | | return 0; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 获取坐标 |
| | | * @param su |
| | | * @return |
| | | */ |
| | | public static Coordinate getCoordinate(DistanceSuYuan su) { |
| | | String[] sirs = su.getId().split("_"); |
| | | |
| | | int x = Integer.parseInt(sirs[0]); |
| | | int y = Integer.parseInt(sirs[1]); |
| | | double lon = CalculateUtils.getLon(x, y); |
| | | double lat = CalculateUtils.getLat(x, y); |
| | | |
| | | return new Coordinate(lon, lat); |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | /** |
| | | * 获取方向 |
| | | */ |
| | | public static String getDir(double direction) { |
| | | if (direction < 0) { |
| | | direction = direction + 360; |
| | | } |
| | | if (direction > 360) { |
| | | direction = direction - 360; |
| | | } |
| | | |
| | | if (direction > 315 && direction < 45) |
| | | return "北"; |
| | | if (direction >= 45 && direction < 135) |
| | | return "东"; |
| | | if (direction >= 135 && direction < 225) |
| | | return "南"; |
| | | |
| | | return "西"; |
| | | } |
| | | |
| | | /** |
| | | * @param @return 参数 |
| | | * @return Double 返回类型 |
| | | * @throws |