There were actually three reasons why the old GeoPoint implementation
used integers instead of doubles:
1) compatibility with the API of the Google Map Add-On
2) avoid floating point operations and save main memory
3) the binary map format, which stores coordinates as microdegrees
After the 0.3.0 release the GeoPoint class had already been changed to
doubles which is also the implementation in the corresponding LatLong
class in the rewrite branch. As geographical coordinates are degrees, it
makes no sense to store them as integer. Even if our map file format
does (currently) not offer a higher precision, the performance benefit
is negligible. Having coordinates in degrees allows you to easily copy
and paste them into any other map application (e.g. Google Maps) and
avoids confusion and potential bugs. So changing to doubles was really
an improvement and I promise you to never go back to integers again. :-)
Greetings,
Thilo
On 14/06/13 08:19, Ludwig wrote:
> Sorry, I was looking at the current master, where the GeoPoint stores
> lat/lon as double, as does the new LatLong class in rewrite that will
> replace the GeoPoint in 0.4.
>
> I think the reason for this used to be to avoid floating point
> operations as much as possible and actually using this much precision
> is, for general mapping purposes, enough to store the available
> accuracy: unless you are working with high differential GPS your
> accuracy will never be that much better than 10m and often much worse
> (even if your device pretends otherwise: try it by waypointing a point
> on different days).
>
> Ludwig
>
>
>
> On 13 June 2013 20:59, Michele Mondelli <
mithe...@gmail.com
> <mailto:
mapsforge-dev%2Bunsu...@googlegroups.com>.