[Tilecache] a question about the getCell function

creta kano creta.kano at gmail.com
Thu Jul 17 10:57:27 EDT 2008


Hi,

The SuperOverlays.txt document
(http://tilecache.org/docs/SuperOverlays.txt) gives this example for
the getCell operation:

  >>> cell = basic.getCell((-10,-90,12,-80), exact=False)
  >>> cell
  (8, 0, 3)

The getCell function calculates x,y,z using:

        res = self.resolutions[z]
        x0 = (minx - self.bbox[0]) / (res * self.size[0])
        y0 = (miny - self.bbox[1]) / (res * self.size[1])

Assuming the standard zoom levels,  plug and chug gives you

res = 0.02197265625
x0 = (-10 - -180) / (0.02197265625 * 256)
x0 = 30.22

That is nowhere near 8, which is what the example shows.  So what am I missing?

sophia



More information about the Tilecache mailing list