Bug report #20308

QGIS fails to copy all selected features to clipboard for large OSM datasets

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

Status:Closed
Priority:High
Assignee:Even Rouault
Category:Vectors
Affected QGIS version:3.4.0 Regression?:Yes
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:Yes Copied to github as #:28129

Description

(I'm not in a position to confirm that this is a regression from previous versions, but it could well be)

On QGIS 3.4, copying to clipboard a large number of selected features in a large OSM dataset layer fails. Instead of copying all features, only a few features are actually inserted into the clipboard (for e.g., out of 2,500 selected features, between 1-10 features are copied). If you try to copy selected features twice in a row, the second time will lead to QGIS freezing.

Steps to reproduce:
- Create a new project, and add the following OSM dataset (use the points layer): http://imhere-asia.com/pp.zip
- Select a large number of points
- Hit the copy button on QGIS' main toolbar
- Paste the copied features (either as new scratch layer, or in MS Excel/LO Calc), notice it'll be missing most features
- Hit the copy button on QGIS' main toolbar again, notice how QGIS freezes (you'll need to kill it)

Associated revisions

Revision 986e11b6
Added by Even Rouault almost 2 years ago

[BUGFIX] [OGR provider] Make filter by id(s) requests work again on OSM datasets (fixes #20308)

Revision 6d493580
Added by Even Rouault almost 2 years ago

Merge pull request #8397 from rouault/fix_20308

[BUGFIX] [OGR provider] Make filter by id(s) requests work again on OSM datasets (fixes #20308)

Revision bf3e96cf
Added by Even Rouault almost 2 years ago

[BUGFIX] [OGR provider] Make filter by id(s) requests work again on OSM datasets (fixes #20308)

History

#2 Updated by Even Rouault almost 2 years ago

  • % Done changed from 0 to 100
  • Status changed from Open to Closed

#3 Updated by Even Rouault almost 2 years ago

  • Regression? changed from No to Yes

#4 Updated by Giovanni Manghi almost 2 years ago

I have noticed that opening the table of attributes it only shows 99 rows, is this a consequence of this bug?

#5 Updated by Even Rouault almost 2 years ago

Giovanni Manghi wrote:

I have noticed that opening the table of attributes it only shows 99 rows, is this a consequence of this bug?

No, this is a different issue. A quick investigation shows that it is due to {{{

void QgsVectorLayerCache::setFullCache( bool fullCache ) {
mFullCache = fullCache;

if ( mFullCache )
{
// Add a little more than necessary...
setCacheSize( mLayer->featureCount() + 100 );
}}}

In the case of a OSM layer,mLayer->featureCount() returns -1 to indicate that the feature count is unknown, hence -1+100 = 99. I'm not familiar enough with this piece of code to fix that quickly

#6 Updated by Giovanni Manghi almost 2 years ago

Even Rouault wrote:

Giovanni Manghi wrote:

I have noticed that opening the table of attributes it only shows 99 rows, is this a consequence of this bug?

No, this is a different issue.

thanks for the explanation, I filed a different ticket.

Also available in: Atom PDF