Internal organisation

9 messages Options
Embed this post
Permalink
Vidal, Antoni

Internal organisation

Reply Threaded More More options
Print post
Permalink
Some javascript/style in this post has been disabled (why?)

Hello,

 

I’m new on tilecahe and I would like to understand the internal organisation of tiles. My porpouse is to study the possibility of change WMS request to an application that cut the original map image in the litle tiles.

 

Our organisation is going to increase the number of actualizations of tilecache and requests to WMS server are too slow.

 

Any help will be appreciate.

 

Antoni Vidal

Unitat d'Aplicacions SIG-WEB
Institut Cartogràfic de Catalunya
Parc de Montjuïc, E-08038 Barcelona
Tel. (+34) 93 567 15 00 (ext. 3228)
www.icc.cat

 

 

 


_______________________________________________
Tilecache mailing list
[hidden email]
http://openlayers.org/mailman/listinfo/tilecache
Vidal, Antoni

Internal organisation

Reply Threaded More More options
Print post
Permalink
Some javascript/style in this post has been disabled (why?)

Hello,

 

I’m new on tilecahe and I would like to understand the internal organisation of tiles. My porpouse is to study the possibility of change WMS request to an application that cut the original map image in the litle tiles.

 

Our organisation is going to increase the number of actualizations of tilecache and requests to WMS server are too slow.

 

Any help will be appreciate.

 

Antoni Vidal

Unitat d'Aplicacions SIG-WEB
Institut Cartogràfic de Catalunya
Parc de Montjuïc, E-08038 Barcelona
Tel. (+34) 93 567 15 00 (ext. 3228)
www.icc.cat

 

 

 


_______________________________________________
Tilecache mailing list
[hidden email]
http://openlayers.org/mailman/listinfo/tilecache
Steven M. Ottens

Re: Internal organisation

Reply Threaded More More options
Print post
Permalink
In reply to this post by Vidal, Antoni
Hi Antoni,

The default structure is defined by this:

   components = ( self.basedir,
                        tile.layer.name,
                        "%02d" % tile.z,
                        "%03d" % int(tile.x / 1000000),
                        "%03d" % (int(tile.x / 1000) % 1000),
                        "%03d" % (int(tile.x) % 1000),
                        "%03d" % int(tile.y / 1000000),
                        "%03d" % (int(tile.y / 1000) % 1000),
                        "%03d.%s" % (int(tile.y) % 1000,  
tile.layer.extension)
                     )

Meaning:
1st directory: layername
2nd directory: zoomlevel (in 2 digits eg. 01)
the 3rd-5th directory are the columnnumber (x), split into thousands:
-if you have x = 018782353 you get
   3rd: directory 018
   4th directory: 782
   5th directory: 353
the 6th and 7th and the filename are the row numbers (y) split into  
thousands:
-if you have y = 786 347 862 you get
   6rd: directory 786
   7th directory: 347
   filename: 862
and you end with the filetype

So you end up with:
layername/01/018/782/353/786/347/862.filetype

The actual number of rows, columns and zoomlevels depend on the  
tileschema you are using. The reason for splitting the rows and  
columns in a three deep directory structure is because certain  
filesystems cannot handle large amounts of files in a directory. Also  
there are different caching-backends, including a more simple  
approach like layer/z/x/y.filetype

Regardds,
Steven



On Oct 7, 2009, at 9:38 AM, Vidal, Antoni wrote:

> Hello,
>
>
>
> I’m new on tilecahe and I would like to understand the internal  
> organisation of tiles. My porpouse is to study the possibility of  
> change WMS request to an application that cut the original map  
> image in the litle tiles.
>
>
>
> Our organisation is going to increase the number of actualizations  
> of tilecache and requests to WMS server are too slow.
>
>
>
> Any help will be appreciate.
>
>
>
> Antoni Vidal
>
> Unitat d'Aplicacions SIG-WEB
> Institut Cartogràfic de Catalunya
> Parc de Montjuïc, E-08038 Barcelona
> Tel. (+34) 93 567 15 00 (ext. 3228)
> www.icc.cat
>
>
>
>
>
>
>
> _______________________________________________
> Tilecache mailing list
> [hidden email]
> http://openlayers.org/mailman/listinfo/tilecache


