'2016/10'에 해당되는 글 2건
- 2016.10.19 시큐어리녹스 SELinux
- 2016.10.07 구글 좌표계 다음 좌표계로 변환 EPGS4326 to 900913 EPGS900913 to 4326
카테고리 없음2016. 10. 19. 13:19
카테고리 없음2016. 10. 7. 16:54
반응형
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | private static Map<String, Object> EPGS4326_900913(double lon, double lat){ double x = lon * 20037508.34 / 180; double y = Math.log(Math.tan((90 + lat) * Math.PI / 360)) / (Math.PI / 180); y = y * 20037508.34 / 180; Map<String, Object> map = new HashMap<String, Object>(); map.put("x", x); map.put("y", y); System.out.println(lon+":"+x); System.out.println(lat+":"+y); return map; } private static Map<String, Object> EPGS900913_4326(double x, double y){ double lon = (x / 20037508.34) * 180; double lat = (y / 20037508.34) * 180; lat = 180/Math.PI * (2 * Math.atan(Math.exp(lat * Math.PI / 180)) - Math.PI / 2); Map<String, Object> map = new HashMap<String, Object>(); map.put("lon", lon); map.put("lat", lat); System.out.println(x+":"+lon); System.out.println(y+":"+lat); return map; } | cs |