Bug report #8939
Atlas Feature Sorting
|Affected QGIS version:
|Pull Request or Patch supplied:
|Crashes QGIS or corrupts data:
|Copied to github as #:
I am using the "Atlas generation" feature of the QGIS print composer. It seems that the "Feature sorting" value is not remembered when a QGIS file is closed and re-opened. For example, if I sort by a field, "page_name", the PDF pages are correctly ordered by this field when I export them; however, if I close and re-open the document the print composer will return to using the first field as the sort field and the pages in the PDF will be exported in a seemingly random order.
From my limited knowledge of how QGIS works, I suspect the sort order is being saved, but is not being read when QGIS is re-opened. I tested this by opening the .qgs file in a text editor and it seems that the sortKey field is, in fact, saved in the document (for example, if "page_name" was the fifth column, there will be a value of sortKey=4 in the .qgs file). The problem seems to be that this field is not read when a document is re-opened (e.g. it just goes back to using sortKey=0).