本文是JAVA代码将UTM的XY坐标转换为WGS84的经纬度坐标。首先我们要知道几个参数。

当初设计的人一定会有以下参数提供,但是这些参数一般很少会去修改。

上图中的UTM Zone 50N代表中国东部地区。下图可以看到。官网:http://www.dmap.co.uk/utmworld.htm

下图的设计中已经标注了基点坐标,就是Easting和Northing,大家在坐标转换的时候,传递的XY必须是基点坐标和相对坐标计算后的XY。

以下是转换的JAVA代码

package cn.renkai721.util;public class UTM2Wgs84Util {private static double num6(double num) {String result = String.format("%.6f", num);return Double.valueOf(result);}public static String utmXy2Wgs84(double x,double y){// 输入8.604000000, 606.488892000// 返回119.002522,37.377409// UTM的xy坐标转换为WGS84的经纬度坐标int Zone = 50;double hemisphere='N';// 以下代码加上基准点坐标double Easting = x+677292.99;double Northing = y+4138015.77;double latitude;double longitude;//hemisphere='N','S'double north;if (hemisphere == 'S') {north = Northing - 10000000;} else {north = Northing;}latitude = (north/6366197.724/0.9996+(1+0.006739496742*Math.pow(Math.cos(north/6366197.724/0.9996),2)-0.006739496742*Math.sin(north/6366197.724/0.9996)*Math.cos(north/6366197.724/0.9996)*(Math.atan(Math.cos(Math.atan(( Math.exp((Easting - 500000) / (0.9996*6399593.625/Math.sqrt((1+0.006739496742*Math.pow(Math.cos(north/6366197.724/0.9996),2))))*(1-0.006739496742*Math.pow((Easting - 500000) / (0.9996*6399593.625/Math.sqrt((1+0.006739496742*Math.pow(Math.cos(north/6366197.724/0.9996),2)))),2)/2*Math.pow(Math.cos(north/6366197.724/0.9996),2)/3))-Math.exp(-(Easting-500000)/(0.9996*6399593.625/Math.sqrt((1+0.006739496742*Math.pow(Math.cos(north/6366197.724/0.9996),2))))*( 1 -  0.006739496742*Math.pow((Easting - 500000) / (0.9996*6399593.625/Math.sqrt((1+0.006739496742*Math.pow(Math.cos(north/6366197.724/0.9996),2)))),2)/2*Math.pow(Math.cos(north/6366197.724/0.9996),2)/3)))/2/Math.cos((north-0.9996*6399593.625*(north/6366197.724/0.9996-0.006739496742*3/4*(north/6366197.724/0.9996+Math.sin(2*north/6366197.724/0.9996)/2)+Math.pow(0.006739496742*3/4,2)*5/3*(3*(north/6366197.724/0.9996+Math.sin(2*north/6366197.724/0.9996 )/2)+Math.sin(2*north/6366197.724/0.9996)*Math.pow(Math.cos(north/6366197.724/0.9996),2))/4-Math.pow(0.006739496742*3/4,3)*35/27*(5*(3*(north/6366197.724/0.9996+Math.sin(2*north/6366197.724/0.9996)/2)+Math.sin(2*north/6366197.724/0.9996)*Math.pow(Math.cos(north/6366197.724/0.9996),2))/4+Math.sin(2*north/6366197.724/0.9996)*Math.pow(Math.cos(north/6366197.724/0.9996),2)*Math.pow(Math.cos(north/6366197.724/0.9996),2))/3))/(0.9996*6399593.625/Math.sqrt((1+0.006739496742*Math.pow(Math.cos(north/6366197.724/0.9996),2))))*(1-0.006739496742*Math.pow((Easting-500000)/(0.9996*6399593.625/Math.sqrt((1+0.006739496742*Math.pow(Math.cos(north/6366197.724/0.9996),2)))),2)/2*Math.pow(Math.cos(north/6366197.724/0.9996),2))+north/6366197.724/0.9996)))*Math.tan((north-0.9996*6399593.625*(north/6366197.724/0.9996 - 0.006739496742*3/4*(north/6366197.724/0.9996+Math.sin(2*north/6366197.724/0.9996)/2)+Math.pow(0.006739496742*3/4,2)*5/3*(3*(north/6366197.724/0.9996+Math.sin(2*north/6366197.724/0.9996)/2)+Math.sin(2*north/6366197.724/0.9996 )*Math.pow(Math.cos(north/6366197.724/0.9996),2))/4-Math.pow(0.006739496742*3/4,3)*35/27*(5*(3*(north/6366197.724/0.9996+Math.sin(2*north/6366197.724/0.9996)/2)+Math.sin(2*north/6366197.724/0.9996)*Math.pow(Math.cos(north/6366197.724/0.9996),2))/4+Math.sin(2*north/6366197.724/0.9996)*Math.pow(Math.cos(north/6366197.724/0.9996),2)*Math.pow(Math.cos(north/6366197.724/0.9996),2))/3))/(0.9996*6399593.625/Math.sqrt((1+0.006739496742*Math.pow(Math.cos(north/6366197.724/0.9996),2))))*(1-0.006739496742*Math.pow((Easting-500000)/(0.9996*6399593.625/Math.sqrt((1+0.006739496742*Math.pow(Math.cos(north/6366197.724/0.9996),2)))),2)/2*Math.pow(Math.cos(north/6366197.724/0.9996),2))+north/6366197.724/0.9996))-north/6366197.724/0.9996)*3/2)*(Math.atan(Math.cos(Math.atan((Math.exp((Easting-500000)/(0.9996*6399593.625/Math.sqrt((1+0.006739496742*Math.pow(Math.cos(north/6366197.724/0.9996),2))))*(1-0.006739496742*Math.pow((Easting-500000)/(0.9996*6399593.625/Math.sqrt((1+0.006739496742*Math.pow(Math.cos(north/6366197.724/0.9996),2)))),2)/2*Math.pow(Math.cos(north/6366197.724/0.9996),2)/3))-Math.exp(-(Easting-500000)/(0.9996*6399593.625/Math.sqrt((1+0.006739496742*Math.pow(Math.cos(north/6366197.724/0.9996),2))))*(1-0.006739496742*Math.pow((Easting-500000)/(0.9996*6399593.625/Math.sqrt((1+0.006739496742*Math.pow(Math.cos(north/6366197.724/0.9996),2)))),2)/2*Math.pow(Math.cos(north/6366197.724/0.9996),2)/3)))/2/Math.cos((north-0.9996*6399593.625*(north/6366197.724/0.9996-0.006739496742*3/4*(north/6366197.724/0.9996+Math.sin(2*north/6366197.724/0.9996)/2)+Math.pow(0.006739496742*3/4,2)*5/3*(3*(north/6366197.724/0.9996+Math.sin(2*north/6366197.724/0.9996)/2)+Math.sin(2*north/6366197.724/0.9996)*Math.pow(Math.cos(north/6366197.724/0.9996),2))/4-Math.pow(0.006739496742*3/4,3)*35/27*(5*(3*(north/6366197.724/0.9996+Math.sin(2*north/6366197.724/0.9996)/2)+Math.sin(2*north/6366197.724/0.9996)*Math.pow(Math.cos(north/6366197.724/0.9996),2))/4+Math.sin(2*north/6366197.724/0.9996)*Math.pow(Math.cos(north/6366197.724/0.9996),2)*Math.pow(Math.cos(north/6366197.724/0.9996),2))/3))/(0.9996*6399593.625/Math.sqrt((1+0.006739496742*Math.pow(Math.cos(north/6366197.724/0.9996),2))))*(1-0.006739496742*Math.pow((Easting-500000)/(0.9996*6399593.625/Math.sqrt((1+0.006739496742*Math.pow(Math.cos(north/6366197.724/0.9996),2)))),2)/2*Math.pow(Math.cos(north/6366197.724/0.9996),2))+north/6366197.724/0.9996)))*Math.tan((north-0.9996*6399593.625*(north/6366197.724/0.9996-0.006739496742*3/4*(north/6366197.724/0.9996+Math.sin(2*north/6366197.724/0.9996)/2)+Math.pow(0.006739496742*3/4,2)*5/3*(3*(north/6366197.724/0.9996+Math.sin(2*north/6366197.724/0.9996)/2)+Math.sin(2*north/6366197.724/0.9996)*Math.pow(Math.cos(north/6366197.724/0.9996),2))/4-Math.pow(0.006739496742*3/4,3)*35/27*(5*(3*(north/6366197.724/0.9996+Math.sin(2*north/6366197.724/0.9996)/2)+Math.sin(2*north/6366197.724/0.9996)*Math.pow(Math.cos(north/6366197.724/0.9996),2))/4+Math.sin(2*north/6366197.724/0.9996)*Math.pow(Math.cos(north/6366197.724/0.9996),2)*Math.pow(Math.cos(north/6366197.724/0.9996),2))/3))/(0.9996*6399593.625/Math.sqrt((1+0.006739496742*Math.pow(Math.cos(north/6366197.724/0.9996),2))))*(1-0.006739496742*Math.pow((Easting-500000)/(0.9996*6399593.625/Math.sqrt((1+0.006739496742*Math.pow(Math.cos(north/6366197.724/0.9996),2)))),2)/2*Math.pow(Math.cos(north/6366197.724/0.9996),2))+north/6366197.724/0.9996))-north/6366197.724/0.9996))*180/Math.PI;latitude=Math.round(latitude*10000000);latitude=latitude/10000000;longitude =Math.atan((Math.exp((Easting-500000)/(0.9996*6399593.625/Math.sqrt((1+0.006739496742*Math.pow(Math.cos(north/6366197.724/0.9996),2))))*(1-0.006739496742*Math.pow((Easting-500000)/(0.9996*6399593.625/Math.sqrt((1+0.006739496742*Math.pow(Math.cos(north/6366197.724/0.9996),2)))),2)/2*Math.pow(Math.cos(north/6366197.724/0.9996),2)/3))-Math.exp(-(Easting-500000)/(0.9996*6399593.625/Math.sqrt((1+0.006739496742*Math.pow(Math.cos(north/6366197.724/0.9996),2))))*(1-0.006739496742*Math.pow((Easting-500000)/(0.9996*6399593.625/Math.sqrt((1+0.006739496742*Math.pow(Math.cos(north/6366197.724/0.9996),2)))),2)/2*Math.pow(Math.cos(north/6366197.724/0.9996),2)/3)))/2/Math.cos((north-0.9996*6399593.625*( north/6366197.724/0.9996-0.006739496742*3/4*(north/6366197.724/0.9996+Math.sin(2*north/6366197.724/0.9996)/2)+Math.pow(0.006739496742*3/4,2)*5/3*(3*(north/6366197.724/0.9996+Math.sin(2*north/6366197.724/0.9996)/2)+Math.sin(2* north/6366197.724/0.9996)*Math.pow(Math.cos(north/6366197.724/0.9996),2))/4-Math.pow(0.006739496742*3/4,3)*35/27*(5*(3*(north/6366197.724/0.9996+Math.sin(2*north/6366197.724/0.9996)/2)+Math.sin(2*north/6366197.724/0.9996)*Math.pow(Math.cos(north/6366197.724/0.9996),2))/4+Math.sin(2*north/6366197.724/0.9996)*Math.pow(Math.cos(north/6366197.724/0.9996),2)*Math.pow(Math.cos(north/6366197.724/0.9996),2))/3)) / (0.9996*6399593.625/Math.sqrt((1+0.006739496742*Math.pow(Math.cos(north/6366197.724/0.9996),2))))*(1-0.006739496742*Math.pow((Easting-500000)/(0.9996*6399593.625/Math.sqrt((1+0.006739496742*Math.pow(Math.cos(north/6366197.724/0.9996),2)))),2)/2*Math.pow(Math.cos(north/6366197.724/0.9996),2))+north/6366197.724/0.9996))*180/Math.PI+Zone*6-183;longitude=Math.round(longitude*10000000);longitude=longitude/10000000;return num6(longitude)+","+num6(latitude);}public static String wgs84ToUtmXy(double Lat,double Lon){// 输入37.377409,119.0025217// 返回677301.59,4138622.2600000002// WGS84的经纬度坐标转换为UTM的xy坐标double Easting;double Northing;char Letter='N';int Zone= 50;Easting=0.5*Math.log((1+Math.cos(Lat*Math.PI/180)*Math.sin(Lon*Math.PI/180-(6*Zone-183)*Math.PI/180))/(1-Math.cos(Lat*Math.PI/180)*Math.sin(Lon*Math.PI/180-(6*Zone-183)*Math.PI/180)))*0.9996*6399593.62/Math.pow((1+Math.pow(0.0820944379, 2)*Math.pow(Math.cos(Lat*Math.PI/180), 2)), 0.5)*(1+ Math.pow(0.0820944379,2)/2*Math.pow((0.5*Math.log((1+Math.cos(Lat*Math.PI/180)*Math.sin(Lon*Math.PI/180-(6*Zone-183)*Math.PI/180))/(1-Math.cos(Lat*Math.PI/180)*Math.sin(Lon*Math.PI/180-(6*Zone-183)*Math.PI/180)))),2)*Math.pow(Math.cos(Lat*Math.PI/180),2)/3)+500000;Easting=Math.round(Easting*100)*0.01;Northing = (Math.atan(Math.tan(Lat*Math.PI/180)/Math.cos((Lon*Math.PI/180-(6*Zone -183)*Math.PI/180)))-Lat*Math.PI/180)*0.9996*6399593.625/Math.sqrt(1+0.006739496742*Math.pow(Math.cos(Lat*Math.PI/180),2))*(1+0.006739496742/2*Math.pow(0.5*Math.log((1+Math.cos(Lat*Math.PI/180)*Math.sin((Lon*Math.PI/180-(6*Zone -183)*Math.PI/180)))/(1-Math.cos(Lat*Math.PI/180)*Math.sin((Lon*Math.PI/180-(6*Zone -183)*Math.PI/180)))),2)*Math.pow(Math.cos(Lat*Math.PI/180),2))+0.9996*6399593.625*(Lat*Math.PI/180-0.005054622556*(Lat*Math.PI/180+Math.sin(2*Lat*Math.PI/180)/2)+4.258201531e-05*(3*(Lat*Math.PI/180+Math.sin(2*Lat*Math.PI/180)/2)+Math.sin(2*Lat*Math.PI/180)*Math.pow(Math.cos(Lat*Math.PI/180),2))/4-1.674057895e-07*(5*(3*(Lat*Math.PI/180+Math.sin(2*Lat*Math.PI/180)/2)+Math.sin(2*Lat*Math.PI/180)*Math.pow(Math.cos(Lat*Math.PI/180),2))/4+Math.sin(2*Lat*Math.PI/180)*Math.pow(Math.cos(Lat*Math.PI/180),2)*Math.pow(Math.cos(Lat*Math.PI/180),2))/3);if (Letter<'M'){Northing = Northing + 10000000;}Northing=Math.round(Northing*100)*0.01;double x = Easting;double y = Northing;return x+","+y;}}

UTM的XY坐标转换为WGS84经纬度坐标相关推荐

  1. 局部(x,y)坐标 转 WGS84经纬度坐标

    局部坐标转WGS84坐标 背景: 最近在做一个小项目,其中需要把局部坐标转换成wgs84坐标.我的局部地图是用激光雷达扫出来的一张图,就是下面这张图 用激光雷达建好图以后,就知道图上每一个点的局部坐标 ...

  2. 使用python爬取高德POI数据,并转换为WGS84经纬度坐标的点矢量

    一,爬取高德POI数据(高德开放平台接口+ Python) 参考记者博客https://blog.csdn.net/hxx099/article/details/88974264 1,申请高德开放平台 ...

  3. 西安80转换成北京独立计算机,WGS84经纬度坐标转换为西安80高斯投影坐标.

    dsfqfzneiphp 通过 波段编号18和相应的中央子午线为105°,表示计算基于6度波段划分. 您要注意标题" WGS84经纬度坐标转换为西安80高斯投影坐标",也就是说,在 ...

  4. WGS84经纬度坐标与北京54坐标或者…

    WGS84经纬度坐标与北京54坐标或者西安80坐标的关系     一般来讲,GPS直接提供的坐标(B,L,H)是1984年世界大地坐标系(Word Geodetic System1984即WGS-84 ...

  5. java 墨卡托 经纬度_Web墨卡托坐标与WGS84经纬度互转 java代码

    Web墨卡托坐标与WGS84经纬度互转 java代码 时间:5年前 浏览:2309 [网络转载] package com.util; public class Coordinate { static ...

  6. WGS84经纬度坐标到北京54高斯投影坐标的转换

    张兢1 王文瑞2 陈溪1 (1.广西第一测绘院 广西南宁 530023: 2.南宁市勘测院 广西南宁 530022) [摘 要] 本文针对从事测绘工作者普遍遇到的坐标转换问题,简要介绍ArcGIS实现 ...

  7. wgs84坐标格式转换度分秒_使用ArcGIS实现WGS84经纬度坐标到北京54高斯投影坐标的转换...

    [摘 要] 本文针对从事测绘工作者普遍遇到的坐标转换问题,简要介绍ArcGIS实现WGS84经纬度坐标到北京54高斯投影坐标转换原理和步骤. [关键词] ArcGIS 坐标转换 投影变换 1 坐标转换 ...

  8. 百度地图墨卡托坐标转高德经纬度坐标(偏移小)

    基本上是网上常见的方法进行坐标系的转换,但是误差很大.发现之所以误差大是在于百度的墨卡托坐标转百度的经纬度时误差太大,后面找到一个方法,误差较小,基本吻合. 参考:http://www.site-di ...

  9. 西安80坐标转成经纬度坐标

    西安80坐标转成经纬度坐标 1:我的x坐标5045849.03:我的y坐标42594842.63 x坐标是7位数,y坐标是8位数 2:数据分析x7位,y加上带号8位,投影带号为42,所以是3度带投影( ...

最新文章

  1. Java之——利用Comparator接口对多个排序条件进行处理
  2. BI-LSTM and CRF using Keras
  3. 上传问题分析2--文件重名
  4. IdentityServer4 实现自定义 GrantType 授权模式
  5. python风控工具_python-风控模型分析01
  6. Web前端技术趋势:HTML5仍不宜用作生产
  7. MYSQL SHELL 到底是个什么局 剑指 “大芒果”
  8. Java基础学习总结(60)——Java常用的八种排序算法
  9. Caused by: java.lang.NumberFormatException: For input string: 18446744073709551615
  10. Wifi模块与串口助手通信的常用AT指令集
  11. c语言编程学习宝典,C语言学习宝典
  12. 服务器显示ipv4问题,IPv4会出现哪些问题
  13. 酷狗、QQ音乐歌词转换工具
  14. html设置文字超过字数_CSS限制字数,超出部份显示点点点...
  15. mysql 按照中文拼音首字母排序
  16. 拼多多笔试题 回合制角色扮演
  17. apt安装golang
  18. stm32十六进制字符串转十进制数值代码
  19. Python怎么学?自学可以学好吗?
  20. RabbitMQ—发布消息确认和消费消息确认

热门文章

  1. iphone长截图哪个软件好_Windows长截图技巧、iPhone免费长截图软件
  2. 匹配字符串-正则表达式
  3. 使用 VMware Server 在 Linux 上安装 Oracle RAC 10g
  4. P6 Vue双向绑定 v-model
  5. 云计算平台建设总体技术方案
  6. Apollo使用篇 - Apollo客户端的使用
  7. VMware 安装Ubuntu系统后,启动一直黑屏
  8. 区块链游戏开发注意事项
  9. 京东内网遭开源的“顶级”SpringCloud实战手册,GitHub列为首推
  10. 纯css炫酷动态加载条