I am working on an atlas project in qgis 3 that is basically roads, towns, and other features for a quite large area. What I would like to add, is an index of all the towns in the atlas area with at least the page number, if not also a grid coordinate. My towns are all in a single layer, so I'd like to use that for my data.

Is there any way besides doing it manually? I can't seem to find any documentation or examples that would show how to do it.

  • Is there a page number associated with each city in the attributes table?
    – ddomizia
    Commented May 20, 2020 at 13:38
  • No there isn't. Commented May 20, 2020 at 13:41
  • I think it is not possible to avoid the manual entry of the page number in this case. Surely if you have the names of all the cities in a single layer you can automatically insert those by categorizing the layer based on the attribute table field where the cities are inserted. If it's enough, I can show you the procedure for doing this.
    – ddomizia
    Commented May 20, 2020 at 13:54
  • That might be helpful. I would be working with 2 layers. My Town layer is where all the town features are, and I have a grid layer, that is what I'm using for the atlas coverage layer. That is basically just a layer of rectangles covering my entire map area. If I could at least get the towns indexed by that layer, it would be a huge improvement. Commented May 20, 2020 at 14:04
  • 2
    Also, Why is this closed as duplicate? The other question is unrelated. Commented May 20, 2020 at 14:06

1 Answer 1


Update: there's now a better solution to this, see here: QGIS expression to access page-number of atlas for certain features

Just an idea for a partial workaround so that you don't have to do everything manually: insert on your atlas sheet an attribute table and list there the names of the towns (no. 1 in the screenshot below).In the feature properties of the table select the object filtering tab and activate the checkbox "Show only features visible on the map" (2). Add an additional attribute to the table in the print composer (3), this time a custon defined, based on the variable @atlas_featernumber - manually (3a) or in the expression editor (3b) - this should correspond to the page-no. If you navigate from page to page in the atlas, the variable will be printed as the no. of the current feature.

So if your first page in the print layout contains the map that generates the atlas, the variable is identical with the page-no. (otherwise add the amount of additional pages to the expression generating your manually created attribute in the edior, 3b). By this, you get for each atlas page a list of the towns showed on this page and in a second row the page-no (4). Copy all the lists and paste them together and you have your index.

To sort the list alphabetically, add a definition in the attributes dialogue window (underneath of 3a).

There might be a better solution based on the expression intersects( $geometry , @atlas_geometry ) - thus creating a statement based on the question if the geometry of a town lies within (intersects) with the grid of your polyon-layer that generates the atlas-pages - however right now I don't know to implement the page-no. with this on a separate (empty) page to create a completely automatic index.

enter image description here

  • Thanks. I'll look into that as soon as I get a chance. Even if it is a bit of work that's fine. I just didn't want to try to manually do a list with potentially several hundred features. Commented May 20, 2020 at 19:46
  • I tried that out. It did work kind of. I still can't copy from an attribute table to something else, so at this point it still leaves me manually entering everything Commented May 22, 2020 at 0:09
  • I ended up exporting my atlas with only the attribute table showing, and then i could copy it off each page from the pdf. Commented May 22, 2020 at 2:04
  • Nice to hear that you managed to achieve what you wanted. However, I guess there is a better solution to this problem and that's a more general question that will appear again. That's why I posted the question in a modified form again, see: gis.stackexchange.com/questions/362615/…
    – Babel
    Commented May 22, 2020 at 11:19
  • There's already a solution that should allow you to accomplish your towns index completely automatically - it least here with my project it worked perfectly. So please vote for she_weeds if you find her (his?) solution helpful: gis.stackexchange.com/questions/362615/…
    – Babel
    Commented May 22, 2020 at 15:52

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.