_______________________________________________
Tilecache mailing list
[hidden email]
http://openlayers.org/mailman/listinfo/tilecache
Vidal, Antoni

RV: Internal organisation

Reply Threaded More More options
Print post
Permalink
In reply to this post by Vidal, Antoni
Hi Steven,

Thank's for your answer, but I think that is not exactly my case. Maybe because We use an old version of Tilecache, it seems 2.8.

My tilecache.cfg has the following entries. Pay attention to bbox in UTM (meters):

bbox=258000,4485000,536000,4752000
srs=EPSG:23031
resolutions=1100,550,275,100,50,25,10,5,2,1,0.5

And the structure I get running tilecache in example, level 7:

Topo/07/000/000/000 untill 215/000/000/number.jpg

Only that 5th directory changes her name and contains, always, 2 directories more and the last contains images.

If I supose that there are 216 columns (5th. Directory) 216 columns multiplyed by 256 px = 55269 multiplyed by 5 meters/px = 276480 meters. This is good because east minus west = 536000 - 258000 = 278000, almost the same.

Best Regards,

Antoni Vidal
Unitat d'Aplicacions SIG-WEB
Institut Cartogràfic de Catalunya
Parc de Montjuïc, E-08038 Barcelona
Tel. (+34) 93 567 15 00 (ext. 3228)
www.icc.cat
 


-----Missatge original-----
De: Steven M. Ottens [mailto:[hidden email]]
Enviat: miércoles, 07 de octubre de 2009 10:22
Per a: Vidal, Antoni
A/c: [hidden email]
Tema: Re: [Tilecache] Internal organisation

Hi Antoni,

The default structure is defined by this:

   components = ( self.basedir,
                        tile.layer.name,
                        "%02d" % tile.z,
                        "%03d" % int(tile.x / 1000000),
                        "%03d" % (int(tile.x / 1000) % 1000),
                        "%03d" % (int(tile.x) % 1000),
                        "%03d" % int(tile.y / 1000000),
                        "%03d" % (int(tile.y / 1000) % 1000),
                        "%03d.%s" % (int(tile.y) % 1000,  
tile.layer.extension)
                     )

Meaning:
1st directory: layername
2nd directory: zoomlevel (in 2 digits eg. 01)
the 3rd-5th directory are the columnnumber (x), split into thousands:
-if you have x = 018782353 you get
   3rd: directory 018
   4th directory: 782
   5th directory: 353
the 6th and 7th and the filename are the row numbers (y) split into  
thousands:
-if you have y = 786 347 862 you get
   6rd: directory 786
   7th directory: 347
   filename: 862
and you end with the filetype

So you end up with:
layername/01/018/782/353/786/347/862.filetype

The actual number of rows, columns and zoomlevels depend on the  
tileschema you are using. The reason for splitting the rows and  
columns in a three deep directory structure is because certain  
filesystems cannot handle large amounts of files in a directory. Also  
there are different caching-backends, including a more simple  
approach like layer/z/x/y.filetype

Regardds,
Steven



On Oct 7, 2009, at 9:38 AM, Vidal, Antoni wrote:

> Hello,
>
>
>
> I'm new on tilecahe and I would like to understand the internal  
> organisation of tiles. My porpouse is to study the possibility of  
> change WMS request to an application that cut the original map  
> image in the litle tiles.
>
>
>
> Our organisation is going to increase the number of actualizations  
> of tilecache and requests to WMS server are too slow.
>
>
>
> Any help will be appreciate.
>
>
>
> Antoni Vidal
>
> Unitat d'Aplicacions SIG-WEB
> Institut Cartogràfic de Catalunya
> Parc de Montjuïc, E-08038 Barcelona
> Tel. (+34) 93 567 15 00 (ext. 3228)
> www.icc.cat
>
>
>
>
>
>
>
> _______________________________________________
> Tilecache mailing list
> [hidden email]
> http://openlayers.org/mailman/listinfo/tilecache

_______________________________________________
Tilecache mailing list
[hidden email]
http://openlayers.org/mailman/listinfo/tilecache
Christopher Schmidt-2

Re: RV: Internal organisation

Reply Threaded More More options
Print post
Permalink
On Wed, Oct 07, 2009 at 01:14:48PM +0200, Vidal, Antoni wrote:
> Hi Steven,
>
> Thank's for your answer, but I think that is not exactly my case. Maybe because We use an old version of Tilecache, it seems 2.8.



