OpenStreetMap Forum

The Free Wiki World Map

You are not logged in.

#1 2019-02-05 15:23:23

MiniEggs
Member
Registered: 2019-02-05
Posts: 3

Calculate png tiles around a tile(s)

Hi All

I'm sure this must have been asked a zillion times on here but I don't seem to be able to find the answer

I have successfully used the formula to calculate a png tile from a lat/long

How do I now calculate the eight tiles around that and then the sixteen around those

Thanks in advance

Offline

#2 2019-02-05 17:45:18

wambacher
Member
From: Schlangenbad/Wambach, Germany
Registered: 2009-12-16
Posts: 15,691
Website

Re: Calculate png tiles around a tile(s)

Here is a starting point: https://wiki.openstreetmap.org/wiki/Tiles

Regards
walter

Offline

#3 2019-02-05 18:06:26

MiniEggs
Member
Registered: 2019-02-05
Posts: 3

Re: Calculate png tiles around a tile(s)

Thanks for the reply

I'm not sure how that helps me .... unless I am missing the bleedin' obvious ? big_smile

Offline

#4 2019-02-05 18:25:35

alester
Member
Registered: 2011-09-21
Posts: 193

Re: Calculate png tiles around a tile(s)

The tiles are numbered sequentially starting from 0 at the west and north according to this. It should be as easy as incrementing and decrementing the x and y by 1 to find the adjacent tiles. For the 16 tiles, you'd increment and decrement by 2.

Offline

#5 2019-02-06 15:03:22

MiniEggs
Member
Registered: 2019-02-05
Posts: 3

Re: Calculate png tiles around a tile(s)

Thanks penny dropped. It was a long day

I had thought it was (which is clearly wrong)

123
456
789

When it is obviously
123
223
323

Offline

Board footer

Powered by FluxBB