Integer has better precision if you are far from zero, because floats
use only 24 bits for significant, other bits is for sign and exponent.
So 32 bit integer is better if you know extends (-180, .... 180). Min
and max of int is -2.1e9 to 2.1e9. So if you multiply longitude and
latitude by 1e7 you get almost maximum from 32bit int in all range (from
-1.8e9 to 1.8e9).
It is also faster to process. And if you are doing some difference
compression, it is easier to do with ints.
Tomas
Marcus Wolschon napsal(a):
Hello Robert,
as far as I understand it the OSM-databases store the location
in long integers anyway. Thus there is no precision to be gained
from using floats. You only loose storage-space, computation-time
and native functionality on platforms that do not have native floating-
points (like many cellphones, reflashed navigation-devices or
all mobile J2ME java-platforms).
Marcus
2008/11/12, Robert (Jamie) Munro <[EMAIL PROTECTED]>:
Floats only allow more precision as the location being considered tends
towards 0,0 latitude and longitude. For the general case, using an
integer with the same number of bits of storage will always be more
precise, particularly at the extremes.
As others have said, 32 bits gives errors of less than 10mm on the
equator, with even greater accuracy as you move away from it. This is
around 1000 times more accurate than the data in OSM can be reasonably
recorded at with standard GPS equipment.
Robert (Jamie) Munro
_______________________________________________
dev mailing list
[email protected]
http://lists.openstreetmap.org/listinfo/dev
_______________________________________________
dev mailing list
[email protected]
http://lists.openstreetmap.org/listinfo/dev