matrix681
August 31st, 2007, 20:05
Hello,
im writing a little programm with java, where i want to see my position on a map.
so i decide to use GMDL.
first i have to thank for this great tool :thumbup:
i also have to thank for the detailed description of GPSFS at the end of the sourcefile :D
(but there seems to be a little error. there says, that the IDX begins with the highest zoom level, but it begins with the lowest zoomlevel :confused: )
however, i now can draw the map at my current position. but i have trouble with the exact positioning on the drawed map.
for better understanding a little example:
My GPS-Position is: 48.3767 16.2426
if i search this coordinates on maps.google.com i get the exact position on the freeway:
http://maps.google.com/maps?f=q&hl=en&geocode=&q=48.3767+16.2426&ie=UTF8&ll=48.376706,16.242599&spn=0.009193,0.016673&z=16&iwloc=addr&om=1
but if i draw the map on my own, im a little bit outside or on the border of the freeway:
http://stud3.tuwien.ac.at/~e0025170/fotos/gpsfs_position.jpg
i don't know much thing about the projection. i just 'translate' the code to get the gps-position of the downloaded map from the X-Y pair from the sourcecode of mapthis.
(getLatLong, getTileCoord, initLatLong)
Any idea, why the position could be not exact?
I do following to compute the position on the map:
1) i compute the coordinates of the upper-left and the lower-right corner of the image:
xLeft = getLatLong( (int)X, (int)(Y-1), 0)[1];
xRight = getLatLong( (int)(X+filesPerLine[zoomlevel]), (int)(Y+filesPerLine[zoomlevel]-1), 0)[1];
yTop = getLatLong( (int)X, (int)(Y-1), 0)[0];
yBottom = getLatLong( (int)(X+filesPerLine[zoomlevel]), (int)(Y+filesPerLine[zoomlevel]-1), 0)[0];
2) i find the 256*256 part, where my incoming GPS-Position is and draw it, with the surrounding parts in a 768*768 image.
3) i compute the position in this little image, and get a 300*300 pixel part of it.
4) my position should now be exact at the center of this 300*300 pixel, but it's not :(
sorry for my bad english and thanks in advance,
Ahmet Y.
im writing a little programm with java, where i want to see my position on a map.
so i decide to use GMDL.
first i have to thank for this great tool :thumbup:
i also have to thank for the detailed description of GPSFS at the end of the sourcefile :D
(but there seems to be a little error. there says, that the IDX begins with the highest zoom level, but it begins with the lowest zoomlevel :confused: )
however, i now can draw the map at my current position. but i have trouble with the exact positioning on the drawed map.
for better understanding a little example:
My GPS-Position is: 48.3767 16.2426
if i search this coordinates on maps.google.com i get the exact position on the freeway:
http://maps.google.com/maps?f=q&hl=en&geocode=&q=48.3767+16.2426&ie=UTF8&ll=48.376706,16.242599&spn=0.009193,0.016673&z=16&iwloc=addr&om=1
but if i draw the map on my own, im a little bit outside or on the border of the freeway:
http://stud3.tuwien.ac.at/~e0025170/fotos/gpsfs_position.jpg
i don't know much thing about the projection. i just 'translate' the code to get the gps-position of the downloaded map from the X-Y pair from the sourcecode of mapthis.
(getLatLong, getTileCoord, initLatLong)
Any idea, why the position could be not exact?
I do following to compute the position on the map:
1) i compute the coordinates of the upper-left and the lower-right corner of the image:
xLeft = getLatLong( (int)X, (int)(Y-1), 0)[1];
xRight = getLatLong( (int)(X+filesPerLine[zoomlevel]), (int)(Y+filesPerLine[zoomlevel]-1), 0)[1];
yTop = getLatLong( (int)X, (int)(Y-1), 0)[0];
yBottom = getLatLong( (int)(X+filesPerLine[zoomlevel]), (int)(Y+filesPerLine[zoomlevel]-1), 0)[0];
2) i find the 256*256 part, where my incoming GPS-Position is and draw it, with the surrounding parts in a 768*768 image.
3) i compute the position in this little image, and get a 300*300 pixel part of it.
4) my position should now be exact at the center of this 300*300 pixel, but it's not :(
sorry for my bad english and thanks in advance,
Ahmet Y.