Hi,<br><br>the problem was the resolution.<br>Tilecache itself starts producing a 256x256 pixels tile for zoomlevel = 0; my map was instead 600x600. Searching the mailing list I've found the (really elementary) formula for finding the correct resolution, so now the tiles are generated in the right manner.<br>
<br>Thank you all! Great job!<br><br><div class="gmail_quote">2008/10/27 Roger André <span dir="ltr"><<a href="mailto:randre@gmail.com">randre@gmail.com</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi Damiano,<br><br>I don't know how to solve the problem you're describing. I've cc'd the TileCache list, which I would advise you to do as well, since someone else may have a solution.<br><br>Best of luck,<br>
<br>Roger<br><font color="#888888">--</font><div><div></div><div class="Wj3C7c"><br><br><div class="gmail_quote">On Mon, Oct 27, 2008 at 4:45 AM, Damiano Morosi <span dir="ltr"><<a href="mailto:damiano.morosi@gmail.com" target="_blank">damiano.morosi@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Thanks Roger,<br><br>my problem is of kind b). In fact, I can't make the point over the coordinates you have to pass defining the bbox.<br>If I pass "11,40,14,43", these are long/lat, non-projected coordinates, right? So if I define a data_extent on 11,40,14,43 in tilecache.cfg, I should get for level 0 the tiles representing the eintire map. Now, if I set for my Openlayers map the following:<br>
<br>var mapBounds = new OpenLayers.Bounds(11,40,14,43);<br><br>var mapOptions = {<br> theme: null,<br> controls: [<br> new OpenLayers.Control.PanZoomBar(),<br>
new OpenLayers.Control.MousePosition(),<br> new OpenLayers.Control.Scale(),<br> new OpenLayers.Control.MouseToolbar()<br>
],<br> maxExtent: mapBounds,<br> projection:"EPSG:4326",<br> maxResolution: 'auto',<br> format: 'png',<br>
numZoomLevel: 4<br>}; <br><br>map = new OpenLayers.Map( 'map', mapOptions);<br><br>layer = new OpenLayers.Layer.TileCache( "basic",<br> ["<a href="http://213.199.15.252/tilecache" target="_blank">http://213.199.15.252/tilecache</a>"],<br>
'basic');<br><br>map.addLayers([layer]);<br><br>----<br><br>I get that only 1 tile is viewed at level 0, with bounding box 11, 40, 12.275, 41.280 (measured with the mouse position control).<br>
Where I'm wrong? It's the resolution an important/crucial parameter? I'm going to display the map over a 600x600px div.<br>
<br>Thank you,<br><br>Damiano Morosi<br><br><div class="gmail_quote">2008/10/26 Roger André <span dir="ltr"><<a href="mailto:randre@gmail.com" target="_blank">randre@gmail.com</a>></span><div><div></div><div>
<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi Damiano,<br><br>Glad to hear that you're getting tiles now. I think that your tilecache.cfg should have the srs defined of the projection that you wish the tiles to be created in. The installation readme for TileCache states that if you don't define an SRS, EPSG:4326 is assumed.<br>
<br>I'm a little confused about whether your problem is a) that the tiles are being generated in the wrong projection, or b) that you are getting too many tiles generated, over a larger extent than you need. For a), I think you need to define your projection, both in MapServer, and in TileCcahe. For b), run <a href="http://tilecache.see.py" target="_blank">tilecache.see.py</a> with the extents defined, like this:<br>
tilecache_seed.py <URL> basic <zoom_start> <zoom_end> "12,41,13,42"<br><br>Good luck.<br><br>Roger<br><font color="#888888">--</font><div><div></div><div><br><br><div class="gmail_quote">
On Sun, Oct 26, 2008 at 2:52 AM, Damiano Morosi <span dir="ltr"><<a href="mailto:damiano.morosi@gmail.com" target="_blank">damiano.morosi@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi,<br><br>thanks, now the tiles are produced well. I still have a problem: it seems that the bbox coordinates are "unprojected", while the tiles are generated "projected". I don't want to produce the world tiles, only for my city (Rome) that can be contained in the 12,14,13,43 long/lat bbox, but the result is slightly different. Why?<br>
<br><div class="gmail_quote">2008/10/25 Roger André <span dir="ltr"><<a href="mailto:randre@gmail.com" target="_blank">randre@gmail.com</a>></span><div><div></div><div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I think you need to add some parameters to the LAYER METADATA section of your mapfile. Like this:<br><br> METADATA<br> "wms_srs" "EPSG:4326 EPSG:102004 EPSG:900913"<br> "wms_name" "states"<br>
"wms_server_version" "1.1.1"<br> "wms_format" "image/png"<br> "wms_onlineresource" "<a href="http://localhost/cgi-bin/mapserv?map=/var/www/mapfiles/states/states.map&" target="_blank">http://localhost/cgi-bin/mapserv?map=/var/www/mapfiles/states/states.map&</a>"<br>
END<br><font color="#888888">--</font><div><div></div><div><br><br><div class="gmail_quote">On Sat, Oct 25, 2008 at 5:36 AM, Christopher Schmidt <span dir="ltr"><<a href="mailto:crschmidt@metacarta.com" target="_blank">crschmidt@metacarta.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div></div><div>On Sat, Oct 25, 2008 at 02:21:38PM +0200, Damiano Morosi wrote:<br>
> Hi all,<br>
><br>
> this is the first time I use Tilecache. I'm trying to generate tiles for a<br>
> Map (that I can visualize successfully in OpenLayers with Mapserver). The<br>
> .map file is as following:<br>
><br>
> ----<br>
><br>
> #<br>
> # Start of map file<br>
> #<br>
> #<br>
> NAME NAVSTREETS<br>
> STATUS ON<br>
> SIZE 600 600<br>
> SYMBOLSET "/var/www/maps/symbols.sym"<br>
> EXTENT 12 41 13 42<br>
><br>
> SHAPEPATH "/var/www/shapes/"<br>
> IMAGETYPE png<br>
> IMAGECOLOR 150 150 150<br>
><br>
> #<br>
> # Start of web interface definition<br>
> #<br>
> WEB<br>
> #MINSCALE 2000000<br>
> #MAXSCALE 50000000<br>
> IMAGEPATH "/tmp/ms_tmp/"<br>
> IMAGEURL "/ms_tmp/"<br>
> METADATA<br>
> "wms_title" "navstreet map"<br>
> "wms_onlineresource" "<a href="http://213.199.15.252/cgi-bin/mapserv?map=ms.map&" target="_blank">http://213.199.15.252/cgi-bin/mapserv?map=ms.map&</a>"<br>
><br>
> END<br>
> TEMPLATE "test.html"<br>
> END<br>
><br>
> # Layers<br>
><br>
> LAYER<br>
> METADATA<br>
> "queryable" "true"<br>
> "wms_title" "GreenA"<br>
> END<br>
><br>
> TEMPLATE "test.html"<br>
><br>
> NAME GreenA<br>
> TYPE POLYGON<br>
> STATUS ON<br>
><br>
> DATA LandUseA<br>
> CLASS<br>
> NAME "Streets"<br>
> OUTLINECOLOR 0 255 0<br>
> COLOR 0 255 0<br>
> END<br>
> END # layer<br>
><br>
> END # MAP<br>
><br>
> ----<br>
><br>
> The following is my tilecache.cfg file:<br>
><br>
> ----<br>
><br>
> [cache]<br>
> base = /tmp/tilecache<br>
> type = Disk<br>
><br>
> [basic]<br>
> layers = GreenA<br>
> spherical_mercator = no<br>
> data_extent = 12,41,13,42<br>
> extension = png<br>
> url = <a href="http://213.199.15.252/cgi-bin/mapserv?map=ms.map" target="_blank">http://213.199.15.252/cgi-bin/mapserv?map=ms.map</a><br>
> metatile = no<br>
> bbox = 12,41,13,42<br>
> type = WMS<br>
><br>
> ----<br>
><br>
> The layer is deriving from a shapefile. Then I try the command:<br>
><br>
> python tilecache_seed.py "<a href="http://213.199.15.252/cgi-bin/tilecache.cgi" target="_blank">http://213.199.15.252/cgi-bin/tilecache.cgi</a>?"<br>
> basic 0 5<br>
><br>
> and I get the error<br>
><br>
> msWMSLoadGetMapParams(): WMS server error. Invalid SRS given : SRS must be<br>
> valid for all requested layers.<br>
><br>
> The point is that I don't want to project my map, so as far as I know, I<br>
> haven't to set a projection object in mapfile. Is it mandatory to fullfill<br>
> the tilecache requisites? How can I produce tiles from map that are usable<br>
> by OpenLayers?<br>
<br>
</div></div>You need to set up your mapfile for WMS.<br>
<br>
<a href="http://mapserver.gis.umn.edu/docs/howto/wms_server" target="_blank">http://mapserver.gis.umn.edu/docs/howto/wms_server</a><br>
<a href="http://mapserver.gis.umn.edu/docs/howto/wms_server/#setup-a-mapfile-for-your-wms" target="_blank">http://mapserver.gis.umn.edu/docs/howto/wms_server/#setup-a-mapfile-for-your-wms</a><br>
<div><br>
> Thank you all,<br>
><br>
> Damiano Morosi<br>
<br>
</div>> _______________________________________________<br>
> Tilecache mailing list<br>
> <a href="mailto:Tilecache@openlayers.org" target="_blank">Tilecache@openlayers.org</a><br>
> <a href="http://openlayers.org/mailman/listinfo/tilecache" target="_blank">http://openlayers.org/mailman/listinfo/tilecache</a><br>
<font color="#888888"><br>
<br>
--<br>
Christopher Schmidt<br>
MetaCarta<br>
_______________________________________________<br>
Tilecache mailing list<br>
<a href="mailto:Tilecache@openlayers.org" target="_blank">Tilecache@openlayers.org</a><br>
<a href="http://openlayers.org/mailman/listinfo/tilecache" target="_blank">http://openlayers.org/mailman/listinfo/tilecache</a><br>
</font></blockquote></div><br>
</div></div></blockquote></div></div></div><br>
</blockquote></div><br>
</div></div></blockquote></div></div></div><br>
</blockquote></div><br>
</div></div></blockquote></div><br>