简体   繁体   English

如何将十进制的经度和纬度转换为WGS84坐标?

[英]How to convert latitude and longitude in decimal to WGS84 coordinate?

I am trying to display a list of points on the map. 我正在尝试在地图上显示点列表。 but these latitude and longitude are given as decimals: 但是这些纬度和经度以小数形式给出:

      index    X              y 
      1    24050.0000    123783.3333
      2    24216.6667    123933.3333
      3    24233.3333    123950.0000
      4    24233.3333    124016.6667 
         ........................

These data is taken from sources ( page ). 这些数据取自来源第页 )。 It seems I can use these data directly with Google Map API, so what should I do? 看来我可以直接在Google Map API中使用这些数据,该怎么办?

How can I convert them into a format compatible with Google Map API to display? 如何将它们转换为与Google Map API兼容的格式以显示? I am using JavaScript. 我正在使用JavaScript。

Looks to me those points are just the WGS84 coordinates multiplied by 1000. The code below gives me a reasonable location in Japan, where data is the array of points in the file you reference . 在我看来,这些点只是WGS84坐标乘以1000。下面的代码为我提供了一个在日本的合理位置,其中data是您引用的文件中的点数组

var marker = new google.maps.Marker({
  map: map,
  position: {
    lat: data[i][1] / 1000,
    lng: data[i][2] / 1000
  }

}); });

proof of concept fiddle 概念证明

日本数据点

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM