[OSGeo-Brasil] Tile Cache em disco uso do OpenLayers.JS

Luiz Motta motta.luiz em gmail.com
Quinta Junho 3 14:43:55 EDT 2010


Colegas,

Estou estudando o uso do Tilecache via OpenLayer, sendo a fonte do layer 
uma imagem de satélite "cacheada".
Armazenaria a imagem em disco e usaria no Openlayers () como um layer do 
tipo tilecache.
Exemplo:
            var lyrtilecache = new OpenLayers.Layer.TileCache(
                "TileCache Layer",
                ["http://c0.labs.metacarta.com/wms-c/cache/",
                "http://c1.labs.metacarta.com/wms-c/cache/",
                "http://c2.labs.metacarta.com/wms-c/cache/",
                "http://c3.labs.metacarta.com/wms-c/cache/",
                "http://c4.labs.metacarta.com/wms-c/cache/"],
                "basic"
            );

* Página no Openlayers: 
http://dev.openlayers.org/releases/OpenLayers-2.9.1/doc/apidocs/files/OpenLayers/Layer/TileCache-js.html

Entendo que nem preciso de um serviço rodando, bastaria ter os tiles 
armazenados no disco.
Para geração dos tiles, usaria o " tilecache_seed.py".

O objetivo é disponibilizar grande quantidades de imagens de satelite, 
sem demandar processo no servidor(Ex.: WMS).

As imagens em formato de tiles, seriam consumidas pelo QGIS, usando o 
layer do tipo "PluginLayer".
O PluginLayer está na fase de desenvolvimento e pode ser testado com o 
plugin "Openlayers".

Estou colaborando com o plugin OpenLayers, e gostaria de testar com 
alguma imagem (seja de satélite ou obtidas via WMS) que esteja disponível
para o Openlayers na forma de OpenLayers.Layer.TileCache.

No teste que fiz (uso do layer disponível pela Metacarta), não obtive 
sucesso, por não ter os parâmetros que foram utilizados na geração dos 
tiles,
ver material:
http://tilecache.org/readme.html
"The most important thing to do is to ensure that the OpenLayers Layer 
has the same resolutions and bounding box as your TileCache layer"

No teste, a definição do mapa p/ o Openlayers foi o mesmo utilizado p/ 
acessar os layers do Google, Open Street Map e Yahoo:
    <script type="text/javascript">
        var map;

        function init() {
            map = new OpenLayers.Map('map', {
                theme: null,
                controls: [],
                projection: new OpenLayers.Projection("EPSG:900913"),
                units: "m",
                maxResolution: 156543.0339,
                maxExtent: new OpenLayers.Bounds(-20037508.34, 
-20037508.34, 20037508.34, 20037508.34)
            });

            var lyrtilecache = new OpenLayers.Layer.TileCache(
                "TileCache Layer",
                ["http://c0.labs.metacarta.com/wms-c/cache/",
                "http://c1.labs.metacarta.com/wms-c/cache/",
                "http://c2.labs.metacarta.com/wms-c/cache/",
                "http://c3.labs.metacarta.com/wms-c/cache/",
                "http://c4.labs.metacarta.com/wms-c/cache/"],
                "basic"
            );
            map.addLayer(lyrtilecache);
            map.setCenter(new OpenLayers.LonLat(0, 0), 2);
        }
    </script>

Gostaria se alquem já utilizo técnica ?

[]'s
Luiz Motta



Mais detalhes sobre a lista de discussão Brasil