<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML xmlns="http://www.w3.org/TR/REC-html40" xmlns:v =
"urn:schemas-microsoft-com:vml" xmlns:o =
"urn:schemas-microsoft-com:office:office" xmlns:w =
"urn:schemas-microsoft-com:office:word"><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.5450.4" name=GENERATOR>
<STYLE>@font-face {
        font-family: Courier;
}
@page Section1 {size: 8.5in 11.0in; margin: 1.0in 1.25in 1.0in 1.25in; }
P.MsoNormal {
        FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman"
}
LI.MsoNormal {
        FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman"
}
DIV.MsoNormal {
        FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman"
}
A:link {
        COLOR: blue; TEXT-DECORATION: underline
}
SPAN.MsoHyperlink {
        COLOR: blue; TEXT-DECORATION: underline
}
A:visited {
        COLOR: purple; TEXT-DECORATION: underline
}
SPAN.MsoHyperlinkFollowed {
        COLOR: purple; TEXT-DECORATION: underline
}
PRE {
        FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: Courier
}
SPAN.EmailStyle17 {
        COLOR: windowtext; FONT-FAMILY: Arial; mso-style-type: personal-compose
}
DIV.Section1 {
        page: Section1
}
</STYLE>
</HEAD>
<BODY lang=EN-US vLink=purple link=blue>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff
size=2></FONT> </DIV>
<DIV dir=ltr align=left><SPAN class=561482512-31082006><FONT face=Arial
color=#0000ff size=2>Hi Farah.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=561482512-31082006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=561482512-31082006><FONT face=Arial
color=#0000ff size=2>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).</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=561482512-31082006><FONT face=Arial
color=#0000ff size=2>So assuming you know the extents of your map, you can
calculate how many tiles it spans at the given scale, using the
following</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=561482512-31082006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=561482512-31082006><FONT face=Arial
color=#0000ff size=2>number of tiles x = map width in meters /
( 0.079375 * map_scale)</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=561482512-31082006><FONT face=Arial
color=#0000ff size=2>number of tiles y = map height in meters / ( 0.079375
* map_scale)</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=561482512-31082006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=561482512-31082006><FONT face=Arial
color=#0000ff size=2>where 0.079375 = [inch to meter] / image DPI * tile size =
0.0254 / 96 * 300.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=561482512-31082006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=561482512-31082006><FONT face=Arial
color=#0000ff size=2>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.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=561482512-31082006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=561482512-31082006><FONT face=Arial
color=#0000ff size=2>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.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=561482512-31082006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=561482512-31082006><FONT face=Arial
color=#0000ff size=2>Traian</FONT></SPAN></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff
size=2></FONT> </DIV><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> Farah [mailto:farah@egovernments.org]
<BR><B>Sent:</B> Thursday, August 31, 2006 2:52 AM<BR><B>To:</B>
users@mapguide.osgeo.org<BR><B>Subject:</B> [mapguide-users] Pre-Genererate
tiles for the entire map at all pre-defined zoom scales<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV class=Section1>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Hi
friends!<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">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.<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">I guess I have to use the
function:<o:p></o:p></SPAN></FONT></P>
<TABLE class=MsoNormalTable cellSpacing=0 cellPadding=0 border=0>
<TBODY>
<TR>
<TD
style="PADDING-RIGHT: 0in; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; PADDING-TOP: 0in"
vAlign=top noWrap>
<P class=MsoNormal style="TEXT-ALIGN: right" align=right><FONT
face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">virtual <A
href="https://mapguide.osgeo.org/nonav/docs/webapi/d8/d50/class_mg_byte_reader.html">MgByteReader</A>
* <o:p></o:p></SPAN></FONT></P></TD>
<TD
style="PADDING-RIGHT: 0in; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; PADDING-TOP: 0in"
vAlign=bottom>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt"><A
href="https://mapguide.osgeo.org/nonav/docs/webapi/df/dba/class_mg_tile_service_a0fab3452d48d4a4abeedb8dc2c18611.html#a0fab3452d48d4a4abeedb8dc2c18611">GetTile</A>
(<A
href="https://mapguide.osgeo.org/nonav/docs/webapi/da/df8/class_mg_map.html">MgMap</A>
*map, <A
href="https://mapguide.osgeo.org/nonav/docs/webapi/da/d10/_common_defs_8h_2697935ae7be4121104b37ff513b810b.html#2697935ae7be4121104b37ff513b810b">CREFSTRING</A>
baseMapLayerGroupName, <A
href="https://mapguide.osgeo.org/nonav/docs/webapi/da/d10/_common_defs_8h_0cb58e7e6f0bad369840a52e54a56ae0.html#0cb58e7e6f0bad369840a52e54a56ae0">INT32</A>
tileColumn, <A
href="https://mapguide.osgeo.org/nonav/docs/webapi/da/d10/_common_defs_8h_0cb58e7e6f0bad369840a52e54a56ae0.html#0cb58e7e6f0bad369840a52e54a56ae0">INT32</A>
tileRow)=0<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt"><o:p> </o:p></SPAN></FONT></P></TD></TR></TBODY></TABLE><PRE style="BACKGROUND: #eeeeee; LINE-HEIGHT: 135%"><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 135%; FONT-FAMILY: Arial">I read from a previous post that <FONT color=black><SPAN style="COLOR: black">Tile column and row are related to map coordinates in the function<o:p></o:p></SPAN></FONT></SPAN></FONT></PRE>
<P class=MsoNormal><FONT face=Arial color=black size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Arial">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!!<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=black size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=black size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Arial">Thanks in
advance,<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=black size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Arial">Farah</SPAN></FONT><FONT
face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p></o:p></SPAN></FONT></P></DIV></BODY></HTML>