Hi German,
> that's right Andrea. It actually depends on whether you want to append
> features to an existing layer, or to "append" (one could also say "create")
> a layer (in)to an existing GPKG database. The latter case is well covered
> by Anne's answer.
>
> See prior messages in this thread:
Hi all,
that's right Andrea. It actually depends on whether you want to append
features to an existing layer, or to "append" (one could also say "create")
a layer (in)to an existing GPKG database. The latter case is well covered
by Anne's answer.
See prior messages in this thread:
Hi, from what I saw in the docs, you should be able to append to layers
with the filewriter option AppendToLayerNoNewFields?
The CreateOrOverwriteLayer overwrites the layer completely.
Cheers,
Andrea
On Wed, Apr 26, 2023 at 2:58 PM Anne B. Nilsen via QGIS-User <
qgis-user@lists.osgeo.org>
Sorry, an error in the code in the previous answer.
Correct code is (writer should be without indentation):
...
def create_blank_gpkg_layer(gpkg_path: str, layer_name: str, geometry: int,
crs: str, fields: QgsFields, append: bool = False
) ->
I'm not a pyQGIS-expert, but with help from gis.stackechange.com I have managed
to create an empty geopackage file and then adding several layers to it with
this code:
...
gpkg_reg = "karplanteregistrering.gpkg" # the NEW gpkg to be
created
if os.path.exists(gpkg_reg):
Hi dev and users
I don't understand how to append an existing gpkg layer with pyqgis.
I've tried many QgsVectorFileWriter options
self.options.actionOnExistingFile = QgsVectorFileWriter.CreateOrOverwriteLayer
reset final layer
And
self.options.EditionCapability =