Openlayer.titlecache support on GMap.Net

Jan 18, 2010 at 7:38 AM

Hello,

We have a project which we use the formerly tiled maps.

http://maps.pergo.com.tr

Our map is published on web with OpenLayer.tilecache

How can we provide to use the maps, which are compiled by tilecache, in gmap.

Thanks.

Coordinator
Jan 18, 2010 at 8:01 AM

hey,

well you just need to tell me your map projection first, and if it's not some known standard i need extents of tiles of each zoom

if you don't know, i can figure it out in some time myself

Jan 18, 2010 at 10:10 AM

hi,

we used EPSG:4326 (WGS84) projections while compiling the maps

as I mentioned above maps are currently published at maps.pergo.com.tr using Openlayer.tilecache

Coordinator
Jan 18, 2010 at 10:25 AM

but it looks more like PlateCarreeProjection, google has 4 tiles in first zoom, this one has only 2, definitely other projection, anyway i'll try to figure out what it really is

Coordinator
Jan 18, 2010 at 7:47 PM
  • http://maps.pergo.com.tr/map.htm
  • PlateCarreeProjection

  • zoom levels
    --------------
    00 - 2 x 1
    01 - 4 x 2
    02 - 8 x 4
    03 - 16 x 8
     X -  2*(2^X)  x 2^X

// zoom0
http://map0.pergo.com.tr/tile/00/000/000/000/000/000/000.png
http://map3.pergo.com.tr/tile/00/000/000/001/000/000/000.png

// zoom1
http://map4.pergo.com.tr/tile/03/000/000/004/000/000/000.png
http://map0.pergo.com.tr/tile/00/000/000/000/000/000/000.png

Can you tell what these cryptic 0000000 means? ;} Thats all i need now to add your map support

Jan 18, 2010 at 9:01 PM

Hi,

http://{domain}/{layerName}/{zoomLevel}/{first3LetterOfTileX}/{second3LetterOfTileX}/{third3LetterOfTileX}/{first3LetterOfTileY}/{second3LetterOfTileY}/{third3LetterOfTileXY}.png

http://map3.pergo.com.tr/tile/00/000/000/001/000/000/000.png

That means: Zoom Level: 0 TileX: 1 TileY: 0

http://domain/tile/14/000/019/371/000/011/825.png

That means: Zoom Level: 14 TileX: 19371 TileY:11825

 

Also, it should be a definition file for the system. Because we dont know howmany zoom levels we have. I guess it's not available right now.

There are 18 Zoom levels for this map from 0 to 17.

 

And these are resolutions we're using in OpenLayers. From 0 to 17. First zoom level we've 2 tiles. That means first tile's resolution is 180degree / 256pixel = 0.703125

0.703125,
0.3515625,
0.17578125,
0.087890625,

0.0439453125, 0.02197265625, 0.010986328125, 0.0054931640625, 0.00274658203125, 0.001373291015625, 0.0006866455078125, 0.00034332275390625, 0.000171661376953125, 0.0000858306884765625, 0.00004291534423828125, 0.000021457672119140625, 0.0000107288360595703125, 0.00000536441802978515625

I hope this help.
Regards,
Baris

 

Coordinator
Jan 18, 2010 at 9:44 PM

okey, something is showing up, tiles upside down, strange, zero/zero is bottom left o.O

Jan 19, 2010 at 10:18 AM

Hi,

for compiling maps we use phyton + mapnik + tilecache 2.10.

The projection parameters in the tilecache.cfg file is as shown below,

[00]
srs=EPSG:4326
projection=+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defsmap
mapfile=pergostyle00.xml


in "pergostyle00.xml"
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Map bgcolor="#99B3CC" srs="+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs">
               <Layer name="world" srs="+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs" status="on">
....


You can see that we did not use a different projection

As you mentioned the tile frames start from TopLeft in google and others. But it is BottomLeft in tilecache

it seems to be the main reason for the complicacy.

while compiling map with tilecache normally the file count that had been created for 00 zoom is 6

but openlayer.tilecache shows 2 files at 00 zoom.

you can check the following file for the list of the files that belong to 00 zoom to 04 zoom

if you want I can prepare the list of the files at other zoom levels too.

http://maps.pergo.com.tr/tile/tile_files_00-04.txt

The file list is as shown below for the first 7 zoom levels

Zoom Level (x)

The number of the files that is created after the zoom compiling              

(2<sup>x+1</sup>+1)*(2<sup>x</sup>+1)

The calculated number of files before compiling

2*(2<sup>x</sup>)  x 2<sup>x</sup>

00

6

2

01

15

8

02

45

32

03

153

128

04

561

