[Spanish] Ayuda Tilecache+mapserver+openlayers

José González josego at simgia.com
Thu Mar 21 15:23:41 PDT 2013


yo use el tilecache con openlayers, pero tilechache 2.10 con openlayers
2.10, porque en esa epoca estaba openlayers 2.10, tilecache 2.11 no
funcionaba bien. tenia busga.

En la configuracion del apache:

<Directory /var/www/tilecache/>

         AddHandler mod_python .py

         PythonHandler TileCache.Service

         PythonOption TileCacheConfig /var/www/tilecache/tilecache.cfg

         PythonPath "['var/www/tilecache/'] + sys.path

         PythonDebug On

  </Directory>


Como dicen por arriba, usa los logs de apache para ver que te arroja. capaz
que sean permisos de escritura de una carpeta.
En el archivo del tilecache en donce menciono el layer lo tengo asi:

[MapaParaguay]

type=WMSLayer

layers=lineas_calles_residenciales,area_rios,area_lagos_lagunas,area_cementerio,lineas_rutas_nacionales,lineas_limites_internacionales,lineas_avenidas__ruta_arterial,lineas_camino_sin_pavimentar,lineas_limite_provincia__region,lineas_colectoras,lineas_arroyo_rios,lineas_arroyos,lineas_arroyos_causes_intermitentes,area_aguas,area_parque_municipal,area_aeropuertos,area_complejo_deportivo,puntos_ciudad,puntos_estado_provincia_region

url=http://localhost/cgi-bin/mapserv?map=/home/josego/mapaParaguay.map

extension=png

srs=EPSG:4326

extent_type=loose

bbox=-62.6454,-27.4933,-54.1077,-19.2755

maxResolution=0.013052769

resolutions=0.013052769,0.00846666,0.00070555,0.00007937,0.000079371095,0.000003968477,0.091309,0.005706609,0.00071335068,0.000089168836,0.000044584418,0.0028534028,0.022827

levels=6

metaTile=false

size=256,256

mime_type=image/png


Espero que te sirva.

saludos, jose


El 21 de marzo de 2013 12:22, Pedro-Juan Ferrer Matoses
<pferrer en osgeo.org>escribió:

