[talk-au] Calculate tile numbers?

Ben Kelley ben.kelley at gmail.com
Sat Jan 19 22:01:39 GMT 2008


Ah. I found the problem.

This page is helpful:
http://wiki.openstreetmap.org/index.php/Slippy_map_tilenames

A couple of problems: Latitude goes from -85.0511 to +85.0511 (not -90 to
+90), and also it uses a Mercator projection.

Now I just need to get the correct WKT for my projection... (I'm using
geotools for the projection stuff.)

 - Ben Kelley

On Jan 20, 2008 8:48 AM, Ben Kelley <ben.kelley at gmail.com> wrote:

> Hi.
>
> OK - I have my code to calculate the tile numbers from the lat/long
> correct, but my calibration seems a bit out when I open the resulting map in
> Ozi Explorer.
>
> I have set it to be WGS84 datum (which I assume is correct), but I have
> the projection as lat/long, which I suspect is where my problem lies.
>
> The longitude comes out correct. e.g. Australia starts at approx 113
> degrees east and goes to approx 154 degrees east.
>
> The latitude is wrong though. For the whole world it goes from -90 to +90,
> and the equator appears in about the right place, but in between the equator
> and the poles things are not right. e.g. The tip of Cape York seems to be
> at about 5 degrees south and the bottom of Tasmania is about 24 degrees
> south. The correct location is approx 10 degrees south and 43 degrees south.
>
> Does anyone have any ideas? I'm guessing a projection problem at this
> point.
>
>  - Ben Kelley.
>
>
> On Jan 13, 2008 6:25 PM, Brent Easton <b.easton at exemail.com.au> wrote:
>
> >
> > Hi Ben,
> >
> > >*********** REPLY SEPARATOR ***********
> > >
> > >On 13/01/2008 at 6:04 PM Ben Kelley wrote:
> > >Hi.
> > >
> > >Does anyone know the formula to convert lat/long to tile numbers at a
> > >given zoom? I remember reading it somewhere, but couldn't find it.
> > >
> > >It seems that at zoom 0 there is a single tile (256x256) covering the
> > >whole world (-90 to +90 and -180 to +180), and then at zoom n+1 the
> > tile
> > >size is 1/2 as big (lat and long, so 1/4 really) as at the previous
> > zoom
> > >level. Is that correct? If so I could probably work out the formula
> > >myself.
> >
> > Yes. That's how it works.
> >  <b.easton at uws.edu.au>
> >
> >
>
>
>


-- 
Ben Kelley
ben.kelley at gmail.com
http://www.users.on.net/~bhkelley/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/talk-au/attachments/20080120/a58d2721/attachment.html>


More information about the Talk-au mailing list