<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">Hi,<br>
<br>
The Shape driver work with qix file internally (speed up spatial
filters). You can find if qix file exist with cpl function:
CPLCheckForFile<br>
Also you can create own QuadTree with: CPLQuadTreeCreate<br>
<br>
<pre class="moz-signature" cols="72">Best regards,
Dmitry</pre>
14.02.2014 9:39, Chaitanya kumar CH пишет:<br>
</div>
<blockquote
cite="mid:CAMKgpOZZPur8nzLEx1WZApx=boRLkKH7hOoLs6tTe9+UCiW6Dw@mail.gmail.com"
type="cite">
<div dir="ltr">
<div><span style="font-family:arial,sans-serif;font-size:13px">Chuiqing,</span><br>
</div>
<div><span style="font-family:arial,sans-serif;font-size:13px"><br>
</span></div>
<div>You can create an index through SQL. This is the preferred
method even if you stick to the shapefile format for your
vector data.</div>
<div><br>
</div>
<font face="courier new, monospace">OGRDataSource::ExecuteSQL()</font>
<div><br>
</div>
<div>OGR's Shapefile driver supports these SQL commands among
others:</div>
<div>
<div><font face="courier new, monospace">CREATE SPATIAL INDEX
ON layer_name [DEPTH n]</font></div>
<div><font face="courier new, monospace">DROP SPATIAL INDEX ON
layer_name</font></div>
<div><font face="courier new, monospace">REPACK layer_name</font></div>
<div><font face="courier new, monospace">RECOMPUTE EXTENT ON
layer_name</font></div>
<div><br>
</div>
</div>
</div>
<div class="gmail_extra"><br>
<br>
<div class="gmail_quote">On Fri, Feb 14, 2014 at 10:56 AM, C.
Zeng <span dir="ltr"><<a moz-do-not-send="true"
href="mailto:chqzeng@gmail.com" target="_blank">chqzeng@gmail.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">Hi Chaitanya,
<div><br>
</div>
<div>Thank you for your response,</div>
<div>I know I can do this through GDAL binary, and my
question is: how can I integrate this function into my
code?</div>
<div><br>
</div>
<div>
I have a platform like QGIS, I would like the program
itself have the ability to create and load .qix file.
For example, when I open the .shp file, I can detect
whether there is .qix, if not then create a new qix
file;</div>
<div>When the user zoom the map window, it will filter the
map content via the qix file to accelerate the
searching.</div>
<div>Does GDAL/OGR has similar functions/classes,
something like <span style="color:rgb(128,0,128)">OGRSFDriverRegistrar::Createqix(savepath),</span></div>
<div><span style="color:rgb(128,0,128)">OGRSFDriverRegistrar::Loadqix(path)</span><span
style="color:rgb(128,0,128)">,</span>to open and use
qix files?</div>
<div class="gmail_extra"><br>
</div>
<div class="gmail_extra"><br>
</div>
<div class="gmail_extra">Thank you,</div>
<div class="gmail_extra"><br>
</div>
<div class="gmail_extra">Chuiqing,</div>
<div>
<div class="h5">
<div class="gmail_extra">
<br>
<br>
<div class="gmail_quote">
On Thu, Feb 13, 2014 at 11:46 PM, Chaitanya kumar
CH <span dir="ltr"><<a moz-do-not-send="true"
href="mailto:chaitanya.ch@gmail.com"
target="_blank">chaitanya.ch@gmail.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0px
0px 0px
0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div dir="ltr">Chuiqing,<br>
<div><br>
</div>
<div>The OGR Shapefile driver supports spatial
indexing through qix files. To explicitly
create a spatial index use the Create Index
command:</div>
<div>
<pre>CREATE SPATIAL INDEX ON tablename [DEPTH N]</pre>
<pre><span style="color:rgb(34,34,34);font-family:arial;white-space:normal">Depth can range from 1 to 12. You can issue the SQL command using ogrinfo.</span>
</pre>
<pre><font face="courier new, monospace"><span style="color:rgb(34,34,34);white-space:normal">ogrinfo -sql '</span>CREATE SPATIAL INDEX ON shapefilename [DEPTH N]<span style="color:rgb(34,34,34);white-space:normal">' path/to/shapefile/directory</span></font></pre>
<pre><font face="arial"><span style="white-space:normal"><a moz-do-not-send="true" href="http://www.gdal.org/ogr/drv_shapefile.html" target="_blank">http://www.gdal.org/ogr/drv_shapefile.html</a> -> Spatial and Attribute Indexing.
</span></font></pre>
</div>
</div>
<div class="gmail_extra"><br>
<br>
<div class="gmail_quote">On Fri, Feb 14, 2014
at 3:12 AM, <span dir="ltr"><<a
moz-do-not-send="true"
href="mailto:chqzeng@gmail.com"
target="_blank">chqzeng@gmail.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote"
style="margin:0px 0px 0px
0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Hi
chaitanya_ch,<br>
I know you are an expert on this, I want
to know how can I use GDAL library to
implemented qix reading and using in
spatial filtering.<br>
I have many large shape files in Gigbyte
level, they are very slow when navigating
in my app. I want to use *.qix file
through GDAL library to accelerate it.<br>
<br>
How can I do that?<br>
Thank you,<br>
<br>
C. Zeng<br>
<br>
<br>
_____________________________________<br>
Sent from <a moz-do-not-send="true"
href="http://osgeo-org.1560.x6.nabble.com"
target="_blank">http://osgeo-org.1560.x6.nabble.com</a><br>
<br>
<span><font color="#888888">
</font></span></blockquote>
</div>
<span><font color="#888888"><br>
<br clear="all">
<div><br>
</div>
-- <br>
Best regards,<br>
Chaitanya kumar CH.<br>
<br>
<a moz-do-not-send="true"
href="tel:%2B91-9494447584"
value="+919494447584" target="_blank">+91-9494447584</a><br>
17.2416N 80.1426E
</font></span></div>
</blockquote>
</div>
<br>
</div>
</div>
</div>
</div>
</blockquote>
</div>
<br>
<br clear="all">
<div><br>
</div>
-- <br>
Best regards,<br>
Chaitanya kumar CH.<br>
<br>
+91-9494447584<br>
17.2416N 80.1426E
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
gdal-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/gdal-dev">http://lists.osgeo.org/mailman/listinfo/gdal-dev</a></pre>
</blockquote>
<br>
</body>
</html>