<div>Thanks a lot Martin, it works!</div>
<div> </div>
<div>Bye</div>
<div>Marcelo<br><br></div>
<div class="gmail_quote">On Sat, Mar 27, 2010 at 10:26 AM, Martin Dobias <span dir="ltr"><<a href="http://wonder.sk">wonder.sk</a>@<a href="http://gmail.com">gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div class="im">On Sat, Mar 27, 2010 at 6:23 AM, Marcelo Reyes <<a href="mailto:reyesmarcelo@gmail.com">reyesmarcelo@gmail.com</a>> wrote:<br>><br></div>
<div class="im">> Hello,<br>><br>> I'm trying to load a vector layer from a spatialite table. It is easy to do<br>> it in qgis using the tool bar option, but I want to do it programatically<br>> using the python bindings. This is because I'm developing a small stand<br>
> alone application.<br>><br>> Can any one show me an example of how to to this? I've found code with<br>> Postgis, but none with spatialite.<br><br></div>uri = QgsDataSourceURI()<br>uri.setDatabase('/home/martin/test-2.3.sqlite')<br>
uri.setDataSource('','Towns', 'Geometry')<br><br>v=QgsVectorLayer(uri.uri(), 'Towns', 'spatialite')<br><br>(don't forget to check v.isValid() to see whether the vector layer got<br>
loaded correctly)<br><br>Bye<br><font color="#888888">Martin<br></font></blockquote></div><br><br clear="all"><br>-- <br>Marcelo Reyes<br>Edif. Alborada Of. 605<br>Tel. 2201034<br>Cel. 72501267<br>La Paz Bolivia.<br>