1

In print composer, I would like to syncronize the scale of the map with the Grid scale. For example, in print composer I am making a map in 1/1000 scale, so I go to grid,and insert "map units" x=100 y=100. I am copying this map layout and in the second map the scale that fits is 1/200, so I go to grid,and insert "map units" x=20 y=20... Is there an expresion to write, so it can understand the map scale and autochange the grid scale? In grid decoration that happens automaticaly with zoom in-out, can I do the same in print composer?

1

There are lots of different types of Grids in QGIS, so I want to make sure we're talking about the same thing. This is the type of grid I think you're talking about:

A Map Grid on a Map Item in the Print layout

enter image description here

No, the map grid in print layout doesn't accept expressions.

Since the feature you want doesn't exist, here's a workaround that might help you.

  • Open a new print layout. Add a map item, and add many grids, one at every single possible scale you could ever want.
  • As you create each grid, un-check the box that says "Draw "[grid name]" Grid."
  • Change the name of each grid from the default (Grid 1, Grid 2, etc) to something that tells you what scale it is, like "20x20", "100x100", etc.
  • Save this map as a template, and use the "load items from template" button to load it into your print layout.
  • Select the grid you want, and check the box that says "Draw "[grid name]" Grid".

enter image description here

  • Hello, yes this is the grid I am talking about. I thought, if I don't select map units, but the cm distance as option, the composer will add crosses every 10cm. But it is appearing a local grid scale every 10cm.To change that, I assume, if I go to the "draw coordinate" type, when I select -special/unique type, instead of degrees, that activates the expresion button next to it. There, I was hoping if I could add an expresion to tell the composer to add XY grid nubers to be the same as my maps location CRS. – Pitheas Nov 13 at 15:06
  • If you chose 'map units' for the grid interval units, they're already in your map's CRS. Any expression you use for a custom format will only change the format. It won't change the grid spacing. – csk Nov 13 at 17:38
  • For example if you want to make an atlas with different map scales and you want each map to have its own grid, but not fixed scale, how does the print composer modifies the grid scale seperatly for each map? – Pitheas Nov 14 at 7:04
  • 1
    If you choose cm as the grid units, they will be in cm measured on the page, not cm measured on the map. So the grid will be exactly the same scale on every page of the atlas. The only way to have the grid change scale for maps at different scales is to choose map units as the grid units. – csk Nov 15 at 19:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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