<div dir="ltr"><div>to follow up as I continue to work on this, <br></div><div><br></div><div>I mistakenly understood the attribute type "binary" as a Boolean, but I think it's in fact an arbitrary value stored as binary. That is to say, not necessarily True/False or 0/1 but a series of 0/1's storing a value.  <br></div><div><br></div><div>If I can save it to the shapefile that would be great but I'm going to work on filtering those attributes out of what's saved as that's an acceptable solution too I think. <br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Feb 3, 2023 at 2:24 PM Hugh Kelley <<a href="mailto:hghklly@gmail.com">hghklly@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Hi,</div><div><br>I'm attempting to use pyqgis to export a few things to shapefile. <br></div><div><br></div><div>the code below is working well except that a few of the attributes are incompatible with shapefiles (amazing) lack of a binary datatype. <br></div><div><br></div><div>```py<br></div><div>pathToFile = "C:/Users/hkelley/Downloads/test_exports/<br><br>layers = QgsProject.instance().mapLayers()<br><br>for layer_id, layer in layers.items():<br>    print(<a href="http://layer.name" target="_blank">layer.name</a>())<br>    QgsVectorFileWriter.writeAsVectorFormat( layer,  pathToFile+ <a href="http://layer.name" target="_blank">layer.name</a>() + ".shp", "utf-8", layer.crs(), driverName="ESRI Shapefile" )</div><div>```</div><div><br></div><div>I see in the manual export options that I can check a box telling the export process to use "Use Binary (BLOB)". Image linked below for clarity [0]<br></div><div><br></div><div>I haven't yet figured out how to pass that option to writeAsVectorFormat. <br></div><div><br></div><div>any suggestions?</div><div><br></div><div>Iv'e had a pretty thorough look through the docs for writeAsVctorFormat, is the solution related to 
QgsVectorFileWriter.BoolOption(QgsVectorFileWriter.BoolOption)?</div><div><br></div><div><br></div><div><br></div><div>[0] <a href="https://imgur.com/a/9zSMHKq" target="_blank">https://imgur.com/a/9zSMHKq</a></div><br>-- <br><div dir="ltr"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr">Hugh Kelley       <br><div><br></div></div></div></div></div></div></div></div></div>
</blockquote></div><br clear="all"><br>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr">Hugh Kelley       <br><div><br></div></div></div></div></div></div></div></div>