[Tilecache] TileCache doesn't work correct for layer with sld
styling
Rahn Hanno (rahn)
rahn at zhaw.ch
Thu Oct 15 05:15:18 EDT 2009
hello list,
I'm new in using TileCache with OpenLayers. Perhaps you can help me.
I try to make Tiles for different Layers. First I have some Polygons with region-borders. After this I have some background data like streets for example.
In my OpenLayers file I use the follwing code:
var url = "http://webgis.hsw.ch/GINES/Styling/mysld_bezirke.php <http://webgis.hsw.ch/GINES/Styling/mysld_bezirke.php> ?";
var urlFusion = "http://webgis.hsw.ch/GINES/Styling/mysld_fusion.php <http://webgis.hsw.ch/GINES/Styling/mysld_fusion.php> ?";
var urlArray = ["http://webgis.hsw.ch/cgi-bin/mapserv.exe <http://webgis.hsw.ch/cgi-bin/mapserv.exe> ?", "http://195.176.253.211/cgi-bin/mapserv.exe <http://195.176.253.211/cgi-bin/mapserv.exe> ?"];
var urlArrayTC = ["http://webgis.hsw.ch/cgi-bin/tilecache/tilecache.cgi <http://webgis.hsw.ch/cgi-bin/tilecache/tilecache.cgi> ?"];
var mapFile = "../htdocs/GINES/Maps/Gemeinden_Bern.map";
var options1 = {
maxExtent: new OpenLayers.Bounds(555100,129900,678450,245000),
maxScale: '500',
minScale: '458262',
resolutions:[481.8359375, 240.91796875, 120.458984375, 60.2294921875, 30.11474609375, 15.057373046875, 7.5286865234375, 3.76434326171875, 1.882171630859375, 0.9410858154296875, 0.47054290771484375, 0.23527145385742188, 0.11763572692871094, 0.058817863464355469, 0.029408931732177734, 0.014704465866088867, 0.0073522329330444336, 0.0036761164665222168, 0.0018380582332611084, 0.0009190291166305542],
maxresolution:481.8359375,
minresolution:0.0009190291166305542,
units: 'm',
projection: "EPSG:21781",
controls: []
};
var map = new OpenLayers.Map('map',options1);
var wms = new OpenLayers.Layer.WMS("Gemeinden",urlArrayTC, {map:mapFile,layers:layerName,format:"image/png",EXCEPTIONS:"application/vnd.ogc.se_inimage"} );
var sld_string=url+"jahr="+jahr+"&indikator="+indikator1+"&klassen="+klassen+"&vis="+vis+"&fusion="+jahr4+"&farbe="+farbe;
wms.mergeNewParams({ SLD:sld_string});
You can see that i'm using an skript which generates an sld file. This file works with the mergeNewParams Parameter.
I get the data out of a postgreSQL database.
In my tilecache.cfg file I have this code:
[gemeinden_2008]
type=WMS
url=http://webgis.hsw.ch/cgi-bin/mapserv.exe?map=C:/ms4w/Apache/htdocs/GINES/Maps/Gemeinden_Bern.map <http://webgis.hsw.ch/cgi-bin/mapserv.exe?map=C:/ms4w/Apache/htdocs/GINES/Maps/Gemeinden_Bern.map>
#mapfile=C:/ms4w/Apache/htdocs/GINES/Maps/Gemeinden_Bern.map
layers=gemeinden_2008
maxresolution=481.8359375
minresolution=0.0009190291166305542
resolutions=481.8359375, 240.91796875, 120.458984375, 60.2294921875, 30.11474609375, 15.057373046875, 7.5286865234375, 3.76434326171875, 1.882171630859375, 0.9410858154296875, 0.47054290771484375, 0.23527145385742188, 0.11763572692871094, 0.058817863464355469, 0.029408931732177734, 0.014704465866088867, 0.0073522329330444336, 0.0036761164665222168, 0.0018380582332611084, 0.0009190291166305542
levels=5
extension=png
extent_type=loose
srs=EPSG:21781
bbox=555100,129900,678450,245000
metaTile=true
----------------------------------------------
[seen]
type=WMS
url=http://webgis.hsw.ch/cgi-bin/mapserv.exe?map=C:/ms4w/Apache/htdocs/GINES/Maps/Gemeinden_Bern.map <http://webgis.hsw.ch/cgi-bin/mapserv.exe?map=C:/ms4w/Apache/htdocs/GINES/Maps/Gemeinden_Bern.map>
#mapfile=C:/ms4w/Apache/htdocs/GINES/Maps/Gemeinden_Bern.map
layers=seen
extension=png
transparency=true
extent_type=loose
srs=EPSG:21781
bbox=555100,129900,678450,245000
--------------------------------------------
And now I have a problem.
For the Layer "seen" all works fine I get the Tiles and all is ok. In my TielCache Directory I have the different png files.
But with the Layer "gemeinden_2008" it doesn't work. I only get white images. On the Server in the TielCache Directory I have different white images without the map-data.
I don't know where what I have to do to correct the error. Perhaps somebody can help me.
I use OpenLayers 2.8 with UMN Mapserver and PostgreSQL database.
Thank you very much for your help.
Greetings
Hanno Rahn
------------------------------------------
Hanno Rahn, Dipl.-Ing. (FH) Geoinformatik
ZHAW Zürcher Hochschule für Angewandte Wissenschaften Umwelt und Natürliche Ressourcen
Fachstelle Geoinformatik
Grüental, Postfach CH-8820 Wädenswil
Tel +41 (0)58 934 5592
Fax +41 (0)58 934 5580
hanno.rahn at zhaw.ch
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/tilecache/attachments/20091015/4d4f889f/attachment.html
More information about the Tilecache
mailing list