|
August 31st, 2007, 21:05 Posted By: matrix681
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
(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 )
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=e...wloc=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/...s_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:
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.
For more information and downloads, click here!
There are 5 comments - Join In and Discuss Here
|
|