Thread
:
Maemo Mapper: GPS for the Nokia 770
View Single Post
jfheintz
2006-05-16 , 14:46
Posts: 3 | Thanked: 0 times | Joined on Feb 2006
#
107
Hello guys,
I would like to download the google maps to store it on my Nokia 770 that I can use the maemo mapper off line.
I use the following URL
http://mt.google.com/mt?n=404&v=w2.11&x=1&y=1&zoom=10
but I am using longitude and latitude instead of this x and y
and I need to convert the 2 values
I have the "x"
int tilesNumberOnASide=2^(17-zoom);
double x = Math.floor(tilesNumberOnASide*(longitude+180)/360);
but I am not able to get the value for the "y"
I have a closer look to the maemo-mapper source code, but it is quite a bit complex to me and I was not able reproduce the right formula. Moreover the 0.5f is suspicious to me.
#define MERCATOR_SPAN (-6.28318377773622f)
#define MERCATOR_TOP (3.14159188886811f)
#define latlon2unit(lat, lon, unitx, unity) { \
gfloat tmp; \
unitx = (lon + 180.f) * (WORLD_SIZE_UNITS / 360.f) + 0.5f; \
tmp = sinf(lat * (PI / 180.f)); \
unity = 0.5f + (WORLD_SIZE_UNITS / MERCATOR_SPAN) \
* (logf((1.f + tmp) / (1.f - tmp)) * 0.5f - MERCATOR_TOP); \
}
Is any body able to give me the right formula?
Quote & Reply
|
jfheintz
View Public Profile
Find all posts by jfheintz