[Qgis-developer] QGIS 1.8 shows only last record of a delimited text imported layer

Rafael Varela Pet rafael.varela at gmail.com
Tue Apr 2 12:19:24 PDT 2013


2013/3/21 Rafael Varela Pet <rafael.varela at gmail.com> wrote:

> I'm experiencing problems running the following script in QGIS 1.8:
>
>
> ---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---
>
> from qgis.core import *
> from PyQt4.QtCore import *
>
> inFileName="/tmp/test.csv"
>
> url = QUrl.fromLocalFile( inFileName )
>
> capaImportada = QgsVectorLayer( QString.fromAscii( url.toEncoded() ),
> "testLayer", "delimitedtext" )
>
> pr=capaImportada.dataProvider()
> pr.featureCount()
>
> QgsMapLayerRegistry.instance().addMapLayers( [capaImportada] )
>
>
> ---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---
>
>
> In QGIS 1.8, pr.featureCount() shows the correct number of features (7L) but the
> feature table always shows only the last record. The layer metadata also
> seems correct. Tha same happens both in Windows or Debian.


Finally, although master does not seem to suffer this problem, I
decided to file a ticket, just in case someone hits the same problem

http://hub.qgis.org/issues/7493


Best regards,
-- 
Rafael Varela


More information about the Qgis-developer mailing list