200分求救,gps

kongyanmin 2010-04-21 02:12:25
各位大侠们,能不能帮小弟一把,告诉我Symbian 内置gps ,我用GetPosition(pos);得到的是六位数据,是不是就只能返回六位呢,还是能够返回更多位数据,我想得到至少8位的经纬度。
...全文
200 27 打赏 收藏 转发到动态 举报
写回复
用AI写文章
27 条回复
切换为时间正序
请发表友善的回复…
发表回复
zhaopeng3 2010-04-22
  • 打赏
  • 举报
回复
已回复
kongyanmin 2010-04-22
  • 打赏
  • 举报
回复
http://topic.csdn.net/u/20100422/08/46d4679a-1e48-4a35-b60d-66e33d42842a.html?98220

http://topic.csdn.net/u/20100420/09/45445571-63c8-4aee-b62a-76b41083cf66.html?33776
kongyanmin 2010-04-22
  • 打赏
  • 举报
回复
希望zhaopeng3你能够在这几个帖子中写下,我好给你分
kongyanmin 2010-04-22
  • 打赏
  • 举报
回复
太感谢21楼了
漁_夫 2010-04-22
  • 打赏
  • 举报
回复
21楼是我老大。。。。哈哈。。。
漁_夫 2010-04-22
  • 打赏
  • 举报
回复
呵呵。。问题在这里。。。
zhaopeng3 2010-04-22
  • 打赏
  • 举报
回复
[Quote=引用 20 楼 kongyanmin 的回复:]

可是我不知道应该怎么输出呢
[/Quote]
qDebug("%.8f", d);
结果
1.23456789
kongyanmin 2010-04-22
  • 打赏
  • 举报
回复
可是我不知道应该怎么输出呢
zhaopeng3 2010-04-22
  • 打赏
  • 举报
回复
经纬度本身的精度足够,只是输出的问题.
Juncof 2010-04-22
  • 打赏
  • 举报
回复
/**
@publishedAll
@released

64-bit floating point number; identical to TReal64.

Use of floating-point numbers should generally be avoided unless a natural
part of the problem specification. Most Symbian OS implementations do not
have a hardware floating point unit: as a result, their floating-point performance
is hundreds of times slower than integer performance.

Most serious floating-point calculations require double-precision. All standard
math functions (see Math class) take double-precision arguments. Single-precision
should only be used where space and performance are at a premium, and when
their limited precision is acceptable.

@see TReal64
@see Math
*/
typedef double TReal;

/**
@publishedAll
@released

32-bit floating point number, providing IEEE754 single precision on all Symbian
OS implementations.

TReal should normally be used in preference to TReal32.

Use of floating-point numbers should generally be avoided unless a natural
part of the problem specification. Most Symbian OS implementations do not
have a hardware floating point unit: as a result, their floating-point performance
is hundreds of times slower than integer performance.
*/
typedef float TReal32;


IMPORT_C TReal64 Latitude() const;
IMPORT_C TReal64 Longitude() const;

float的精度为7位数字,只保证7位有效数字。你的要求必须用双精度double。否则即使得到了第8位,不能保证是准确的。
而且,Symbian OS在处理浮点数上本身就是不完善的,与备受诟病的WM还是差了一截。
kongyanmin 2010-04-22
  • 打赏
  • 举报
回复
[Quote=引用 16 楼 zhaopeng3 的回复:]
我没有搭建Qt for Symbian环境,只是在Windows下试了一下,我不知道你的输出方法是怎么写的
float f = 1.2345678901234;
qDebug() << f;
double d = 1.234567890123;
qDebug() << d;
以上代码在Console中输出为
1.23457
1.23457
变量本身的精度都被截断了
[/Quote]
你说的很对,之前我没有发现
zhaopeng3 2010-04-22
  • 打赏
  • 举报
回复
我没有搭建Qt for Symbian环境,只是在Windows下试了一下,我不知道你的输出方法是怎么写的
float f = 1.2345678901234;
qDebug() << f;
double d = 1.234567890123;
qDebug() << d;
以上代码在Console中输出为
1.23457
1.23457
变量本身的精度都被截断了
kongyanmin 2010-04-22
  • 打赏
  • 举报
回复
[Quote=引用 14 楼 zhaopeng3 的回复:]
你根据什么说是6位的?
通过%f输出log?
如果是这样的话当然是6位的.
[/Quote]
qDebug,因为我用的是qt封装过的
zhaopeng3 2010-04-22
  • 打赏
  • 举报
回复
你根据什么说是6位的?
通过%f输出log?
如果是这样的话当然是6位的.
kongyanmin 2010-04-22
  • 打赏
  • 举报
回复
按理说定义为TReal64位,那么返回的经度值不应该只有6位数据呀,应该是有很多位呀。
/**
* Accessor for latitude.
* @return the latitude component of this coordinate.
*/
IMPORT_C TReal64 Latitude() const;

/**
* Accessor for longitude.
* @return the longitude component of this coordinate.
*/
IMPORT_C TReal64 Longitude() const;
kongyanmin 2010-04-22
  • 打赏
  • 举报
回复
[Quote=引用 11 楼 zhaopeng3 的回复:]
精度的定义就是32位的,有效数字就是6~7位.无法达到8位.
class TLocality
TReal32 iHorizontalAccuracy;
[/Quote]
那么经纬度是不是定义为TReal64位的吗,为什么我得到的数据只有6位
zhaopeng3 2010-04-22
  • 打赏
  • 举报
回复
精度的定义就是32位的,有效数字就是6~7位.无法达到8位.
class TLocality
TReal32 iHorizontalAccuracy;
kongyanmin 2010-04-21
  • 打赏
  • 举报
回复
arthersophy,因为是要求我必须能够达到8位数数据,所以我一直在找方法,看能不能得到8位数据,不知道老兄可否知道,应该如何做呢?
kongyanmin 2010-04-21
  • 打赏
  • 举报
回复
[Quote=引用 8 楼 arthersophy 的回复:]
这是个范围。。。179精度有点低。。。建议设置在3000-5000吧,取不到合适的精度就不停去取。。取值应该很快的。毫秒级别
[/Quote]
我看到hAcc最小是时候也就是13,但是他的位数为什么始终是6位呢,为什么不能得到116.24721,这样的数据呢
漁_夫 2010-04-21
  • 打赏
  • 举报
回复
这是个范围。。。179精度有点低。。。建议设置在3000-5000吧,取不到合适的精度就不停去取。。取值应该很快的。毫秒级别
加载更多回复(7)

3,119

社区成员

发帖
与我相关
我的任务
社区描述
塞班系统(Symbian系统)是塞班公司为手机而设计的操作系统,它的前身是英国宝意昂公司的 EP ( Electronic Piece of cheese)操作系统。
社区管理员
  • Symbian社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