[mapguide-users] Pre-Genererate tiles for the entire map at all pre-defined zoom scales
Traian Stanev
traian.stanev at autodesk.com
Thu Aug 31 08:45:58 EDT 2006
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_reade
r.html> *
GetTile
<https://mapguide.osgeo.org/nonav/docs/webapi/df/dba/class_mg_tile_servi
ce_a0fab3452d48d4a4abeedb8dc2c18611.html#a0fab3452d48d4a4abeedb8dc2c1861
1> (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_269
7935ae7be4121104b37ff513b810b.html#2697935ae7be4121104b37ff513b810b>
baseMapLayerGroupName, INT32
<https://mapguide.osgeo.org/nonav/docs/webapi/da/d10/_common_defs_8h_0cb
58e7e6f0bad369840a52e54a56ae0.html#0cb58e7e6f0bad369840a52e54a56ae0>
tileColumn, INT32
<https://mapguide.osgeo.org/nonav/docs/webapi/da/d10/_common_defs_8h_0cb
58e7e6f0bad369840a52e54a56ae0.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/20060831/c7b385f2/attachment.html
More information about the Mapguide-users
mailing list