Bug report #10672

regression: impossible to paste polygon into newly created shapefile

Added by Mathieu Pellerin - nIRV almost 10 years ago. Updated almost 10 years ago.

Status:Closed
Priority:Severe/Regression
Assignee:Denis Rouzaud
Category:Vectors
Affected QGIS version:master Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:19071

Description

Steps to reproduce:
  1. Create a new project, and add the attached polygon shapefiles (provinces.shp and rcaf_regions.shp)
  2. Turn rcaf_regions layer's edit mode on.
  3. On the provinces layer, select the polygon with PROV_NAME equating 'Kampong Thom' (it's the middle one to the right of the inner empty space)
  4. Copy the polygon
  5. Try and paste the polygon onto the rcaf_region layer, it will reject with the following message bar: "no features could be successfully pasted"

This is highly problematic, and works perfectly fine under QGIS 2.2.

rcaf_regions.zip (1.57 KB) Mathieu Pellerin - nIRV, 2014-06-23 02:29 AM

provinces.zip (1.13 MB) Mathieu Pellerin - nIRV, 2014-06-23 02:29 AM

pasteshape.zip - single zip with project (1.13 MB) Denis Rouzaud, 2014-06-23 07:01 AM


Related issues

Related to QGIS Application - Bug report #16758: regression: adding a multi-part feature to a shapefile da... Closed 2017-06-27

Associated revisions

Revision be032f72
Added by Denis Rouzaud almost 10 years ago

fix #10672: force multi when pasting on a shapefile

Revision 39eaff90
Added by Martin Dobias almost 10 years ago

Merge pull request #1483 from 3nids/pasteshape

fix #10672: force multi when pasting on a shapefile

Revision 8289891b
Added by Jürgen Fischer almost 9 years ago

Move information about strict provider geometry type check on point shapefiles
to OGR provider and make use of it when pasting & merging features
(fixes #12488, refs #10672, refs #10747)

TODO: check if other OGR drivers have similar restrictions.

Revision ce99b8ef
Added by Jürgen Fischer almost 9 years ago

Move information about strict provider geometry type check on point shapefiles
to OGR provider and make use of it when pasting & merging features
(fixes #12488, refs #10672, refs #10747)

TODO: check if other OGR drivers have similar restrictions.
(cherry picked from commit 8289891b78953581f22e944565e0e1c9678a09c3)

History

#1 Updated by Mathieu Pellerin - nIRV almost 10 years ago

I should have added that most polygons can be pasted onto the rcaf_region layer, but the provinces polygon named 'Kampong Thom' fails.

#2 Updated by Denis Rouzaud almost 10 years ago

  • Assignee set to Denis Rouzaud

#3 Updated by Denis Rouzaud almost 10 years ago

The problem is that the feature is multipart but the destination layer is known as single part, so nothing can be paste.
I believe the problem is that shapefiles should always (?) be considered as multipart.

I am not sure where to handle this.

in QGisApp::editPaste: if layer is shape, force multi in conversion?

#5 Updated by Pedro Venâncio almost 10 years ago

I confirm this also with lines / multilines.

Waiting for Denis PR be accepted and merged.

Thanks Denis!

#6 Updated by Martin Dobias almost 10 years ago

  • Status changed from Open to Closed

#7 Updated by Jürgen Fischer almost 7 years ago

  • Related to Bug report #16758: regression: adding a multi-part feature to a shapefile dataset fails added

Also available in: Atom PDF