> My tilecache.cfg has the following entries. Pay attention to bbox in UTM (meters):
>
> bbox=258000,4485000,536000,4752000
> srs=EPSG:23031
> resolutions=1100,550,275,100,50,25,10,5,2,1,0.5
>
> And the structure I get running tilecache in example, level 7:
>
> Topo/07/000/000/000 untill 215/000/000/number.jpg


This is exactly what Steven described? I'm not sure why you're confused.

Again, the layout is (in the default Disk Cache):

 layer/z/x/x/x/y/y/y.ext

Which is what you have.

Your X goes from 0-215, your Y from 0-number.

    0,number             215,number
   
                 .
   
   
    0,0                  215,0

> Only that 5th directory changes her name and contains, always, 2 directories more and the last contains images.
>
> If I supose that there are 216 columns (5th. Directory) 216 columns multiplyed by 256 px = 55269 multiplyed by 5 meters/px = 276480 meters. This is good because east minus west = 536000 - 258000 = 278000, almost the same.
>
> Best Regards,
>
> Antoni Vidal
> Unitat d'Aplicacions SIG-WEB
> Institut Cartogràfic de Catalunya
> Parc de Montjuïc, E-08038 Barcelona
> Tel. (+34) 93 567 15 00 (ext. 3228)
> www.icc.cat
>  
>
>
> -----Missatge original-----
> De: Steven M. Ottens [mailto:[hidden email]]
> Enviat: miércoles, 07 de octubre de 2009 10:22
> Per a: Vidal, Antoni
> A/c: [hidden email]
> Tema: Re: [Tilecache] Internal organisation
>
> Hi Antoni,
>
> The default structure is defined by this:
>
>    components = ( self.basedir,
>                         tile.layer.name,
>                         "%02d" % tile.z,
>                         "%03d" % int(tile.x / 1000000),
>                         "%03d" % (int(tile.x / 1000) % 1000),
>                         "%03d" % (int(tile.x) % 1000),
>                         "%03d" % int(tile.y / 1000000),
>                         "%03d" % (int(tile.y / 1000) % 1000),
>                         "%03d.%s" % (int(tile.y) % 1000,  
> tile.layer.extension)
>                      )
>
> Meaning:
> 1st directory: layername
> 2nd directory: zoomlevel (in 2 digits eg. 01)
> the 3rd-5th directory are the columnnumber (x), split into thousands:
> -if you have x = 018782353 you get
>    3rd: directory 018
>    4th directory: 782
>    5th directory: 353
> the 6th and 7th and the filename are the row numbers (y) split into  
> thousands:
> -if you have y = 786 347 862 you get
>    6rd: directory 786
>    7th directory: 347
>    filename: 862
> and you end with the filetype
>
> So you end up with:
> layername/01/018/782/353/786/347/862.filetype
>
> The actual number of rows, columns and zoomlevels depend on the  
> tileschema you are using. The reason for splitting the rows and  
> columns in a three deep directory structure is because certain  
> filesystems cannot handle large amounts of files in a directory. Also  
> there are different caching-backends, including a more simple  
> approach like layer/z/x/y.filetype
>
> Regardds,
> Steven
>
>
>
> On Oct 7, 2009, at 9:38 AM, Vidal, Antoni wrote:
>
> > Hello,
> >
> >
> >
> > I'm new on tilecahe and I would like to understand the internal  
> > organisation of tiles. My porpouse is to study the possibility of  
> > change WMS request to an application that cut the original map  
> > image in the litle tiles.
> >
> >
> >
> > Our organisation is going to increase the number of actualizations  
> > of tilecache and requests to WMS server are too slow.
> >
> >
> >
> > Any help will be appreciate.
> >
> >
> >
> > Antoni Vidal
> >
> > Unitat d'Aplicacions SIG-WEB
> > Institut Cartogràfic de Catalunya
> > Parc de Montjuïc, E-08038 Barcelona
> > Tel. (+34) 93 567 15 00 (ext. 3228)
> > www.icc.cat
> >
> >
> >
> >
> >
> >
> >
> > _______________________________________________
> > Tilecache mailing list
> > [hidden email]
> > http://openlayers.org/mailman/listinfo/tilecache
>
> _______________________________________________
> Tilecache mailing list
> [hidden email]
> http://openlayers.org/mailman/listinfo/tilecache

