NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

Hi,

I am a developer and I need the function y=f(x)=? between the latitude (=x; -90 <= x <= 90) and the tile number on zoom level 16 (=y; 0 <= y <= 65536) for my mobile game. I exported the osm tiles with Maperitive and I need to convert the gps position of the phone to the tile number (x, y). I already have an algorithm to determine the x value of the tile number but I need the y value too. I can get the function by myself, but I would need to spend days on getting an accurate function because it seems to be a function with a degree over 10.
So anyone knows the function? Or maybe how to convert the tile numbers to meters? If you're wondering why I don't just simply implement osm to my game ... one reason is that I need to deactivate some labels for my game.

I attached three screenshots with the graph, the value table and the tiles for better understanding.

Full graph:

full graph

Part of the graph with value table:

alt text

Tiles generated with Maperitive (zoom level 16):

alt text

asked 26 Jun '17, 18:53

Time2Design's gravatar image

Time2Design
15223
accept rate: 0%


permanent link

answered 26 Jun '17, 19:20

maxerickson's gravatar image

maxerickson
12.7k1083176
accept rate: 32%

thank you!

(26 Jun '17, 20:26) Time2Design

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×287
×48
×4

question asked: 26 Jun '17, 18:53

question was seen: 3,241 times

last updated: 26 Jun '17, 20:26

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum