[Tilecache] Tilecache not seeding

Damiano Morosi damiano.morosi at gmail.com
Mon Oct 27 13:18:23 EDT 2008


Hi,

the problem was the resolution.
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.

Thank you all! Great job!

2008/10/27 Roger André <randre at gmail.com>

> Hi Damiano,
>
> 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.
>
> Best of luck,
>
> Roger
> --
>
>
> On Mon, Oct 27, 2008 at 4:45 AM, Damiano Morosi <damiano.morosi at gmail.com>wrote:
>
>> Thanks Roger,
>>
>> my problem is of kind b). In fact, I can't make the point over the
>> coordinates you have to pass defining the bbox.
>> 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:
>>
>> var mapBounds = new OpenLayers.Bounds(11,40,14,43);
>>
>> var mapOptions = {
>>                 theme: null,
>>                 controls: [
>>                                            new
>> OpenLayers.Control.PanZoomBar(),
>>                                            new
>> OpenLayers.Control.MousePosition(),
>>                                            new OpenLayers.Control.Scale(),
>>                                            new
>> OpenLayers.Control.MouseToolbar()
>>                                            ],
>>                 maxExtent: mapBounds,
>>                 projection:"EPSG:4326",
>>                 maxResolution: 'auto',
>>                 format: 'png',
>>                 numZoomLevel: 4
>> };
>>
>> map = new OpenLayers.Map( 'map', mapOptions);
>>
>> layer = new OpenLayers.Layer.TileCache( "basic",
>>                    ["http://213.199.15.252/tilecache"],
>>                    'basic');
>>
>> map.addLayers([layer]);
>>
>> ----
>>
>> 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).
>> Where I'm wrong? It's the resolution an important/crucial parameter? I'm
>> going to display the map over a 600x600px div.
>>
>> Thank you,
>>
>> Damiano Morosi
>>
>> 2008/10/26 Roger André <randre at gmail.com>
>>
>> Hi Damiano,
>>>
>>> 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.
>>>
>>> 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 tilecache.see.py with the extents defined, like this:
>>>   tilecache_seed.py <URL> basic <zoom_start> <zoom_end> "12,41,13,42"
>>>
>>> Good luck.
>>>
>>> Roger
>>> --
>>>
>>>
>>> On Sun, Oct 26, 2008 at 2:52 AM, Damiano Morosi <
>>> damiano.morosi at gmail.com> wrote:
>>>
>>>> Hi,
>>>>
>>>> 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?
>>>>
>>>> 2008/10/25 Roger André <randre at gmail.com>
>>>>
>>>> I think you need to add some parameters to the LAYER METADATA section of
>>>>> your mapfile.  Like this:
>>>>>
>>>>>     METADATA
>>>>>       "wms_srs"             "EPSG:4326 EPSG:102004 EPSG:900913"
>>>>>       "wms_name"            "states"
>>>>>       "wms_server_version"  "1.1.1"
>>>>>       "wms_format"          "image/png"
>>>>>       "wms_onlineresource"  "
>>>>> http://localhost/cgi-bin/mapserv?map=/var/www/mapfiles/states/states.map&
>>>>> "
>>>>>     END
>>>>> --
>>>>>
>>>>>
>>>>> On Sat, Oct 25, 2008 at 5:36 AM, Christopher Schmidt <
>>>>> crschmidt at metacarta.com> wrote:
>>>>>
>>>>>> On Sat, Oct 25, 2008 at 02:21:38PM +0200, Damiano Morosi wrote:
>>>>>> > Hi all,
>>>>>> >
>>>>>> > this is the first time I use Tilecache. I'm trying to generate tiles
>>>>>> for a
>>>>>> > Map (that I can visualize successfully in OpenLayers with
>>>>>> Mapserver). The
>>>>>> > .map file is as following:
>>>>>> >
>>>>>> > ----
>>>>>> >
>>>>>> > #
>>>>>> > # Start of map file
>>>>>> > #
>>>>>> > #
>>>>>> > NAME NAVSTREETS
>>>>>> > STATUS ON
>>>>>> > SIZE 600 600
>>>>>> > SYMBOLSET "/var/www/maps/symbols.sym"
>>>>>> > EXTENT 12 41 13 42
>>>>>> >
>>>>>> > SHAPEPATH "/var/www/shapes/"
>>>>>> > IMAGETYPE png
>>>>>> > IMAGECOLOR 150 150 150
>>>>>> >
>>>>>> > #
>>>>>> > # Start of web interface definition
>>>>>> > #
>>>>>> > WEB
>>>>>> >   #MINSCALE 2000000
>>>>>> >   #MAXSCALE 50000000
>>>>>> >   IMAGEPATH "/tmp/ms_tmp/"
>>>>>> >   IMAGEURL "/ms_tmp/"
>>>>>> >   METADATA
>>>>>> >     "wms_title" "navstreet map"
>>>>>> >     "wms_onlineresource" "
>>>>>> http://213.199.15.252/cgi-bin/mapserv?map=ms.map&"
>>>>>> >
>>>>>> >   END
>>>>>> >   TEMPLATE "test.html"
>>>>>> > END
>>>>>> >
>>>>>> > # Layers
>>>>>> >
>>>>>> > LAYER
>>>>>> >   METADATA
>>>>>> >         "queryable" "true"
>>>>>> >         "wms_title" "GreenA"
>>>>>> >   END
>>>>>> >
>>>>>> >   TEMPLATE "test.html"
>>>>>> >
>>>>>> >   NAME GreenA
>>>>>> >   TYPE POLYGON
>>>>>> >   STATUS ON
>>>>>> >
>>>>>> >   DATA LandUseA
>>>>>> >  CLASS
>>>>>> >     NAME "Streets"
>>>>>> >     OUTLINECOLOR 0 255 0
>>>>>> >     COLOR 0 255 0
>>>>>> >   END
>>>>>> > END # layer
>>>>>> >
>>>>>> > END # MAP
>>>>>> >
>>>>>> > ----
>>>>>> >
>>>>>> > The following is my tilecache.cfg file:
>>>>>> >
>>>>>> > ----
>>>>>> >
>>>>>> > [cache]
>>>>>> > base = /tmp/tilecache
>>>>>> > type = Disk
>>>>>> >
>>>>>> > [basic]
>>>>>> > layers = GreenA
>>>>>> > spherical_mercator = no
>>>>>> > data_extent = 12,41,13,42
>>>>>> > extension = png
>>>>>> > url = http://213.199.15.252/cgi-bin/mapserv?map=ms.map
>>>>>> > metatile = no
>>>>>> > bbox = 12,41,13,42
>>>>>> > type = WMS
>>>>>> >
>>>>>> > ----
>>>>>> >
>>>>>> > The layer is deriving from a shapefile. Then I try the command:
>>>>>> >
>>>>>> > python tilecache_seed.py "
>>>>>> http://213.199.15.252/cgi-bin/tilecache.cgi?"
>>>>>> > basic 0 5
>>>>>> >
>>>>>> > and I get the error
>>>>>> >
>>>>>> > msWMSLoadGetMapParams(): WMS server error. Invalid SRS given : SRS
>>>>>> must be
>>>>>> > valid for all requested layers.
>>>>>> >
>>>>>> > The point is that I don't want to project my map, so as far as I
>>>>>> know, I
>>>>>> > haven't to set a projection object in mapfile. Is it mandatory to
>>>>>> fullfill
>>>>>> > the tilecache requisites? How can I produce tiles from map that are
>>>>>> usable
>>>>>> > by OpenLayers?
>>>>>>
>>>>>> You need to set up your mapfile for WMS.
>>>>>>
>>>>>> http://mapserver.gis.umn.edu/docs/howto/wms_server
>>>>>>
>>>>>> http://mapserver.gis.umn.edu/docs/howto/wms_server/#setup-a-mapfile-for-your-wms
>>>>>>
>>>>>> > Thank you all,
>>>>>> >
>>>>>> > Damiano Morosi
>>>>>>
>>>>>> > _______________________________________________
>>>>>> > Tilecache mailing list
>>>>>> > Tilecache at openlayers.org
>>>>>> > http://openlayers.org/mailman/listinfo/tilecache
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Christopher Schmidt
>>>>>> MetaCarta
>>>>>> _______________________________________________
>>>>>> Tilecache mailing list
>>>>>> Tilecache at openlayers.org
>>>>>> http://openlayers.org/mailman/listinfo/tilecache
>>>>>>
>>>>>
>>>>>
>>>>
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/tilecache/attachments/20081027/3ac564ef/attachment.html


More information about the Tilecache mailing list