Google地图和GeoJSon:经度和纬度转换 [英] Google Maps and GeoJSon: latitude and longitude conversion
问题描述
我使用Google地图API来使用google.maps.Polygon显示地图上的某个标签。我使用此转换器 http://converter.mygeodata.eu/ 将它们转换为GeoJSon格式,但纬度和经度坐标,哪里出错。
他们应该集中在意大利佛罗伦萨,但实际上我得到了这个:
1680508.8375
4847672.484
我尝试将它们分开到10000,我得到:
16.805088375
48.47672484
使我能够展示一些结果,但那不是我寻找的结果(我将它们显示在奥地利而不是佛罗伦萨)
浏览网页时,我发现此 https://groups.google.com/forum/?fromgroups#!topic/d3-js/H0zE7slqV0g ,它描述我的问题并使用d3找到解决方案。
有没有什么办法可以做到这一点,只是谷歌地图API a nd /或使用一些转换?
谢谢
我发现问题是什么。在地图中定位点有很多不同的方法。谷歌地图使用WGS84编码,但我得到了EPSG:3003编码的数据。所以他们不匹配。
我能够找到一个能够进行所有您需要的转换的js库。
http://trac.osgeo.org/proj4js/
I'm using Google Maps API to visualize some label on the map using google.maps.Polygon. I used this converter http://converter.mygeodata.eu/ to convert them in a GeoJSon format, but latitude and longitude coordinates where mistaken.
They should be centered in Florence, Italy, but actually i get this:
1680508.8375
4847672.484
I tried tho divide them by 10000 and i got:
16.805088375
48.47672484
wich alow me to show some results, but that was not the results I was looking for (I get them displayed in Austria instead of Florence)
Surfing the net I found this https://groups.google.com/forum/?fromgroups#!topic/d3-js/H0zE7slqV0g that describe my problem and find a solution using d3.
Is there any way to do that just with google maps API and/or using some conversion?
Thanks
Ok seems that I found what the problem is. There are many different way to locate a point in a map. Google Maps uses a WGS84 encoding, but i got the data in EPSG:3003 encoding. So they didn't match.
I was able to find a js library that makes all the conversion you need.
http://trac.osgeo.org/proj4js/
这篇关于Google地图和GeoJSon:经度和纬度转换的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!