Questions tagged [writers]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
2 votes
1 answer

"DeprecationWarning: QgsVectorFileWriter.writeAsVectorFormat() is deprecated" when exporting GeoJSON in QGIS

I am trying to export a layer same to like this question: But the difference is I'd like to do it in PyQGIS with QgsVectorFileWriter. Is there a way to ...
Ali Güvenaltın's user avatar
0 votes
0 answers

writeAsVectorFormatV3 on MacOS with filename on server returns OGR error

I am on MacOS and working with Samba connected server. I have write rights on it but when I try to export a QgsVectorLayer from a delimited text file with : layer = QgsVectorLayer("file:///path/...
dmjf08's user avatar
  • 1,097
1 vote
1 answer

Shapefile from selected features in PyQGIS

I am trying to develop a plugin to export selected features from a layer as shapefile. I have a comboBox from which I can select features. After selecting features in comboBox, I tried following code ...
rahul's user avatar
  • 19
1 vote
1 answer

QGIS crashed when QgsVectorFileWriter.FieldValueConverter() was used as fieldValueConverter option

I want to export the PostGIS layer as a shapefile. I need to use replace all selected raw field values with displayed values in QGIS. To do so, I follow PyQGIS Export table with Replace all selected ...
Mohammad Hosseingholizadeh's user avatar
1 vote
2 answers

'Opening of data source in update mode failed (OGR error: )' error when adding layer to GeoPackage using PyQGIS

While running the following code: from qgis.utils import iface from qgis.core import QgsVectorFileWriter canvas = iface.mapCanvas() layer = canvas.currentLayer() print( options = ...
Ilyasse Hanafi's user avatar
2 votes
1 answer

Creating GeoPackage file with one layer (or more) named different from file name using PyQGIS [duplicate]

I want to create geopackage file using PyQGIS (for example database.gpkg) with one layer (named "myLayer"). I've tried this from qgis.core import QgsVectorFileWriter writer = ...
BlackTesta's user avatar
7 votes
2 answers

Saving temporary layer to shapefile using PyQGIS

I'm attempting to save a polygon created in a scratch layer to a shapefile. The Python code below is a simplified example. Note the questions: Saving layer as shapefile using PyQGIS and Setting ...
user2627043's user avatar
7 votes
2 answers

FME dynamic filename

With FME Desktop I'd like to write a text file with a dynamic filename, consisting of the date of today and a guid. I know how to create both parameters (date and guid), but I don't understand how to ...
Maja Ott's user avatar
  • 425
7 votes
0 answers

Writing layer to GeoPackage using PyQGIS

I have a PyQGIS script which carries out a number of operations on layers and writes the results to shapefiles. However, I understand that GeoPackages have a number of advantages (not having multiple ...
Stephen Poley's user avatar
3 votes
0 answers

FME: How can I use File Copy Writer to periodically copy new data within my project folders to a server?

All I want to do is copy a set of folders (and sub-folders) under a 'Projects' master folder on my laptop to the server. I want to automate this so it runs every hour or two and only copies new files ...
wunderkind's user avatar
7 votes
1 answer

Setting QgsVectorFileWriter.SaveVectorOptions for QGIS 3

I wrote a processing scrip for QGIS 2.18 to create a multi-distance buffer rings using the haversine formula. Unfortunately, it no longer works after I updated to QGIS 3.4.5. I've tried updating the ...
sjp_1989's user avatar
  • 569
9 votes
1 answer

Saving layer as shapefile using PyQGIS

Using QGIS 3.4.4, I'm trying to save a layer as shapefile with the following code: import os import qgis.core working_folder = r'C:\myFolder' fc_Prospect = os.path.join(working_folder, Equipment.gdb|...
Pitrako Junior's user avatar
5 votes
1 answer

Naming layers for saving in GeoPackages programmatically with PyQGIS [duplicate]

I have problems to save a vector layer at QGIS 3.0 with his original name in a GeoPackage. from qgis.utils import iface from qgis.core import QgsVectorFileWriter canvas = iface.mapCanvas() layer = ...
RickJames's user avatar
  • 179
14 votes
4 answers

Adding layer to GeoPackage using PyQGIS

How to add layers (vector or raster to an existing GeoPackage)? While loading an existing layer of a GeoPackage is quite trivial: from qgis.utils import iface path = '/home/matteo/geopackage.gpkg|...
matteo's user avatar
  • 3,274