--
Christopher Schmidt
MetaCarta
_______________________________________________
Tilecache mailing list
[hidden email]
http://openlayers.org/mailman/listinfo/tilecache
Vidal, Antoni

Re: RV: Internal organisation

Reply Threaded More More options
Print post
Permalink
Hello,

I don't understand this part:

> the 3rd-5th directory are the columnnumber (x), split into thousands:
> -if you have x = 018782353 you get
....
> So you end up with:
> layername/01/018/782/353/786/347/862.filetype
>

What's x?


Antoni Vidal
Unitat d'Aplicacions SIG-WEB
Institut Cartogràfic de Catalunya
Parc de Montjuïc, E-08038 Barcelona
Tel. (+34) 93 567 15 00 (ext. 3228)
www.icc.cat
 


 
_______________________________________________
Tilecache mailing list
[hidden email]
http://openlayers.org/mailman/listinfo/tilecache
Christopher Schmidt-2

Re: RV: Internal organisation

Reply Threaded More More options
Print post
Permalink
On Wed, Oct 07, 2009 at 03:08:12PM +0200, Vidal, Antoni wrote:

> Hello,
>
> I don't understand this part:
>
> > the 3rd-5th directory are the columnnumber (x), split into thousands:
> > -if you have x = 018782353 you get
> ....
> > So you end up with:
> > layername/01/018/782/353/786/347/862.filetype
> >
>
> What's x?

The tile identifier in the x direction.

-- Chris


>
> Antoni Vidal
> Unitat d'Aplicacions SIG-WEB
> Institut Cartogràfic de Catalunya
> Parc de Montjuïc, E-08038 Barcelona
> Tel. (+34) 93 567 15 00 (ext. 3228)
> www.icc.cat
>  
>
>
>  

--
Christopher Schmidt
MetaCarta
_______________________________________________
Tilecache mailing list
[hidden email]
http://openlayers.org/mailman/listinfo/tilecache
Christopher Schmidt-2

Re: RS: RV: Internal organisation

Reply Threaded More More options
Print post
Permalink
On Wed, Oct 07, 2009 at 10:21:30PM +0200, Vidal, Antoni wrote:
>
> > What's x?
>
> The tile identifier in the x direction.
>
> And how can I get this value?

Given what? And why do you need to?

Generally speaking, something like:

    var x = Math.round ((bounds.left - this.maxExtent.left) / (res * this.tileSize.w));
    var y = Math.round ((this.maxExtent.top - bounds.top) / (res * this.tileSize.h));
    var z = this.map.getZoom();

where res is the resolution of the current zoom, would be the x and y values.
But apparently you already have Y somehow, since you're not asking about that
value.

I think I'm confused here.

Regards,
--
Christopher Schmidt
MetaCarta
_______________________________________________
Tilecache mailing list
[hidden email]
http://openlayers.org/mailman/listinfo/tilecache
Vidal, Antoni

Re: RS: RV: Internal organisation

Reply Threaded More More options
Print post
Permalink
Hello again,

In my last e-mail I've mixed x and y values, sorry for confused you.

Regarding your answer:

>Generally speaking, something like:
>
>    var x = Math.round ((bounds.left - this.maxExtent.left) / (res * this.tileSize.w));
>    var y = Math.round ((this.maxExtent.top - bounds.top) / (res * this.tileSize.h));
>    var z = this.map.getZoom();
>
>where res is the resolution of the current zoom, would be the x and y values.

Using an example, I know res = 5 (meters/pixel) and tileSize.w and tileSize.h = 256 px

What about bounds.left, is this the left side of tile?, and what is this.maxExtent.left?. The same doubt for y axis.

Thank's a lot.


Antoni Vidal
Unitat d'Aplicacions SIG-WEB
Institut Cartogràfic de Catalunya
Parc de Montjuïc, E-08038 Barcelona
Tel. (+34) 93 567 15 00 (ext. 3228)
www.icc.cat
 



_______________________________________________
Tilecache mailing list
[hidden email]
http://openlayers.org/mailman/listinfo/tilecache