[Qgis-developer] The first column in the attribute table

Matthias Kuhn matthias at opengis.ch
Fri Jun 17 10:15:35 PDT 2016



On 17/06/16 12:15, Tom Chadwin wrote:
>
>     Matthias Kuhn-2 wrote
>     Are you working with an attribute table (or an attribute table
>     model) there?
>
> Yes. This code takes categorized 2.5d render roof colours, wall
> colours, and heights, and adds them as fields into cleanedLayer, which
> is GeoJSON from |writeAsVectorFormat()|:
>
That's not involving QgsAttributeTableModel, so this seems to be a
different issue.

In your case, it's dangerous to use the feature ids from one layer and
assume that they match on another layer. You will have to find a common
attribute (primary key) or (I guess you create one of the two layers in
your script) copy the source feature id to the copied layer.

Matthias
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20160617/17b8a375/attachment.html>


More information about the Qgis-developer mailing list