为了账号安全,请及时绑定邮箱和手机立即绑定

如何将韩国坐标 (EPSG:5179) 转换为十进制度坐标 (EPSG:4326)

如何将韩国坐标 (EPSG:5179) 转换为十进制度坐标 (EPSG:4326)

心有法竹 2022-05-21 19:52:55
从韩国 2000 坐标系 (EPSG:5179) 转换为十进制度 (EPSG:4326) 时出现问题。我们正在为韩国公司开发地理信息系统。我们将 Geotools 库用于多个后端实现。但是我现在从 EPSG:5179 转换为 EPSG:4326 时遇到问题。例如:当使用多个在线转换器(如https://epsg.io/transform#s_srs=5179&t_srs=4326 试图转换韩国坐标时:x : 1307285 y : 2229260预期结果为(十进制度格式): x : 131.0999928 y : 40.0099722所以现在我正在尝试使用 Geotools 库使用此文档http://docs.geotools.org/stable/userguide/library/api/jts.html进行相同的转换我的示例测试:public void testProjectedKoreanCoordinatesToDecimalDegree() throws FactoryException, TransformException {    //EPSG:5179 -> EPSG:4326 CONVERSION    CoordinateReferenceSystem sourceCRS = CRS.decode("EPSG:5179");    CoordinateReferenceSystem targetCRS = CRS.decode("EPSG:4326");    double coordinateX = 1307285;    double coordinateY = 2229260;    Coordinate in = new Coordinate(coordinateX, coordinateY);    Coordinate out = in;    MathTransform transform = CRS.findMathTransform(sourceCRS, targetCRS);    Coordinate result = JTS.transform(in, out, transform);    DegreeCoordinates degreeCoordinates = DegreeCoordinates.fromJTSCoordinate(result);    double expectedLongitude = 131.0999928;    double expectedLatitude = 40.0099721;    assertEquals(expectedLongitude, degreeCoordinates.getLongitude(), 0.00001);    assertEquals(expectedLatitude, degreeCoordinates.getLatitude(), 0.00001);}因此测试在第一次坐标比较时失败,实际输出为:longitude : 140.340217725当经度应该是 131.0999928你有什么建议我做错了吗?先感谢您 !
查看完整描述

1 回答

?
烙印99

TA贡献1829条经验 获得超13个赞

这是一个典型的(程序员)错误,您假设您的坐标是 XY 或东-北顺序。但是,如果您查看 EPSG:5179 的定义,您会看到:


PROJCS["Korea 2000 / Unified CS", 

  GEOGCS["Korea 2000", 

    DATUM["Geocentric datum of Korea", 

      SPHEROID["GRS 1980", 6378137.0, 298.257222101, AUTHORITY["EPSG","7019"]], 

      TOWGS84[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], 

      AUTHORITY["EPSG","6737"]], 

    PRIMEM["Greenwich", 0.0, AUTHORITY["EPSG","8901"]], 

    UNIT["degree", 0.017453292519943295], 

    AXIS["Geodetic latitude", NORTH], 

    AXIS["Geodetic longitude", EAST], 

    AUTHORITY["EPSG","4737"]], 

  PROJECTION["Transverse_Mercator", AUTHORITY["EPSG","9807"]], 

  PARAMETER["central_meridian", 127.5], 

  PARAMETER["latitude_of_origin", 38.00000000000001], 

  PARAMETER["scale_factor", 0.9996], 

  PARAMETER["false_easting", 1000000.0], 

  PARAMETER["false_northing", 2000000.0], 

  UNIT["m", 1.0], 

  AXIS["Northing", NORTH], 

  AXIS["Easting", EAST], 

  AUTHORITY["EPSG","5179"]]

它的坐标是东北或 yx 所以如果你修改你的代码是:


Coordinate in = new Coordinate(coordinateY, coordinateX); 

你会得到正确的答案,我得到(40.00997217325207 131.0999927804759)。


查看完整回答
反对 回复 2022-05-21
  • 1 回答
  • 0 关注
  • 309 浏览

添加回答

举报

0/150
提交
取消
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号