Using TileCache, OpenLayers, Mapserver for Projection 900913
I had a few problems with TileCache the other week which I am eager to blog about, since I knew for sure that later on, I might encounter the same. I don’t have the exact errors with me right now, so I’m jotting this down from my head…
- Classic Resolutions problem. Use extent_type=loose
- Can not set image type
UPDATED (JAN 11, 2010): Classic Resolutions problem:
How are resolutions calculated? Assuming we have:
Original:
Lower Left (LL) or minx, miny: 12453557, -5434940
Upper Right (UR) or max, maxy: 16980842, -1180729
maxResolution = (max – minx)/tilesize = (16980842 – 12453557)/512 = 8842.353
where tilesize = 512.
Therefore, we can set/guess for max so that we have maxResolution as a whole number.
Adjusted:
minx, miny: 12453557, -5434940
maxx, maxy: 16980661, -1180729
gives a maxResolution (whole number) of 8842.
Now, you can use 8842 in both the TileCache.cfg and OpenLayers Javascript. Read more…