<div dir="ltr"><div dir="ltr">On Mon, Feb 11, 2019 at 5:53 PM Even Rouault <<a href="mailto:even.rouault@spatialys.com">even.rouault@spatialys.com</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">What you can do (until OGR becomes smarter at a later point...) is:<br>
SetAttributeFilter("0 = 1")<br>
GetNextFeature()<br>
<br>
This will iterate over all the features and build the index.<br></blockquote><div><br></div><div>Excellent</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">> <br>
> Also, are DataSource objects thread safe, can one perform multiple reads in<br>
> parallel over them?<br>
<br>
No, an object should never be used by more than one thread at a time.<br></blockquote><div><br></div><div>So each thread needs to build its own DataSource and associated in memory spatial index,</div><div>and keep them alive for as possible in order to reuse the index?</div><div>Sorry for all these questions, trying to figure out if there is a way to keep the index alive </div><div>long enough to be useful in an application like GeoServer, where each thread serves one request</div><div>in a stateless manner. I'm guessing maybe one would have to setup some sort of DataSource</div><div>pooling, not unlike a connection pool for databases.</div><div>Are there other file formats that would benefit from such a thing?</div><div><br></div><div>Cheers</div><div>Andrea</div><div><span style="font-size:14.6667px;white-space:pre-wrap;font-family:Arial"><br></span></div><div><span style="font-size:14.6667px;white-space:pre-wrap;font-family:Arial">==</span><br></div></div><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><span><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><font face="Arial"><span style="font-size:14.6667px;white-space:pre-wrap">GeoServer Professional Services from the experts! Visit <a href="http://goo.gl/it488V" target="_blank">http://goo.gl/it488V</a> for more information.
==

Ing. Andrea Aime 
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via di Montramito 3/A
55054  Massarosa (LU)
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39  339 8844549

<a href="http://www.geo-solutions.it" target="_blank">http://www.geo-solutions.it</a>
<a href="http://twitter.com/geosolutions_it" target="_blank">http://twitter.com/geosolutions_it</a>


-------------------------------------------------------

<i>Con riferimento alla normativa sul trattamento dei dati personali (Reg. UE 2016/679 - Regolamento generale sulla protezione dei dati “GDPR”), si precisa che ogni circostanza inerente alla presente email (il suo contenuto, gli eventuali allegati, etc.) è un dato la cui conoscenza è riservata al/i solo/i destinatario/i indicati dallo scrivente. Se il messaggio Le è giunto per errore, è tenuta/o a cancellarlo, ogni altra operazione è illecita. Le sarei comunque grato se potesse darmene notizia.

This email is intended only for the person or entity to which it is addressed and may contain information that is privileged, confidential or otherwise protected from disclosure. We remind that - as provided by European Regulation 2016/679 “GDPR” - copying, dissemination or use of this e-mail or the information herein by anyone other than the intended recipient is prohibited. If you have received this email by mistake, please notify us immediately by telephone or e-mail.</i>
</span></font></p></span></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div>