dimanche 30 novembre 2014

PyQGIS export to JSON: writeAsVectorFormat and precission


In my QGIS plugin qgis2leaf I am exporting all layers as JSON into a JSON directory. Therefore I would like to enable the user to define the precision in the GUI. The normal "save as" dialogue in QGIS has the possibility to define the precision:


GEOJSON export with the save as dialogue


Is there any possibility to use a precision in the writeAsVectorFormat? The found documentation gives me no clue:



QgsVectorFileWriter::WriterError QgsVectorFileWriter::writeAsVectorFormat ( QgsVectorLayer * layer,
const QString & fileName,
const QString & fileEncoding,
const QgsCoordinateReferenceSystem * destCRS,
const QString & driverName = "ESRI Shapefile",
bool onlySelected = false,
QString * errorMessage = 0,
const QStringList & datasourceOptions = QStringList(),
const QStringList & layerOptions = QStringList(),
bool skipAttributeCreation = false,
QString * newFilename = 0
) [static]




Aucun commentaire:

Enregistrer un commentaire