问题描述
喜我有一个小麻烦搞清楚如何类型的坐标之间的转换。我有一个列表的坐标集在下面的描述
HiI 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
坐标总是在WGS84系统,所有的坐标psented作为整数重新$ P $值x和y,其中坐标值乘以百万
"Coordinates are always in the WGS84 system. All coordinates a represented as integervalues x and y where the coordinate value is multiplied with 1,000,000."
一个例子:559262 6319512
An example:559262 6319512
嗯,我需要把这些转换为经度/纬度(反面)这样我就可以在谷歌地图(安卓)使用这些。但是,这并不像它的接缝容易。我一直在寻找周围,确实发现一些code要做到这一点,但它并没有缝正常工作。任何人谁可以提供一些code这样做?如果可能的话,我想避免一个大的地理框架(它在一个Android应用程序中使用)。
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).
感谢。
最好的问候,肯尼斯
编辑:我发现我自己的解决方案。我在这里下载类的描述: http://www.ibm.com/developerworks/java/library/j- coordconvert /
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
推荐答案
如果您正在从Android上GPS的位置,你会得到保存纬度/龙作为双打Location对象。为了显示在谷歌地图的一个点,你需要使用把这些双重价值成的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:
GeoPoint location = new GeoPoint(
(int) (mLocation.getLatitude()) * 1E6),
(int) (mLocation.getLongitude()) * 1E6)
);
这就是希望有所帮助。
Hope thats helpful.
这篇关于转换WGS 84 LAT /长的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!