512

05

2145

2048

06

8385

8192

In this case

"The calculated number of files before compiling" is calculated with

X -  2*(2<sup>x</sup>)  x 2<sup>x</sup>

as you said.

The info that the tilecache is giving during the compiling is also making the same calculation with the given formula and gives the calculated file number

but the final compiled file count is different. It is as "The number of the files that is created after the zoom compiling" in the above table

and that is calculated with
 

(2<sup>x+1</sup>+1)*(2<sup>x</sup>+1)
if we calculate for the 04 zoom it makes 561 files with the above formula. And it is the same number with "The number of the files that is created after the zoom compiling".
In the formula

tile process in other applications (topleft)

X,Y

X+1,Y

X,Y+1

X+1,Y+1

tilecache process in bottomleft appllication

X,Y+1

X+1,Y+1

X,Y

X+1,Y

 

Tilecache screen output for 01 zoom level

01 (000000, 000000) = (-180.0000 -90.0000 -90.0000 0.0000) [0.0940s : 10.627/s] 1/8
01 (000001, 000000) = (-90.0000 -90.0000 0.0000 0.0000) [0.0620s : 12.812/s] 2/8
01 (000002, 000000) = (0.0000 -90.0000 90.0000 0.0000) [0.0630s : 13.692/s] 3/8
01 (000003, 000000) = (90.0000 -90.0000 180.0000 0.0000) [0.0310s : 15.994/s] 4/8
01 (000004, 000000) = (180.0000 -90.0000 270.0000 0.0000) [0.0000s : 19.992/s] 5/8
01 (000000, 000001) = (-180.0000 0.0000 -90.0000 90.0000) [0.0780s : 18.287/s] 6/8
01 (000001, 000001) = (-90.0000 0.0000 0.0000 90.0000) [0.1250s : 15.449/s] 7/8
01 (000002, 000001) = (0.0000 0.0000 90.0000 90.0000) [0.2020s : 12.212/s] 8/8
01 (000003, 000001) = (90.0000 0.0000 180.0000 90.0000) [0.1250s : 11.537/s] 9/8
01 (000004, 000001) = (180.0000 0.0000 270.0000 90.0000) [0.0000s : 12.819/s] 10/8
01 (000000, 000002) = (-180.0000 90.0000 -90.0000 180.0000) [0.0000s : 14.101/s] 11/8
01 (000001, 000002) = (-90.0000 90.0000 0.0000 180.0000) [0.0160s : 15.073/s] 12/8
01 (000002, 000002) = (0.0000 90.0000 90.0000 180.0000) [0.0000s : 16.330/s] 13/8
01 (000003, 000002) = (90.0000 90.0000 180.0000 180.0000) [0.0000s : 17.586/s] 14/8

01 (000004, 000002) = (180.0000 90.0000 270.0000 180.0000) [0.0000s : 18.842/s] 15/8

8 is The calculated number of files before compiling and 15 is The number of the files that is created after the zoom compiling. I don't know the reason of this difference

 

By the way the PergoMap is a map which is only compiled for Turkey and has street level

You can go to the below link for the location of Istanbul Fatih Sultan Mehmet Bridge which connects Asia and Europe
http://maps.pergo.com.tr/map.htm?lat=41.091250&lon=29.060848&zoom=14

After big zoom levels (i think from 08), the blank piece of lands in the generated map files are deleted.
this is to fasten the map by preventing the transfers of the blank lands

If the required frame could not be found at openlayer.tilecache than the frame which is at the adress "http://maps.pergo.com.tr/img/nodata.png" is loaded.

And this prevents a ratio of %50 unnecessary frame cacheing. In Gmap, can we provide a standart frame if the requested frame could not be found at the server as I mentioned above?

This is all from me now:)

I hope we can see PergoMap in the the new version of the type list in GMap. :)

Regards,

Mustafa

Coordinator
Jan 19, 2010 at 1:13 PM

hm, ..any chances to switch to TopLeft system?

Jan 19, 2010 at 1:23 PM

No, it is the tilecache's standart. we can't switch to TopLeft system.

 

Coordinator
Jan 19, 2010 at 1:25 PM

i see, then i'll make some changes

Coordinator
Jan 19, 2010 at 5:25 PM

done!

Jan 20, 2010 at 12:31 PM

It's greath. I will test right away.

Thanks for your effort.

Jan 20, 2010 at 4:00 PM

You may want to rename from PergoMap to TileCache?
Because the name of standart is TileCache.

Regards,
Baris

 

Coordinator
Jan 20, 2010 at 4:04 PM

all maps are tilecaches, so you want TileCache1, TileCache2bn? ;}