<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Verdana;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-GB" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Ah that’s fine thank you Andreas and Even.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Calibri","sans-serif";color:#BFBFBF">Chris</span></b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:black"><o:p></o:p></span></p>
</div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> Qgis-user [mailto:qgis-user-bounces@lists.osgeo.org]
<b>On Behalf Of </b>Neumann, Andreas<br>
<b>Sent:</b> 19 October 2016 13:55<br>
<b>To:</b> Even Rouault<br>
<b>Cc:</b> qgis-user@lists.osgeo.org<br>
<b>Subject:</b> Re: [Qgis-user] Split features using Geopackage layer?<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p><span style="font-size:10.0pt;font-family:"Verdana","sans-serif"">As far as I know, Nyall Dawson is currently working on fixing this, as part of his work on unique value constraints (provider provided or qgis provided where the provider doesn't support it).
 But not sure about the details. Certainly, PostgreSQL and Geopackage are top priorities for that. And his work targets QGIS 3.x, not for 2.x<o:p></o:p></span></p>
<p><span style="font-size:10.0pt;font-family:"Verdana","sans-serif"">Greetings,<o:p></o:p></span></p>
<p><span style="font-size:10.0pt;font-family:"Verdana","sans-serif"">Andreas<o:p></o:p></span></p>
<p><span style="font-size:10.0pt;font-family:"Verdana","sans-serif""> <o:p></o:p></span></p>
<p><span style="font-size:10.0pt;font-family:"Verdana","sans-serif"">On 2016-10-19 14:43, Even Rouault wrote:<o:p></o:p></span></p>
<blockquote style="border:none;border-left:solid #1010FF 1.5pt;padding:0cm 0cm 0cm 5.0pt;margin-left:0cm;margin-right:0cm">
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New"">Le mercredi 19 octobre 2016 14:14:40, Chris Buckmaster a écrit :
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New"">Hi<br>
<br>
I have a geopackage polygon layer and I am trying to split a simple feature<br>
within it.<br>
<br>
When I try to do it, I get an error message 'failed to insert, UNIQUE<br>
constraint failed'.<br>
<br>
Is this a known issue with splitting features using the geopackage format,<br>
it could it be how the layer is set up?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New""><br>
No, it is due to the fact that when splitting the feature, the newly created <br>
feature receives the same 'fid' value (the first column in the attribute table) <br>
as the other part, and that when creating the feature, the fid, when set, is <br>
honoured. Hence given the duplication of fid, the failure. Before saving the <br>
edits, you can manually unset the fid.<br>
<br>
Although something should probably be done either in the splitting tool to <br>
unset the fid column of the new feature. Or perhaps the provider could be made <br>
more tolerant in the case of duplicated FID to assign a new one.<br>
<br>
This could happen for other formats handled by OGR like spatialite (if not <br>
going throug the QGIS spatialite provider), FileGDB, etc...<br>
<br>
Would probably deserve a ticket in the bug tracker.<br>
<br>
Even<o:p></o:p></span></p>
</div>
</blockquote>
<p><span style="font-size:10.0pt;font-family:"Verdana","sans-serif""> <o:p></o:p></span></p>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana","sans-serif""> <o:p></o:p></span></p>
</div>
</div>
</body>
</html>