<div>Hi guys,</div>
<div>&nbsp;</div>
<div>I've tried to make a efficient map layer with the commands shp2tile, tile4ms, and shptree, but something seems not right, because MapServer can not draw the maps. I've made a test in a seperate folder, and I've done the following processes:
</div>
<div>&nbsp;</div>
<div>***</div>
<div>data -- Forests.shp (for a country)</div>
<div>***</div>
<div>1. &gt;shp2tile -r 50 -c 50 Forests.shp Forests_Test.shp</div>
<div>&gt;&gt;&gt;results for this step: shp, shx, and dbf files, there is no prj file for the output file</div>
<div>&gt;&gt;&gt;error info&nbsp;on the&nbsp;console: failed to create shp Forests_Test.shp -1833</div>
<div>&nbsp;</div>
<div>2. &gt;tile4ms ---- get the&nbsp;tileindex.shx, tileindex.shp and tileindex.dbf files for the Forests_Test.shp, there is&nbsp;still no prj file&nbsp;for tileindex.shp</div>
<div>&gt;&gt;&gt;no error messages appear at this step</div>
<div>&nbsp;</div>
<div>3. &gt;shptree -- to genetare .qix file for all shapefiles in this&nbsp;subfolder</div>
<div>&gt;&gt;&gt;&nbsp;results for this step: Forests.qix, Forests_Test.qix, and tileindex.qix</div>
<div>&gt;&gt;&gt;no error info on the console</div>
<div>&nbsp;</div>
<div>but, only if I set&nbsp;DATA &quot;Forests&quot; in the layer object the map will be rendered, others like DATA &quot;Forests_Test&quot; or TTILEINDEX &quot;tileindex&quot; TILEITEM &quot;location&quot; do not work, the server simply sends back a blank image.
</div>
<div>&nbsp;</div>
<div>did I make any mistakes or it really do not work well. (I am using MS4W 4.8.1)</div>
<div>&nbsp;</div>
<div>I guess some errors occur when I perform the command shp2tile.</div>
<div>&nbsp;</div>
<div>thanks for any further info.</div>
<div>&nbsp;</div>
<div>zhonghai<br>&nbsp;</div>
<div><span class="gmail_quote">On 5/18/06, <b class="gmail_sendername">Zhonghai Wang</b> &lt;<a href="mailto:zhonghaiw@gmail.com">zhonghaiw@gmail.com</a>&gt; wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div>
<div>Hi Bob, Steve,</div>
<div>&nbsp;</div>
<div>thank you very much for all these helpful clues, now I think I've got the points of the shp2tile command, it's really a good tool to slice shapefile.</div></div>
<div><span class="sg">
<div>&nbsp;</div>
<div>zhonghai<br>&nbsp;</div></span></div>
<div><span class="e" id="q_10b4644dcb6e18c4_2">
<div><span class="gmail_quote">On 5/18/06, <b class="gmail_sendername">Stephen Woodbridge</b> &lt;<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:woodbri@swoodbridge.com" target="_blank">woodbri@swoodbridge.com
</a>&gt; wrote:</span> 
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Zhonghai Wang wrote:<br>&gt; Hi folks,<br>&gt;<br>&gt; I have a large shapefile, now I am trying to use shp2tile command to 
<br>&gt; slice it into pieces, with -r and -c is ok, but I do not fully<br>&gt; understand the -q parameter, what does it actually mean? and what number<br>&gt; should a use for this parameter normally?<br>&gt;<br>&gt; or something like this? -- &gt;shp2tile -q 10000 input_shapefile 
<br>&gt; output_shapefile<br><br>Hi Zhonghai,<br><br>The -r -c option breaks the extents of your shapefile into R x C rows<br>and columns and then tries to fit the objects into the best tile. I any<br>tile crosses a tile boundary by 5-10% then it is put into a &quot;supertile&quot; 
<br>the could be the same extents as the original shape file. So typically<br>you will end up with r X c + 1 tiles.<br><br>The -q N option splits the extents in half either vertically or<br>horizontally and then sorts the objects into the 2 halves or put them in 
<br>a supertile. Then if the either of the two halves has more than N<br>objects it is again split in half and this continues until all files<br>have less than N objects. This can cause some strange effects like tiles<br>
with 1 or a small number of objects and most tiles will have less than N<br>objects in them. Since this algorithm tends to spatially cluster objects<br>in a file, there is a good chance that if you need the file that all or 
<br>most objects in the file will be used.<br><br>I recommend trying numbers like 10,000 and 20,000 as you initial tries.<br>I think you should probably not use numbers less then 8000, but it is<br>really up to you to try and measure the results to find what works best 
<br>for your data.<br><br>-Steve W.<br></blockquote></div><br></span></div></blockquote></div><br>