Hi Steve,<br>
<br>
Thank you so much for your reply!  It was very informative and easy to understand.<br>
<br>
I think I shall stick with idx-ing them for now.  I've got a layer
for roads which is 100megs!  I'll attempt tileindexing of the
second kind on this later if need be.<br>
<br>
Thank you so much again.<br>
Xin<br><br><div><span class="gmail_quote">On 05/09/05, <b class="gmail_sendername">Stephen Woodbridge</b> <<a href="mailto:woodbri@swoodbridge.com">woodbri@swoodbridge.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi Xin,<br><br>It is a little more complicated than you have tried, I will try to<br>explain it.<br><br>First, don't worry about shp2tile, most people do not need it and you<br>would need to get the basic mapserver working and the tileindexes
<br>working first, before you can assess if you need it.<br><br>For performance you need to make sure all *.shp files have a *.qix file<br>    find /path/to/data -name "*.shp" -exec shptree {} \;<br>These are spatial indexes and not having these on all files is the
<br>primary reason for poor performance. Do this first and see how you<br>performance is.<br><br>Tileindexes are a way of group lots of similar files together into a<br>single layer. This is most useful if you have thousands of shapefiles
<br>that represent the roads (or whatever) of a country and each file is in<br>a separate directory say organized by province or region. Then you can<br>create one layer and use the tileindex to collect all the files together
<br>and control them in a single layer.<br><br>Tileindexes have constraints on them as follows:<br>1) they should generally be of the same shape type (as you mentioned)<br>2) all the files referenced in an index MUST have the same attribute
<br>structure. This means that if the first file added to the index has 4<br>attribute columns say, for example, (int,string,string,double) with<br>names (GID,NAME,TYPE,AREA), then ALL files added to the index must have<br>
the SAME columns in the SAME order.<br><br>Tileindexes are also used in some cases where you have done all the<br>above, but you have a really HUGE shapefile. HUGE being lots of objects,<br>like 100s of thousands, that a spatially diverse. Then you can use
<br>shp2tile to chop the large file into lots of smaller files where the<br>objects are grouped spatially. Then you use a tileindex to bring them<br>all together again into a single layer. If you do this don't forget to<br>
create *.qix files for all the new shapefiles. I also recommend that you<br>put all the tiled files into a directory, like roads.shp into roads/<br><br>Hope this helps,<br>   -Steve W.<br>    <a href="http://imaptools.com">
http://imaptools.com</a><br><br>Xin wrote:<br>> Hi list,<br>><br>> I've searched the archives endlessly, and though there's been alot of<br>> posts on this I still can't seem to get the hang of it.<br>><br>
> I'm trying to index my shapefiles, as I've been told this will give it a<br>> performance boost.  All my data are all in one directory, and they're<br>> roughly half a gig in size.  It is operating rather slowly at the
<br>> moment, taking a few seconds to display all the layers.<br>><br>> This is how I initially tried to use tile index on my data:<br>>    ogrtindex
*.shp tileindex.shp         #
to index all my shapefiles<br>> in the map file, add below to every layer:<br>>    
TILEINDEX
"tileindex.shp,0"            #
and remove DATA tag<br>><br>> This doesn't work!<br>><br>> I've since read you have to group different types together into one<br>> index file.  i.e. all the POINTS in one, LINES in another etc.  So you<br>
> would have say 4 tile index files, each corresponding to each type.<br>> Then would I use these filenames, i.e. TILEINDEX "pointindex.shp".  Is<br>> this the right way, anyway to automated?  And what are shptree used for?
<br>><br>> I tried to use <a href="http://imaptools.com">imaptools.com</a> <<a href="http://imaptools.com">http://imaptools.com</a>>'s shp2tile, but the<br>> library it depends on(shapelib) wouldn't compile.
<br>><br>> One last question.  What's qix and should I use it?<br>><br>> Thank you inadvance for your help.<br>><br>> Regards,<br>> Xin<br>><br><br></blockquote></div><br>