<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<br>
<br>
<div class="moz-cite-prefix">On 17/06/16 12:15, Tom Chadwin wrote:<br>
</div>
<blockquote cite="mid:1466158518341-5272186.post@n6.nabble.com"
type="cite">
<blockquote style="border-left:2px solid #CCCCCC;padding:0 1em"
class="quote dark-border-color">
<div class="quote light-border-color">
<div class="quote-author" style="font-weight: bold;">Matthias
Kuhn-2 wrote</div>
<div class="quote-message">
Are you working with an attribute table (or an attribute
table model) there?
</div>
</div>
</blockquote>
<p>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 <code>writeAsVectorFormat()</code>:</p>
</blockquote>
That's not involving QgsAttributeTableModel, so this seems to be a
different issue.<br>
<br>
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.<br>
<br>
Matthias<br>
</body>
</html>