<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=utf-8">
<META content="MSHTML 6.00.2900.5512" name=GENERATOR>
<STYLE>@font-face {
        font-family: 宋体;
}
@font-face {
        font-family: Verdana;
}
@font-face {
        font-family: @宋体;
}
@page Section1 {size: 595.3pt 841.9pt; margin: 72.0pt 90.0pt 72.0pt 90.0pt; layout-grid: 15.6pt; }
P.MsoNormal {
        TEXT-JUSTIFY: inter-ideograph; FONT-SIZE: 10.5pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman"; TEXT-ALIGN: justify
}
LI.MsoNormal {
        TEXT-JUSTIFY: inter-ideograph; FONT-SIZE: 10.5pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman"; TEXT-ALIGN: justify
}
DIV.MsoNormal {
        TEXT-JUSTIFY: inter-ideograph; FONT-SIZE: 10.5pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman"; TEXT-ALIGN: justify
}
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
}
SPAN.EmailStyle17 {
        FONT-WEIGHT: normal; COLOR: windowtext; FONT-STYLE: normal; FONT-FAMILY: Verdana; TEXT-DECORATION: none; mso-style-type: personal-compose
}
DIV.Section1 {
        page: Section1
}
UNKNOWN {
        FONT-SIZE: 10pt
}
BLOCKQUOTE {
        MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; MARGIN-LEFT: 2em
}
OL {
        MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px
}
UL {
        MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px
}
</STYLE>
</HEAD>
<BODY style="FONT-SIZE: 10pt; MARGIN: 10px; FONT-FAMILY: verdana">
<DIV><FONT face=Verdana color=#000080 size=2>thank you very much! I understand 
the concept of subblocking in brief.</FONT></DIV>
<DIV><FONT face=Verdana color=#000080 size=2>It is the skill of memory 
management of large image block using the default paras such as <FONT 
color=#000000>SUBBLOCK_SIZE=64.</FONT></FONT></DIV>
<DIV><FONT face=Verdana color=#000080 size=2>The strategy of memory block 
management in GDAL is LRU, I got the idea from mail list archives, and now are 
there only block list for all GDAL datasets? or one block list for one GDAL 
datasets?</FONT></DIV>
<DIV><FONT face=Verdana size=2>Is papoBlocks&nbsp;member the block list of 
memory?</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV>thanks</DIV>
<DIV>&nbsp;</DIV>
<DIV>
<DIV><FONT face=Verdana color=#c0c0c0 size=2><SPAN>gispowerfan</SPAN> 
</FONT></DIV>
<DIV><FONT color=#c0c0c0></FONT>&nbsp;</DIV></DIV>
<DIV><FONT face=Verdana color=#c0c0c0 size=2>2009-06-07 </FONT></DIV><FONT 
face=Verdana color=#000080 size=2>
<HR style="WIDTH: 100px" align=left color=#b5c4df SIZE=1>
</FONT>
<HR color=#b5c4df SIZE=1>

