<div>Hi Steve,</div>
<div> </div>
<div>I've tried again like you said, this time I get something, but still no map images are rendered.</div>
<div> </div>
<div>the version is exactly the same, updated version.</div>
<div> </div>
<div>First test example:</div>
<div> </div>
<div>data -- admin.shp (administration area, which includes 5 polygons)</div>
<div> </div>
<div>****</div>
<div>when performing shp2tile command, no parameters are set, and by default the shapefile is sliced into 2*2+1 shapefiles. With the following layer object definition, map image is drawn:</div>
<div> </div>
<div>LAYER<br> NAME "administration"<br> GROUP "country"<br> STATUS DEFAULT<br> TILEINDEX "index"<br> TILEITEM "LOCATION"<br> TYPE POLYGON<br> DEBUG ON<br> TRANSPARENCY ALPHA
<br> CLASS<br> NAME "woodland"<br> STYLE<br> COLOR 204 204 255<br> ANTIALIAS TRUE<br> END<br> END<br> END<br>**********</div>
<div>Second test example:</div>
<div> </div>
<div>data -- settlement.shp, which contains 2155664 polygons</div>
<div> </div>
<div>****</div>
<div>when performing shp2tile command for this shapefile, I set 10*10, each slice contians therefore about 21557 polygons. It's also ok with tile4ms and shptree commands.</div>
<div> </div>
<div>hm... seems exciting...</div>
<div> </div>
<div>but, with this layer object definition no settlements are drawn :</div>
<div> </div>
<div>LAYER<br> NAME "Settlement"<br> GROUP "settlements"<br> STATUS DEFAULT<br> TILEINDEX "settlementindex"<br> TILEITEM "LOCATION"<br> MAXSCALE 100000 <br> TYPE POLYGON
<br> DEBUG ON<br> TRANSPARENCY ALPHA<br> CLASS<br> NAME "SM"<br> STYLE<br> COLOR 153 153 102<br> ANTIALIAS TRUE<br> END<br> END<br> END </div>
<div>*****</div>
<div>I have now really no idea where the problems should be.</div>
<div> </div>
<div>Steve, any clues?</div>
<div> </div>
<div>thanks for your info.</div>
<div> </div>
<div>zhonghai</div>
<div> </div>
<div><span class="gmail_quote">On 5/18/06, <b class="gmail_sendername">Stephen Woodbridge</b> <<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:woodbri@swoodbridge.com" target="_blank">woodbri@swoodbridge.com
</a>> 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>> Hi guys,<br>><br>> I've tried to make a efficient map layer with the commands shp2tile,
<br>> tile4ms, and shptree, but something seems not right, because MapServer<br>> can not draw the maps. I've made a test in a seperate folder, and I've<br>> done the following processes:<br>><br>> ***<br>> data --
Forests.shp (for a country)<br>> ***<br>> 1. >shp2tile -r 50 -c 50 Forests.shp Forests_Test.shp<br>> >>>results for this step: shp, shx, and dbf files, there is no prj file<br>> for the output file
<br>> >>>error info on the console: failed to create shp Forests_Test.shp -1833<br><br>This is likely because you are trying to create 2501 files (50 x 50 + 1)<br>and they all half to be open at the same time for this mode so you
<br>likely ran into a process file handle limit. Also how many point do you<br>have in this layer? What is the value of Num_points/2500, this number<br>should not be smaller than 8000 - 10000.<br><br>> 2. >tile4ms ---- get the
tileindex.shx, tileindex.shp and tileindex.dbf<br>> files for the Forests_Test.shp, there is still no prj file for tileindex.shp<br>> >>>no error messages appear at this step<br><br>There are no prj files created. Mapserver does not use them.
<br><br>> 3. >shptree -- to genetare .qix file for all shapefiles in this subfolder<br>> >>> results for this step: Forests.qix, Forests_Test.qix, and tileindex.qix<br>> >>>no error info on the console
<br>><br>> but, only if I set DATA "Forests" in the layer object the map will be<br>> rendered, others like DATA "Forests_Test" or TTILEINDEX "tileindex"<br>> TILEITEM "location" do not work, the server simply sends back a blank
<br>> image.<br>><br>> did I make any mistakes or it really do not work well. (I am using MS4W<br>> 4.8.1)<br>><br>> I guess some errors occur when I perform the command shp2tile.<br><br>What version of shp2tile are you using?
<br><br>woodbri@carto:/data/mdata$ ~/dev/shptools/shp2tile -v<br>$Id: shp2tile.c,v 1.13 2005/12/05 22:38:08 woodbri Exp $<br><br>If it does not respond with the Id string above you need to upgrade as<br>there is a serious crashing bug for point data in the earlier version if
<br>you are using the -q option. It should work for the row col option, just<br>try to decrease the number of tiles.<br><br>Also if you do not have something like R x C files in your directory<br>then the process failed. For the row col option you can also specify
<br>--no-write to just get a stats report of how the data is put into the tiles.<br><br>-Steve<br><br>> thanks for any further info.<br>><br>> zhonghai<br>><br>> On 5/18/06, *Zhonghai Wang* <<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:zhonghaiw@gmail.com" target="_blank">
zhonghaiw@gmail.com</a><br>> <mailto:<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:zhonghaiw@gmail.com" target="_blank">zhonghaiw@gmail.com</a>>> wrote:<br>><br>> Hi Bob, Steve,
<br>><br>> thank you very much for all these helpful clues, now I think I've <br>> got the points of the shp2tile command, it's really a good tool to<br>> slice shapefile.<br>><br>> zhonghai
<br>><br>> On 5/18/06, *Stephen Woodbridge* <<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:woodbri@swoodbridge.com" target="_blank"> woodbri@swoodbridge.com</a><br>> <mailto:
<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:woodbri@swoodbridge.com" target="_blank">woodbri@swoodbridge.com</a>>> wrote:<br>><br>> Zhonghai Wang wrote:<br>>> Hi folks,
<br>>><br>>> I have a large shapefile, now I am trying to use shp2tile <br>> command to<br>>> slice it into pieces, with -r and -c is ok, but I do not fully<br>>> understand the -q parameter, what does it actually mean? and
<br>> what number<br>>> should a use for this parameter normally? <br>>><br>>> or something like this? -- >shp2tile -q 10000 input_shapefile<br>>> output_shapefile<br>><br>> Hi Zhonghai,
<br>><br>> The -r -c option breaks the extents of your shapefile into R x C <br>> rows<br>> and columns and then tries to fit the objects into the best<br>> tile. I any<br>> tile crosses a tile boundary by 5-10% then it is put into a
<br>> "supertile" <br>> the could be the same extents as the original shape file. So<br>> 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<br>> 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<br>> like tiles<br>> with 1 or a small number of objects and most tiles will have<br>> less than N<br>> objects in them. Since this algorithm tends to spatially cluster
<br>> objects<br>> in a file, there is a good chance that if you need the file that<br>> 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
<br>> tries.<br>> I think you should probably not use numbers less then 8000, but<br>> it is<br>> really up to you to try and measure the results to find what<br>> works best
<br>> for your data.<br>><br>> -Steve W.<br>><br>><br>><br><br></blockquote></div><br>