2

At QGIS 2.18.16, I have a Geopackage point layer with a selection subset. I need to write the selected records to the same Geopackage as a new layer, with a new name.

When I attempt to Save As... the new layer, QGIS responds with this error:

enter image description here

It appears that QGIS thinks that I'm trying to overwrite the original layer, when I'm actually trying to create a new layer that is a subset of the original.

Interestingly, the same error occurs if I attempt the same with a File Geodatabase; that is, I try to write a subset of records as a new Feature Class to the original FGDB.

A Google search turned up the same error, but in that case the user was trying to overwrite the source layer.

I expect that QGIS should be able to write a subset of a layer's records to the source Geopackage or File Geodatabase under a new name. How can I accomplish this without the error?

As a workaround, I can write the subset to a different Geopackage (or FGDB), and then copy that to the original Geopackage (or FGDB).

  • seems pedantic, but...I'm missing a question mark? ,) however, I woudn't know if this is expected behaviour or maybe a bug even... – ThingumaBob Apr 29 '18 at 9:44
  • Fair enough, OP edited to include a specific question. – Stu Smith Apr 29 '18 at 14:50
  • I made a successful trial with QGIS 3.0.1. – user30184 Apr 29 '18 at 20:00
  • @user30184 I was excited to see your success at 3.0.1, so I tried it at 3.0.2 (Windows 7, 64-bit OSGEO install) and still have the same error. In my OP (now updated) I forgot to mention that I was using Save As... Is this how you are successfully saving your subset selection, or some other technique? – Stu Smith Apr 29 '18 at 22:53
1

I had success with QGIS 3.0.1 this way:

  • Open a layer from .gpkg database
  • Select some features
  • Edit - Copy Features
  • Edit - Paste Features as.. New Vector Layer

Use an existing .gpkg as a target file but give a new name for the target layer

enter image description here

The new layer is created into the existing GeoPackage

enter image description here

  • Worked in version 3.0.2 (Linux) – Fausto Isolan Apr 30 '18 at 13:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.