<DIV><FONT face=Verdana size=2><STRONG>发件人:</STRONG> Even Rouault </FONT></DIV>
<DIV><FONT face=Verdana size=2><STRONG>发送时间:</STRONG> 2009-06-07&nbsp; 16:56:17 
</FONT></DIV>
<DIV><FONT face=Verdana size=2><STRONG>收件人:</STRONG> gdal-dev </FONT></DIV>
<DIV><FONT face=Verdana size=2><STRONG>抄送:</STRONG> gispowerfan </FONT></DIV>
<DIV><FONT face=Verdana size=2><STRONG>主题:</STRONG> Re: [gdal-dev] subblock of 
gdal source code </FONT></DIV>
<DIV><FONT face=Verdana size=2></FONT> </DIV>
<DIV><FONT face=Verdana size=2>
<DIV>Unless&nbsp;you&nbsp;want&nbsp;to&nbsp;hack&nbsp;into&nbsp;gdalrasterband.cpp,&nbsp;you&nbsp;generally&nbsp;don't&nbsp;have&nbsp;to&nbsp;</DIV>
<DIV>care&nbsp;about&nbsp;that&nbsp;concept&nbsp;of&nbsp;subblocking.&nbsp;It&nbsp;is&nbsp;just&nbsp;an&nbsp;internal&nbsp;implementation&nbsp;</DIV>
<DIV>detail&nbsp;to&nbsp;improve&nbsp;memory&nbsp;usage&nbsp;when&nbsp;a&nbsp;raster&nbsp;has&nbsp;a&nbsp;big&nbsp;number&nbsp;of&nbsp;blocks.</DIV>
<DIV></DIV>
<DIV>Usually,&nbsp;GDAL&nbsp;will&nbsp;create&nbsp;an&nbsp;array&nbsp;of&nbsp;pointers&nbsp;to&nbsp;blocks&nbsp;of&nbsp;size&nbsp;nBlocksPerRow&nbsp;</DIV>
<DIV>x&nbsp;nBlocksPerColumn,&nbsp;stored&nbsp;in&nbsp;the&nbsp;papoBlocks&nbsp;member.&nbsp;Let's&nbsp;say&nbsp;your&nbsp;raster&nbsp;is&nbsp;</DIV>
<DIV>of&nbsp;dimension&nbsp;1000&nbsp;x&nbsp;1000&nbsp;and&nbsp;the&nbsp;block&nbsp;size&nbsp;is&nbsp;10x10.&nbsp;This&nbsp;would&nbsp;lead&nbsp;to&nbsp;the&nbsp;</DIV>
<DIV>creation&nbsp;of&nbsp;an&nbsp;array&nbsp;of&nbsp;100&nbsp;x&nbsp;100&nbsp;pointers.</DIV>
<DIV></DIV>
<DIV>If&nbsp;the&nbsp;number&nbsp;of&nbsp;blocks&nbsp;in&nbsp;one&nbsp;dimension&nbsp;is&nbsp;greater&nbsp;than&nbsp;SUBBLOCK_SIZE/2,&nbsp;then&nbsp;</DIV>
<DIV>GDAL&nbsp;will&nbsp;create&nbsp;instead&nbsp;an&nbsp;array&nbsp;of&nbsp;ceil(nBocksPerRow&nbsp;/&nbsp;SUBBLOCK_SIZE)&nbsp;*&nbsp;</DIV>
<DIV>ceil(nBocksPerColumn&nbsp;/&nbsp;SUBBLOCK_SIZE)&nbsp;where&nbsp;SUBBLOCK_SIZE&nbsp;=&nbsp;64.&nbsp;In&nbsp;the&nbsp;</DIV>
<DIV>example,&nbsp;as&nbsp;100&nbsp;&gt;&nbsp;32,&nbsp;an&nbsp;array&nbsp;of&nbsp;4&nbsp;x&nbsp;4&nbsp;is&nbsp;created&nbsp;in&nbsp;papoBlocks.&nbsp;Each&nbsp;</DIV>
<DIV>element&nbsp;of&nbsp;this&nbsp;array&nbsp;can&nbsp;contain&nbsp;a&nbsp;sub-array&nbsp;of&nbsp;64x64&nbsp;pointer&nbsp;to&nbsp;blocks.&nbsp;But&nbsp;</DIV>
<DIV>at&nbsp;the&nbsp;beginning&nbsp;those&nbsp;sub-arrays&nbsp;are&nbsp;not&nbsp;created,&nbsp;in&nbsp;order&nbsp;to&nbsp;save&nbsp;memory.</DIV>
<DIV></DIV>
<DIV>When&nbsp;you&nbsp;need&nbsp;to&nbsp;access&nbsp;block&nbsp;(i,&nbsp;j),&nbsp;GDAL&nbsp;will&nbsp;first&nbsp;compute&nbsp;the&nbsp;subblock&nbsp;in&nbsp;</DIV>
<DIV>which&nbsp;the&nbsp;block&nbsp;is&nbsp;contained&nbsp;:&nbsp;(i',&nbsp;j')&nbsp;=&nbsp;(i&nbsp;/&nbsp;64,&nbsp;j&nbsp;/&nbsp;64).&nbsp;If&nbsp;the&nbsp;element&nbsp;at&nbsp;</DIV>
<DIV>(i',&nbsp;j')&nbsp;is&nbsp;NULL,&nbsp;GDAL&nbsp;will&nbsp;first&nbsp;instanciate&nbsp;the&nbsp;64x64&nbsp;array.&nbsp;Then&nbsp;it&nbsp;will&nbsp;</DIV>
<DIV>reserve&nbsp;memory&nbsp;for&nbsp;the&nbsp;block&nbsp;located&nbsp;at&nbsp;(i'',&nbsp;j'')&nbsp;=&nbsp;(i&nbsp;%&nbsp;64,&nbsp;j&nbsp;%&nbsp;64)&nbsp;in&nbsp;the&nbsp;</DIV>
<DIV>subblock.</DIV>
<DIV></DIV>
<DIV>In&nbsp;case&nbsp;of&nbsp;huge&nbsp;rasters,&nbsp;this&nbsp;concept&nbsp;could&nbsp;be&nbsp;extended&nbsp;to&nbsp;a&nbsp;third&nbsp;level&nbsp;of&nbsp;</DIV>
<DIV>indirection&nbsp;("sub-sub-blocks"),&nbsp;but&nbsp;this&nbsp;has&nbsp;not&nbsp;been&nbsp;implemented.</DIV>
<DIV></DIV>
<DIV>Not&nbsp;sure&nbsp;I've&nbsp;been&nbsp;very&nbsp;clear.&nbsp;But&nbsp;now&nbsp;if&nbsp;you&nbsp;read&nbsp;the&nbsp;code,&nbsp;you&nbsp;should&nbsp;</DIV>
<DIV>understand&nbsp;what&nbsp;I&nbsp;mean&nbsp;;-)</DIV>
<DIV></DIV>
<DIV>Le&nbsp;Sunday&nbsp;07&nbsp;June&nbsp;2009&nbsp;09:21:57&nbsp;gispowerfan,&nbsp;vous&nbsp;avez&nbsp;écrit&nbsp;:</DIV>
<DIV>&gt;&nbsp;hi,</DIV>
<DIV>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Recently&nbsp;I&nbsp;read&nbsp;the&nbsp;sorce&nbsp;code&nbsp;of&nbsp;gdal,&nbsp;and&nbsp;I&nbsp;found&nbsp;that&nbsp;there&nbsp;are</DIV>
<DIV>&gt;&nbsp;subblocking&nbsp;in&nbsp;GDALRasterBand,&nbsp;can&nbsp;anyone&nbsp;give&nbsp;some&nbsp;examples&nbsp;of&nbsp;subblock,</DIV>
<DIV>&gt;&nbsp;and&nbsp;how&nbsp;to&nbsp;use&nbsp;it?&nbsp;some&nbsp;doc&nbsp;in&nbsp;detail&nbsp;will&nbsp;be&nbsp;better!</DIV>
<DIV>&gt;</DIV>
<DIV>&gt;&nbsp;thanks&nbsp;in&nbsp;advance!</DIV>
<DIV>&gt;</DIV>
<DIV>&gt;&nbsp;gispowerfan</DIV>
<DIV>&gt;</DIV>
<DIV>&gt;&nbsp;2009-06-07</DIV>
<DIV>&gt;</DIV>
<DIV>&gt;</DIV>
<DIV>&gt;</DIV>
<DIV>&gt;&nbsp;gispowerfan</DIV>
<DIV></DIV>
<DIV></DIV></FONT></DIV></BODY></HTML>