<div dir="ltr"><div>Hi,</div><div><br></div><div>You should run the following considering you selected a vector layer<br></div><div></div><div><br></div><div>from qgis.core import QgsVectorFileWriter<br><br>layer = iface.activeLayer()<br>QgsVectorFileWriter.writeAsVectorFormat(layer, '/tmp/out.geojson', 'utf-8', layer.crs(), 'GeoJSON', layerOptions=['RFC7946=True'])</div><div><br></div><div>Regards</div><div><br></div><div>Thomas Gratier<br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le mer. 25 nov. 2020 à 18:47, PALMIER Patrick (Responsable de groupe) - CEREMA/DTerNP/DATHa/MT <<a href="mailto:Patrick.Palmier@cerema.fr">Patrick.Palmier@cerema.fr</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hello,<br>
<br>
I'm using Qgis 3.14.16 with WIndows 10<br>
<br>
I'm trying in a python script to export a layer in geojSon with the <br>
option RFC7946=True<br>
It works well with the gui, but I don't know how to write it in a python <br>
script<br>
Is there someone who could send me a sample of code which do this<br>
<br>
<br>
Thanks<br>
<br>
<br>
Patrick<br>
<br>
_______________________________________________<br>
QGIS-Developer mailing list<br>
<a href="mailto:QGIS-Developer@lists.osgeo.org" target="_blank">QGIS-Developer@lists.osgeo.org</a><br>
List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
</blockquote></div>