Questions tagged [writers]
The writers tag has no usage guidance.
14
questions
2
votes
1
answer
699
views
"DeprecationWarning: QgsVectorFileWriter.writeAsVectorFormat() is deprecated" when exporting GeoJSON in QGIS
I am trying to export a layer same to like this question: https://gis.stackexchange.com/a/435753/215676
But the difference is I'd like to do it in PyQGIS with QgsVectorFileWriter. Is there a way to ...
0
votes
0
answers
42
views
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/...
1
vote
1
answer
152
views
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 ...
1
vote
1
answer
145
views
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 ...
1
vote
2
answers
764
views
'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(layer.name())
options = ...
2
votes
1
answer
258
views
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 = ...
7
votes
2
answers
2k
views
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 ...
7
votes
2
answers
2k
views
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 ...
7
votes
0
answers
595
views
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 ...
3
votes
0
answers
2k
views
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 ...
7
votes
1
answer
5k
views
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 ...
9
votes
1
answer
7k
views
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|...
5
votes
1
answer
1k
views
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 = ...
14
votes
4
answers
9k
views
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|...