Hello,<br><br>I am triying to write apython plugin to qgis and I got 
<meta name="qrichtext" content="1"><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><style type="text/css">
p, li { white-space: pre-wrap; }
</style>
<p style="margin: 0px; text-indent: 0px;"><span style="color: rgb(255, 0, 0);">exceptions.AttributeError: vectorType error<span style="color: rgb(51, 0, 0);"> what may be the problem I couldn&#39;t find it. The feautre count turns value of 5 and I tried to check if my layer is valid or not. <br>
</span></span></p><p style="margin: 0px; text-indent: 0px;"><br><span style="color: rgb(255, 0, 0);"><span style="color: rgb(51, 0, 0);"></span></span></p><p style="margin: 0px; text-indent: 0px;"><span style="color: rgb(255, 0, 0);"><span style="color: rgb(51, 0, 0);">My code is below:</span></span></p>
<p style="margin: 0px; text-indent: 0px;"><br><span style="color: rgb(255, 0, 0);"><span style="color: rgb(51, 0, 0);"></span></span></p><p style="margin: 0px; text-indent: 0px;"><span style="color: rgb(255, 0, 0);"><span style="color: rgb(51, 0, 0);"><br>
    vlayer = QgsVectorLayer(&quot;/home/lutfi/Desktop/deneme/borders.shp&quot;, &quot;hebe&quot;, &quot;ogr&quot;)<br>     <br><br>    print vlayer.featureCount()<br>    <br>      <br>    if not vlayer.isValid():<br>      print &quot;Couldn&#39;t open the layer&quot;<br>
      <br>    else:<br>#    QMessageBox.information(None, &quot;Cancel&quot;, &quot;File selection canceled&quot;)<br>    <br>      provider = vlayer.dataProvider()<br>      feat = QgsFeature()<br>      allAttrs = provider.attributeIndexes()<br>
      provider.select(allAttrs)<br>    <br>      while provider.nextFeature(feat):<br>        geom = feat.geometry()<br>        print &quot;Feature ID %d: &quot; % <a href="http://feat.id">feat.id</a>()<br>        if geom.vectorType() == QGis.Point:<br>
          x = geom.asPoint()<br>          print &quot;Point: &quot; + str(x)<br><br>        elif geom.vectorType() == QGis.Line:<br><br>          x = geom.asPolyline()<br>          print &quot;Line: %d points&quot; % len(x)<br>
<br>        elif geom.vectorType() == QGis.Polygon:<br><br>          x = geom.asPolygon()<br>          numPts = 0<br>          for ring in x:<br>            numPts += len(ring)<br>            print &quot;Polygon: %d rings with %d points&quot; % (len(x), numPts)<br>
        else:<br>          print &quot;Unknown&quot;<br>        attrs = feat.attributeMap()<br><br>        for (k,attr) in attrs.iteritems():<br>           print &quot;%d: %s&quot; % (k, attr.toString())<br>      <br></span></span></p>