[mapguide-users] Pre-Genererate tiles for the entire map at all pre-defined zoom scales

Farah farah at egovernments.org
Fri Sep 1 03:52:10 EDT 2006


Hi Traian!!

 

Thanks for the info..!!!

 

So the things I need to do are:

 

1.	Find the overall map extent.
2.	Find the predefined zoom scales 
3.	For each of these zoom scales, I need to find the number of  tiles
x, no of tiles y.( using the formulae that u specified)
4.	Then I need to loop through these and call GetTile( map,
baselayergroup, column, row)

 

However, to find the no. of tiles x and y, I need to know the map width and
height in meters. I guess I can get the map height and width, in double,
from the map extent. Can you tell me how to convert these into
pixels..?Please help!

 

Thanks in advance

Farah

 

  _____  

From: Traian Stanev [mailto:traian.stanev at autodesk.com] 
Sent: Thursday, August 31, 2006 6:16 PM
To: users at mapguide.osgeo.org
Subject: RE: [mapguide-users] Pre-Genererate tiles for the entire map at all
pre-defined zoom scales

 

 

Hi Farah.

 

The upper left corner of the extents of the map corresponds to tile (0,0).
Then tile (1,0) is to the right of that and tile (0,1) is under tile (0,0).

So assuming you know the extents of your map, you can calculate how many
tiles it spans at the given scale, using the following

 

number of tiles x = map width in meters  / ( 0.079375 * map_scale)

number of tiles y = map height in meters / ( 0.079375 * map_scale)

 

where 0.079375 = [inch to meter] / image DPI * tile size = 0.0254 / 96 *
300.

 

This assumes you know the scale factor that converts your map width and
height to meters. You can get this from the coordinate system of the map if
you don't know it, but it's much easier to just plug in the number into this
equation.

 

Also have in mind that you can also request tiles beyond the map extent (for
example tile (-1, -1), however, there is probably no point to cache them
unless you have valid data outside your initial map extents.

 

Traian

 

 

  _____  

From: Farah [mailto:farah at egovernments.org] 
Sent: Thursday, August 31, 2006 2:52 AM
To: users at mapguide.osgeo.org
Subject: [mapguide-users] Pre-Genererate tiles for the entire map at all
pre-defined zoom scales

Hi friends!

 

I am trying to pre-generate tiles, of the base map group layers,at various
zoom levels and pre-populate the TileCache , so as to improve the
performance.

 

I guess I have to use the function:


virtual MgByteReader
<https://mapguide.osgeo.org/nonav/docs/webapi/d8/d50/class_mg_byte_reader.ht
ml>  * 

GetTile
<https://mapguide.osgeo.org/nonav/docs/webapi/df/dba/class_mg_tile_service_a
0fab3452d48d4a4abeedb8dc2c18611.html#a0fab3452d48d4a4abeedb8dc2c18611>
(MgMap
<https://mapguide.osgeo.org/nonav/docs/webapi/da/df8/class_mg_map.html>
*map, CREFSTRING
<https://mapguide.osgeo.org/nonav/docs/webapi/da/d10/_common_defs_8h_2697935
ae7be4121104b37ff513b810b.html#2697935ae7be4121104b37ff513b810b>
baseMapLayerGroupName, INT32
<https://mapguide.osgeo.org/nonav/docs/webapi/da/d10/_common_defs_8h_0cb58e7
e6f0bad369840a52e54a56ae0.html#0cb58e7e6f0bad369840a52e54a56ae0>
tileColumn, INT32
<https://mapguide.osgeo.org/nonav/docs/webapi/da/d10/_common_defs_8h_0cb58e7
e6f0bad369840a52e54a56ae0.html#0cb58e7e6f0bad369840a52e54a56ae0>  tileRow)=0

 

 

I read from a previous post that Tile column and row are related to map
coordinates in the function

called MgServerRenderingService::RenderTile. However, I don't get how the
tile column and row are associated with the map coordinates. Does anyone
have any idea about this? Please help!!

 

Thanks in advance,

Farah

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapguide-users/attachments/20060901/263f073a/attachment.html


More information about the Mapguide-users mailing list