将 wgs 84 转换为纬度/经度
你好 我在弄清楚如何在坐标类型之间进行转换时遇到了一些麻烦。我有一个坐标集列表,其描述如下
“坐标始终在 WGS84 系统中。所有坐标 a 表示为整数 值 x 和 y,其中坐标值乘以 1,000,000。”
示例: 559262 6319512
好吧,我需要将它们转换为长/纬度(以及反向),以便我可以在谷歌地图(android)中使用它们。但这并不像看上去那么容易。我一直在四处寻找,确实找到了一些代码来执行此操作,但它似乎无法正常工作。谁可以提供一些代码来执行此操作?如果可能的话,我想避免使用大型地理框架(它必须在 Android 应用程序中使用)。
谢谢。
最好的问候,肯尼思
编辑: 我确实自己找到了解决方案。我下载了此处描述的课程: http://www.ibm.com/developerworks/java/library/j- coordconvert/
并且工作正常。希望有人能发现它有用。
我很抱歉在认真完成我的作业之前发帖。感谢所有发帖的人
Hi
I am having a little trouble figuring out how to convert between types of coordinates. I have a list of coordinate sets with the following description
"Coordinates are always in the WGS84 system. All coordinates a represented as integer
values x and y where the coordinate value is multiplied with 1,000,000."
An example:
559262 6319512
Well, I need to convert these to long/lat (and back) so i can use these in google maps (android). But this is not as easy as it seams. I have been searching around and did find some code to do this, but it does not seam to work properly. Anyone who can provide some code for doing this? If possible, I would like to avoid a big geo framework (it has to be used in an android application).
thanks.
best regards, kenneth
EDIT:
I did find a solution on my own. I downloaded the class described here:
http://www.ibm.com/developerworks/java/library/j-coordconvert/
And it works fine. Hope someone can find it useful.
I am sorry for posting before having done my homework decently. Thanks to everyone who posted
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您从 Android 上的 GPS 获取位置,您将获得一个 Location 对象,其中包含纬度/经度的双精度值。为了在 Google 地图上显示一个点,您需要使用以下方法将这些双精度值转换为 GeoPoint 对象:
希望有帮助。
If you're getting the location from the GPS on android, you will get a Location object that holds Lat/Long as doubles. In order to display a point on Google Maps, you need to turn these double values into a GeoPoint object using:
Hope thats helpful.
所有 GPS 系统都会给出相对于 WGS84 地球模型的纬度和经度。除非您打算给出一个国家的本地模型(例如英国 OSGB36 模型)的纬度/经度,否则您应该将您拥有的坐标视为代表微度。即使在英国,海军部现在也打印带有相对于 WGS84 的纬度/经度的海图,我预计地形测量局的陆地地图将很快效仿,如果他们还没有这样做的话。
All GPS systems give their latitude and longitude with respect to the WGS84 model of the Earth. Unless you intend to give the lat/lon with respect to a nation's local model, such as the British OSGB36 model, you should be fine treating the coordinates you have as representing microdegrees. Even here in the Britain, the Admiralty now print their nautical charts with lat/lon relative to WGS84, I expect the Ordnance Survey land maps will follow suit soon, if they haven't already done so.