<div dir="ltr">Hello,<div>I am having trouble utilizing the <span style="background-color:transparent;font-family:ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,"Liberation Mono",monospace;color:rgb(36,41,47);font-size:11.9px">QgsVectorFileWriter.create() method. I am not getting any errors but no layer is being created. I am trying to write a geopackage layer. I know my QgsFields are correct because I have used them for some other code previously. Should the driver name be "ogr" or "gpkg"? Is there any sort of commit statement that needs to happen after creation? Or is creation predicated upon adding features? The only example I can find is here: </span><a href="https://github.com/qgis/QGIS/issues/35021">https://github.com/qgis/QGIS/issues/35021</a>.</div><div><span style="background-color:transparent;font-family:ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,"Liberation Mono",monospace;color:rgb(36,41,47);font-size:11.9px"><br></span></div><div><div style="color:rgb(212,212,212);background-color:rgb(30,30,30);font-family:Consolas,"Courier New",monospace;font-size:16px;line-height:22px;white-space:pre"><div> <span style="color:rgb(156,220,254)">qgsFields</span> = <span style="color:rgb(78,201,176)">QgsFields</span>()</div><div>        <span style="color:rgb(156,220,254)">uploadLayerName</span> = <span style="color:rgb(86,156,214)">f</span><span style="color:rgb(206,145,120)">"</span><span style="color:rgb(86,156,214)">{</span><span style="color:rgb(156,220,254)">self</span>.<span style="color:rgb(156,220,254)">locationTypeText</span><span style="color:rgb(86,156,214)">}</span><span style="color:rgb(206,145,120)">-Upload-</span><span style="color:rgb(86,156,214)">{</span><span style="color:rgb(156,220,254)">self</span>.<span style="color:rgb(156,220,254)">layerDate</span><span style="color:rgb(86,156,214)">}</span><span style="color:rgb(206,145,120)">"</span></div><div>        <span style="color:rgb(197,134,192)">for</span> <span style="color:rgb(156,220,254)">fieldMap</span> <span style="color:rgb(197,134,192)">in</span> <span style="color:rgb(156,220,254)">self</span>.<span style="color:rgb(156,220,254)">fieldMaps</span>:</div><div>            <span style="color:rgb(156,220,254)">qgsFields</span>.<span style="color:rgb(220,220,170)">append</span>(</div><div>                <span style="color:rgb(78,201,176)">QgsField</span>(<span style="color:rgb(156,220,254)">fieldMap</span>.<span style="color:rgb(156,220,254)">location_type_param_name</span>, <span style="color:rgb(156,220,254)">fieldMap</span>.<span style="color:rgb(156,220,254)">qvariantType</span>))</div><div>        <span style="color:rgb(156,220,254)">options</span> = <span style="color:rgb(78,201,176)">QgsVectorFileWriter</span>.<span style="color:rgb(78,201,176)">SaveVectorOptions</span>()</div><div>        <span style="color:rgb(156,220,254)">options</span>.<span style="color:rgb(156,220,254)">driverName</span> = <span style="color:rgb(206,145,120)">"ogr"</span></div><div>        <span style="color:rgb(156,220,254)">options</span>.<span style="color:rgb(156,220,254)">layerName</span> = <span style="color:rgb(156,220,254)">uploadLayerName</span></div><div>        <span style="color:rgb(156,220,254)">uploadWriter</span> = <span style="color:rgb(78,201,176)">QgsVectorFileWriter</span>.<span style="color:rgb(220,220,170)">create</span>(<span style="color:rgb(86,156,214)">f</span><span style="color:rgb(206,145,120)">"</span><span style="color:rgb(86,156,214)">{</span><span style="color:rgb(79,193,255)">GPKG_PATH</span><span style="color:rgb(86,156,214)">}</span><span style="color:rgb(215,186,125)">\\</span><span style="color:rgb(86,156,214)">{</span><span style="color:rgb(156,220,254)">uploadLayerName</span><span style="color:rgb(86,156,214)">}</span><span style="color:rgb(206,145,120)">"</span>, <span style="color:rgb(156,220,254)">qgsFields</span>, <span style="color:rgb(156,220,254)">self</span>.<span style="color:rgb(156,220,254)">layerGeometry</span>, <span style="color:rgb(78,201,176)">QgsCoordinateReferenceSystem</span>(</div><div>            <span style="color:rgb(206,145,120)">"EPSG:4326"</span>),  <span style="color:rgb(79,193,255)">TRANSFORM_CONTEXT</span>, <span style="color:rgb(156,220,254)">options</span>)</div></div></div><div><span style="background-color:transparent;font-family:ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,"Liberation Mono",monospace;color:rgb(36,41,47);font-size:11.9px"></span><div><br></div><div><br></div><div>Thank you.</div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">
        <div><b>Arjun Dongre</b> </div>
        <div><b>
                </b></div>
        <div>
                 </div>
        <div>
                <img src="http://west-inc.com/images/westlogo.png"></div><div><span style="color:rgb(34,34,34);font-family:Arial;font-size:small;background-color:rgb(255,255,255)">Western EcoSystems Technology, Inc.</span><br><span style="color:rgb(34,34,34);font-family:Arial;font-size:small;background-color:rgb(255,255,255)">Environmental & Statistical Consultants</span><br><div style="color:rgb(34,34,34);font-family:Arial,Helvetica,sans-serif;font-size:small;background-color:rgb(255,255,255)"><font color="#333333" face="Arial" size="2"><span style="line-height:18.2px">415 W. 17th St. Suite 200</span></font></div><div style="color:rgb(34,34,34);font-family:Arial,Helvetica,sans-serif;font-size:small;background-color:rgb(255,255,255)"><font color="#333333" face="Arial" size="2"><span style="line-height:18.2px">Cheyenne, WY 82001</span></font></div></div><div></div><div><a href="mailto:adongre@west-inc.com" target="_blank">adongre@west-inc.com</a></div>
        <div>
                <a href="http://www.west-inc.com/" target="_blank">www.west-inc.com</a> </div>
        <div>
                <p>
                        <b><span style="font-size:10pt;font-family:Arial,sans-serif">Follow WEST: </span></b><span style="font-size:9pt;font-family:Arial,sans-serif;color:rgb(31,73,125)"><a href="http://www.facebook.com/pages/Western%E2%80%90EcoSystems%E2%80%90Technology%E2%80%90WESTInc/125604770807646" style="color:rgb(17,85,204)" target="_blank">Facebook</a>, <a href="http://twitter.com/WestEcoSystems" style="color:rgb(17,85,204)" target="_blank">Twitter</a>, <a href="http://www.linkedin.com/company/1458419" style="color:rgb(17,85,204)" target="_blank">Linked In</a>, <a href="http://visitor.r20.constantcontact.com/manage/optin/ea?v=001qrD4A3S5xJ5KgMyelH9jyw%3D%3D" style="color:rgb(17,85,204)" target="_blank">Join our Mailing list</a></span></p>
                <p>
                        <span style="font-size:8pt;font-family:Arial,sans-serif">CONFIDENTIALITY NOTICE:  This message and any accompanying communications are covered by the Electronic Communications Privacy Act, 18 U.S.C. §§ 2510-2521, and contain information that is privileged, confidential or otherwise protected from disclosure.  If you are not the intended recipient or an agent responsible for delivering the communication to the intended recipient, you are hereby notified that you have received this communication in error.  Dissemination, distribution or copying of this e-mail or the information herein by anyone other than the intended recipient, or an employee or agent responsible for delivering the message to the intended recipient, is prohibited.  If you have received this communication in error, please notify us immediately by e-mail and delete the original message.  Thank you.</span></p>
                <p>
                        <span style="font-size:14pt;font-family:Webdings;color:rgb(0,51,0)">P</span><span style="font-size:9pt;font-family:Verdana,sans-serif;color:rgb(0,51,0)"> </span><span style="font-size:9pt;font-family:Arial,sans-serif;color:rgb(0,51,0)">Please consider the environment before printing.</span></p>
        </div>
</div>
<br>
</div></div></div>