Given a latitude and longitude, I can find the correct tile number - but how do I find the correct position (in pixel) on the tile? This question is marked "community wiki". asked 07 Sep '10, 08:14 petschge closed 17 Feb '11, 14:03 |
4 Answers:
When you calulate the tile number according to the wiki you will actually get a floating point number. The integer part indicates which tile you are (or should be) looking at. The fractional part indicates the position within the tile. As a tile is 256 pixel wide, multiplying the fractional part with 256 will give you the pixel position from the top left. answered 07 Sep '10, 08:16 petschge edited 07 Sep '10, 10:19 Gnonthgol ♦ Can you show a detailed example? for example we have lat : 36 lon: 6 we create square earth map with real scale in autocad how we can find the position x,y of the coordinates in the map? i don't see an example or a formula in the wiki (14 Oct '21, 06:27) Seghier |
If you just want to see the position on the map, you can use mlat and mlon to get a marker. answered 07 Sep '10, 13:39 scai ♦ what you mean by mlat and mlon? where is the formula? (14 Oct '21, 06:29) Seghier |
I've written the following conversion functions to convert from Lat/Long coordinates to OSM pixel x,y coordinates for a given zoom level.
answered 14 Nov '11, 10:27 johnmeilak |
In the editor, press CTRL+SHIFT+L to display the Location Panel. answered 09 Jan '23, 11:19 joper34 edited 09 Jan '23, 11:24 |
related to the question about coordinates to pixels