Hi all,<br><br>Im new qgis and gis in general so sorry for the newbie question.<br><br>im currently having a problem with adding attributes to the vector layor.<br><br>Im using qgis 0.9.1 development libraries and creating my own application using Open Suse 10.3. I was following Tim Sutton tutorial 6 to implement this but have noticed that QgsFeatureAttribute class has been removed from the 0.9.1 release.<br>
<br>I have changed the the tutorial code:<br><pre><i> while ((mypFeature = mypProvider->getNextFeature</i><i>(true)))<br> {<br> //get the attributes of this feature<br> const std::vector < QgsFeatureAttribute >& myAttributes = mypFeature->attributeMap();<br>
<br> for (int i = 0; i < myAttributes.size(); i++)</i>
</pre><br>with the following:<br><br><i><font size="1"> //now iterate through each feature<br> while (mypProvider->getNextFeature(mypFeature))<br> {<br> //get the attributes of this feature<br> // const std::vector < QgsFeatureAttribute >& myAttributes = mypFeature->attributeMap();<br>
const QgsAttributeMap& myAttributes = mypFeature.attributeMap();<br><br> if( myAttributes.isEmpty() ) cout << "attribute map is empty " << endl;</font></i><br> <br><br>Iv tried replacing the QgsFeatureAttribute with the QgsAttributeMap, but when calling the attributeMap() function i do not seem to be pulling in the attribute data.<br>
<br>Is this a problem with the shapefile datastore. (i.e. i am using the same source shapefile data that was used for Tim's tutorial 6)<br><br>thanks in advance,<br><br>nlev.<br><br>