Bug report #20308
QGIS fails to copy all selected features to clipboard for large OSM datasets
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
[BUGFIX] [OGR provider] Make filter by id(s) requests work again on OSM datasets (fixes #20308)
Merge pull request #8397 from rouault/fix_20308
[BUGFIX] [OGR provider] Make filter by id(s) requests work again on OSM datasets (fixes #20308)
[BUGFIX] [OGR provider] Make filter by id(s) requests work again on OSM datasets (fixes #20308)
History
#1 Updated by Even Rouault almost 6 years ago
#2 Updated by Even Rouault almost 6 years ago
- % Done changed from 0 to 100
- Status changed from Open to Closed
Applied in changeset qgis|986e11b6bbd7ad529b90ad58f5b3093bb5ed69bd.
#3 Updated by Even Rouault almost 6 years ago
- Regression? changed from No to Yes
#4 Updated by Giovanni Manghi almost 6 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 6 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 6 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.