[Tilecache] Figure out the Resolutions

Tyler Durden tylersticky at gmail.com
Wed Aug 27 04:31:49 EDT 2008


Ok,
I've just figure out:
My scales: [4000000, 2000000, 1000000, 500000, 250000, 125000, 62500]
Factor = 4374754
Resolution = Scale / ( dpi * factor )
Resolution = 4000000 / ( 72 * 4374754  ) = 0.012699

On Tue, Aug 26, 2008 at 10:23 AM, Tyler Durden <tylersticky at gmail.com> wrote:
> Hi,
> I've Mapnik, Tilecache and OpenLayers installed, but I can figure out
> the "resolutions" thing.
> In my Postgis I've the WGS84(EPSG:4326) an I want to project to World
> Mercator(EPSG:3395).
> I want the bounding box to be:
> -32.691403,23.502536,-5.299716,50.894223 (this is in WGS84)
>
> tilecache.cfg
> =============
>
> [cache]
> type=Disk
> base=/home/tyler/projects/maps/tilecache/cache
>
> [world]
> type=MapnikLayer
> layers=world
> mapfile=/home/tyler/projects/maps/tilecache/osm.xml
> bbox=-32.691403,23.502536,-5.299716,50.894223
> extent_type=loose
> levels=10
> extension=png
> srs=EPSG:3395
> size=256,256
> metaTile=yes
> metaBuffer=256
> debug=yes
>
>
> OpenLayers
> ==========
> function init() {
>    var bounds = new OpenLayers.Bounds(-32.691403, 23.502536,
> -5.299716, 50.894223);
>    var options = { numZoomLevels : 10,
>                    projection    : "EPSG:3395",
>                    maxExtent     : bounds,
>                    controls      : [
>                        new OpenLayers.Control.Navigation(),
>                        new OpenLayers.Control.PanZoomBar()
>                    ]};
>
>    map = new OpenLayers.Map("map", options);
>    layer = new OpenLayers.Layer.WMS("world",
> "http://192.168.1.168:8080/", {layers: "world"});
>
>    map.addLayer(layer);
>    map.setCenter(new OpenLayers.LonLat(-8.08465, 39.56005), 0);
>    map.addControl(new OpenLayers.Control.LayerSwitcher());
> }
>
> I've got this error in the tile generation:
>
> An error occurred: can't find resolution index for 1.406250. Available
> resolutions are:
> [0.10699877734375, 0.053499388671875002, 0.026749694335937501,
> 0.01337484716796875, 0.0066874235839843752, 0.0033437117919921876,
> 0.0016718558959960938, 0.00083592794799804691, 0.00041796397399902345,
> 0.00020898198699951173]
>
> Can someone point me some documentation about the understanding of the
> resolutions stuff?
>
> Thanks in advance,
> Tyler
>



More information about the Tilecache mailing list