4

Yes, really. I generate an atlas with a coverage layer with 883 features, and the combo box from which to select the current preview list only the first 499 features as shown in the screenshot below (tested this with a variety of other big coverage layers):

enter image description here

Nevertheless, the higher numbers are accessible as well. I can select the higher numbers by going to #499 and clicking Next Feature button or go to the Last Feature and clicking Previous Feature, but then I see only the feature number without the page name:

enter image description here

Furthermore when I want, let's say, no. 700 I have to click next or previous about 200 times. That's somehow inconvenient.

I observerved this in QGIS 2.14.15 LTR as well as the latest 2.18.14 LTR, so isn't there anybody before me having more than 499 coverage features?!

It's definitly not due to Qt, where combos with 1000's of items a no problem, the author must have set explicitly the_combo.setMaxCount(499) somewhere, but why (cp. http://doc.qt.io/qt-5/qcombobox.html#maxCount-prop)?

Question before raising an issue: Are there any technical or practical reasons for such limitation, or do I miss a setting somewhere?

5
  • check this line github.com/qgis/QGIS/blob/release-2_18/src/app/composer/…
    – Fran Raga
    Commented Dec 13, 2017 at 12:00
  • 2
    I'm voting to close this question as off-topic because it should be a bug report rather than a question on StackExchange.
    – underdark
    Commented Dec 13, 2017 at 17:46
  • @underdark Don't agree. The question is wether or not it is a bug, if the author explicitly implemented this the way it is. Anyway, a bug would be something not intended by the author, I think. Shouldn't we clarify the reason for this implementation before raising a bug report? Commented Dec 13, 2017 at 17:56
  • 2
    It's unlikely that the author is checking GIS.SE on a regular basis. If the ticket is deemed invalid, it will be closed in the bug tracker. I can reopen but most answers will be pure speculation
    – underdark
    Commented Dec 13, 2017 at 17:58
  • issues.qgis.org/issues/17689 Commented Dec 13, 2017 at 18:38

2 Answers 2

4

If show the QGIS code you can found this limitation.

void QgsComposer::updateAtlasPageComboBox( int pageCount )
{
  if ( !mComposition )
    return;

  mAtlasPageComboBox->blockSignals( true );
  mAtlasPageComboBox->clear();
  for ( int i = 1; i <= pageCount && i < 500; ++i )
  {
    QString name = mComposition->atlasComposition().nameForPage( i - 1 );
    QString fullName = ( !name.isEmpty() ? QString( "%1: %2" ).arg( i ).arg( name ) : QString::number( i ) );

    mAtlasPageComboBox->addItem( fullName, i );
    mAtlasPageComboBox->setItemData( i - 1, name, Qt::UserRole + 1 );
    mAtlasPageComboBox->setItemData( i - 1, fullName, Qt::UserRole + 2 );
  }
  mAtlasPageComboBox->blockSignals( false );
}

the Important line is for ( int i = 1; i <= pageCount && i < 500; ++i )

https://github.com/qgis/QGIS/blob/release-2_18/src/app/composer/qgscomposer.cpp#L1056

and the answer to the next feature button working is because this call to nextFeature() method :

https://github.com/qgis/QGIS/blob/release-2_18/src/core/composer/qgsatlascomposition.cpp#L337

and emits a signal emit featureChanged( &mCurrentFeature ); , this signal is received by void QgsComposer::atlasFeatureChanged( QgsFeature *feature )

https://github.com/qgis/QGIS/blob/release-2_18/src/app/composer/qgscomposer.cpp#L1068

And put the new feature value :

 mAtlasPageComboBox->setCurrentIndex( mComposition->atlasComposition().currentFeatureNumber() );

without taking into account the initial limitation

it's a strange way of putting it I think

2

I have the same issue. I cannot see more than 499 feature in the atlas preview combo box. I have a polygon shapefile composed of 539 polygons, and yes, only 499 I can see:

enter image description here

As a workaround and in order to see the atlas page number along with the name you can insert a text box and write the following expression:

 @atlas_featurenumber || ': ' || Field_NAME    # Field_NAME is the field that contains the name of each polygon

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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