Hi Steve,<br>
<br>
Thank you so much for your reply!&nbsp; It was very informative and easy to understand.<br>
<br>
I think I shall stick with idx-ing them for now.&nbsp; I've got a layer
for roads which is 100megs!&nbsp; 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> &lt;<a href="mailto:woodbri@swoodbridge.com">woodbri@swoodbridge.com</a>&gt; 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>&nbsp;&nbsp;&nbsp;&nbsp;find /path/to/data -name &quot;*.shp&quot; -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>&nbsp;&nbsp; -Steve W.<br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://imaptools.com">
http://imaptools.com</a><br><br>Xin wrote:<br>&gt; Hi list,<br>&gt;<br>&gt; I've searched the archives endlessly, and though there's been alot of<br>&gt; posts on this I still can't seem to get the hang of it.<br>&gt;<br>
&gt; I'm trying to index my shapefiles, as I've been told this will give it a<br>&gt; performance boost.&nbsp;&nbsp;All my data are all in one directory, and they're<br>&gt; roughly half a gig in size.&nbsp;&nbsp;It is operating rather slowly at the
<br>&gt; moment, taking a few seconds to display all the layers.<br>&gt;<br>&gt; This is how I initially tried to use tile index on my data:<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;ogrtindex
*.shp tileindex.shp&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #
to index all my shapefiles<br>&gt; in the map file, add below to every layer:<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;
TILEINDEX
&quot;tileindex.shp,0&quot;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#
and remove DATA tag<br>&gt;<br>&gt; This doesn't work!<br>&gt;<br>&gt; I've since read you have to group different types together into one<br>&gt; index file.&nbsp;&nbsp;i.e. all the POINTS in one, LINES in another etc.&nbsp;&nbsp;So you<br>
&gt; would have say 4 tile index files, each corresponding to each type.<br>&gt; Then would I use these filenames, i.e. TILEINDEX &quot;pointindex.shp&quot;.&nbsp;&nbsp;Is<br>&gt; this the right way, anyway to automated?&nbsp;&nbsp;And what are shptree used for?
<br>&gt;<br>&gt; I tried to use <a href="http://imaptools.com">imaptools.com</a> &lt;<a href="http://imaptools.com">http://imaptools.com</a>&gt;'s shp2tile, but the<br>&gt; library it depends on(shapelib) wouldn't compile.
<br>&gt;<br>&gt; One last question.&nbsp;&nbsp;What's qix and should I use it?<br>&gt;<br>&gt; Thank you inadvance for your help.<br>&gt;<br>&gt; Regards,<br>&gt; Xin<br>&gt;<br><br></blockquote></div><br>