> Esto lo tengo olvidadísimo (ahora mismo nos hemos pasado a MapProxy)
> pero me suena que en el tilecache.cfg no necesitas definir el type
> como {Mapserver,WMS}
>
> Yo lo dejaría solo como WMS y quitaría el par mapfile=
>
> En la configuración de Apache yo lo tenía montado así
>
>                 AllowOverride None
>                 AddHandler python-program .py
>                 PythonHandler TileCache.Service
>                 PythonOption TileCacheConfig /etc/tilecache.cfg
>                 Order deny,allow
>                 Allow from all
>
> Pero sobretodo activa los logs de Apache y consultalos a ver si tienes
> más información allí
>
> On Wed, Mar 13, 2013 at 4:29 PM, Anderson castellanos
> <castellanos825 en hotmail.com> wrote:
> > Buenos dias he ralizado un servicio de mapas con mapserver (ms4w) y
> > openlayers, sin embargo al tratar de integrar tilecache al mismo, he
> > fracasado. he seguido las instrucciones de algunos foros pero sin éxito
>  por
> > favor si alguien pudiera ayudarme estaria muy agradecido.
> > estoy utilizando:
> > Ms4w 3.0.4
> > Openlayers 2.1.2
> > Tilecache 2.11
> > python 2.6.2
> >
> >
> > archivo tilecache.cfg
> >
> > [cache]
> > type=Disk
> > base=C:/ms4w/tmp/tilecache
> >
> > [mapa]
> > type={MapServer,WMS}
> > mapfile=C:/ms4w/Apache/htdocs/map/mapfile4.map
> > url=
> http://localhost:8080/cgi-bin/mapserv.exe?MAP=C:/ms4w/Apache/htdocs/map/mapfile4.map
> >
> layers=Provincias,PaisesVecinos,Rios,Lagos,Edificaciones,Calles,Corregimiento,Distritos
> > extension=png
> > size=256,256
> > bbox=-89.512776,0.635665,-66.577208,12.207839
> > srs=EPSG:4326
> > levels=8
> >
> resolutions=0.009,0.00813762678,0.0017525356000000000000,0.0009633874600000000000,0.0004128803400000000000,0.0000564401700000000000,0.0000412881622611744000,0.0000072346966
> > extent_type=loose
> >
> >
> > archivo httpd.conf
> >
> > <Directory "C:/ms4w/Apache/htdocs/tilecache/">
> > AddHandler cgi-script .cgi
> > Options +ExecCGI
> > </Directory>
> >
> >
> > archivo tilecache.cgi
> >
> > #!C:/Python26/python.exe?
> >
> > from TileCache import Service, cgiHandler, cfgfiles
> >
> > if __name__ == '__main__':
> >     svc = Service.load(*cfgfiles)
> >     cgiHandler(svc)
> >
> >
> > Archivo Openlayers
> >
> >
> >       var map ;
> >         function init(){
> >
> > bounds = new OpenLayers.Bounds();
> > bounds.extend(new OpenLayers.LonLat(-89.512776,0.635665));
> > bounds.extend(new OpenLayers.LonLat(-66.577208,12.207839));
> > var scale1 = 0.009;
> > var scale2 = 0.00813762678;
> > var scale3 = 0.0017525356000000000000;
> > var scale4 = 0.0009633874600000000000;
> > var scale5 = 0.0004128803400000000000;
> > var scale6 = 0.0000564401700000000000;
> > var scale7 = 0.0000412881622611744000;
> > var scale8 = 0.0000072346966;
> >   map_service =
> > '
> http://localhost:8080/cgi-bin/mapserv.exe?MAP=C:/ms4w/Apache/htdocs/map/mapfile4.map
> ';
> >   map = new OpenLayers.Map(
> > 'map',
> > {
> > units: "m",
> > maxResolution: scale1,
> > minResolution: 0.000007234696613999980,
> > maxExtent: bounds,
> > restrictedExtent: bounds,
> > numZoomLevels: 8,
> > controls: [new OpenLayers.Control.Navigation(),
> >                                                          new
> > OpenLayers.Control.PanZoomBar(),
> > new OpenLayers.Control.MousePosition()],
> > }
> > );
> >
> >
> > ingeomaps_layer0 =new OpenLayers.Layer.WMS(
> > "L0",//'http://127.0.0.1?' ,
> > map_service,
> > {
> > layers:
> > 'Basef',
> > transparent: 'false',
> > format: 'gif'
> > },
> > {
> > isBaseLayer:true,
> > visibility:false
> > }
> > );
> > ingeomaps_layer0.setVisibility(false);
> >
> > // registerEvents(ingeomaps_layer0);
> > ingeomaps_layer1 =new OpenLayers.Layer.WMS(
> > "L1",
> > map_service,
> > {
> > layers:
> > 'PaisesVecinos'+
> >                                                 ',PaisesVecinos_txt'+
> > ',Provincias'+
> > ',Provinciastxt'+
> > ',Parques'+
> > ',Calles'+
> > ',Lagos',
> > transparent: 'true',
> > format: 'png'
> > },
> > {
> > isBaseLayer:false, transitionEffect: 'resize',visibility:true,
> > minResolution: scale2,
> > maxResolution: scale1
> > }
> > );
> > ingeomaps_layer2 =new OpenLayers.Layer.WMS(
> > "L2",
> > map_service,
> > {
> > layers:
> > 'PaisesVecinos'+
> > ',PaisesVecinos_txt'+
> > ',Provincias'+
> > ',Provinciastxt'+
> > ',Distritostxt'+
> > ',Parques'+
> > ',Calles'+
> > ',Lagos',
> > transparent: 'true',
> > format: 'png'
> > },
> > {
> > isBaseLayer:false, transitionEffect: 'resize',visibility:true,
> > maxResolution: scale2,
> > minResolution: scale3
> > }
> > );
> >                                                         .
> >                                                         .
> >                                                         .
> >                                                         .
> >
> >
> map.addLayers([ingeomaps_layer0,ingeomaps_layer1,
> > ingeomaps_layer1_1, ingeomaps_layer2 ....]);
> >                                   if (!map.getCenter()) {
> > map.zoomToMaxExtent();
> > }
> >
> > Al abrir el mapa en el navegador no me genera genera las imagenes en
> disco,
> > por lo tanto supongo que el principal problema es la configuración del
> > tilecache.
> >
> >
> > _______________________________________________
> > Spanish mailing list
> > http://lists.osgeo.org/mailman/listinfo/spanish
> > http://es.osgeo.org
> > http://twitter.com/osgeoes
> >
>
>
>
> --
> Pedro-Juan Ferrer Matoses
> Valencia (España)
> _______________________________________________
> Spanish mailing list
> http://lists.osgeo.org/mailman/listinfo/spanish
> http://es.osgeo.org
> http://twitter.com/osgeoes
>
------------ pr?xima parte ------------
Se ha borrado un adjunto en formato HTML...
URL: <http://lists.osgeo.org/pipermail/spanish/attachments/20130321/55963b94/attachment.html>


More information about the Spanish mailing list