本文是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. SQL Server - select语句练习
  2. Spring核心技术(七)——Spring容器的扩展
  3. 战龙四驱java_《战龙四驱》中都有哪些经典角色
  4. C语言实现中国象棋(Qt实现界面,源码下载,详细注释,易移植)
  5. 串口协议的制定以及串口中怎样接收一个完整数据包的解析
  6. 从Adobe Photoshop CC 2018的“新建Web”看Web网页常见分辨率
  7. Android Studio 智能感知无效
  8. 详细解读 | CVPR 2021轻量化目标检测模型MobileDets(附论文下载)
  9. 几款开源聊天软件对比
  10. win10硬盘分区怎么分
  11. C#和NET Framework的定义
  12. Android 控制音频的音量大小
  13. miktex报错:the remote package repository is outdated
  14. THUPC 2019 CTS 2019 打铁记
  15. RTX 4080、RTX4070 Ti 相当于什么水平
  16. Python调用Rasa API服务进行连续对话
  17. Android,linux常用资源下载链接
  18. 操作系统管理计算机资源
  19. Linux 提权总结
  20. 大学生创业之火如何再次燎原

热门文章

  1. 火爆科研圈的三维重建技术:Neural radiance fields (NeRF)
  2. Request请求转发与URL编码
  3. h5 底部按钮兼容 iPhone X(解决底部横杠遮挡问题)
  4. JavaWeb+Tomcat+Servlet使用<c:foreach>标签时,jsp等网页文件获取不到request域中的数据
  5. 亲测三大热门短链接平台,告诉你谁才是最好的
  6. Download下载DRM
  7. Windows安装达梦数据库(Intel CPU)
  8. JAVA实现导出mysql表结构到Word详细注解版
  9. 【RuoYi框架】RuoYi框架学习超简单案例 - 新闻管理系统(附源码)
  10. iOS即时通讯之CocoaAsyncSocket源码解析一