6

Is there a way to create what is called a 'reference grid' in ArcMap using QGIS print composer: enter image description here

4
+200

I wrote a QGIS plugin for this very use case, called Create Indexed Vertex Grid.

It works like the standard Create Vector Grid (Polygons) but assigns names to each cell in a spreadsheet-like format. It can also add label tabs on the top and left. You can use the name and isLabel fields to style the grid and headers.

enter image description here

It can be a bit finicky to use it with Print Composer, though, as you need to manually copy the extents over (using the layer metadata to get the bounds, and pasting into the extents on the Print Composer)

  • NICE Let me test that out and report back!!! Thank you! – DPSSpatial Oct 14 '16 at 21:03
  • This is a really nice plugin, but unfortunately doesn't work well within Composer when using Atlas to create data-driven outputs, since the grid is based on geographic space, not paper space. – RyanDalton Oct 18 '16 at 15:21
  • This is what I was after - @RyanDalton the plugin called "Grids for Atlas" might be what you're after? – DPSSpatial Oct 18 '16 at 15:28
  • Steven Kay - this is also great because I can load the grid into PostGIS and use it to drive information on the 'non-map' side of the map, meaning we have schools listed with their grid position (A4, B6, etc.) - so this allows a data-driven method of linking schools to the grid then to the non-map components. Excellent!!! – DPSSpatial Oct 18 '16 at 15:30
  • @DPSSpatial, "Grids for Atlas" generates the data-driven vector "rectangles" that drive the the atlas generation, it does not add the grid to composer paper space. However, using the the method you described for determining reference location is super! Great use idea. – RyanDalton Oct 18 '16 at 15:33
2

I believe there is a similar option to create Grids like ArcGIS in QGIS print Composer known as Draw Grid. Where you can give all kind of styles,distances between grid lines or Coordinate precision. You need to change the Default CRS to your project CRS.

Check the following link, I hope you will get the solution for your problem. Check from step 21 in Grid lines in QGIS composer

Thanks.

1

I’ve manage to get a small work around in 2.16. In the print composer setup a new grid with your desired interval. Select a line border frame style (unfortunately this method doesn’t work well with other styles) and edit the line style to offset the lines by half the distance of the size of the grid cell. This is so the cell values fall in the center of the grid rather than over the grid line.

Here take note of the grid cell coordinates automatically generated. In my example x axis = 0 - 6 and y axis = 0 - 4. .

Under the “Draw Coordinates” drop-down change the ‘Format’ to ‘custom’ and open the expression builder. Now it’s a simple swap of the values along the specified axis (This bit could take a while depending on how many grids cells you have):

CASE 
WHEN  @grid_number = 0  AND  @grid_axis  = 'x' THEN 'A'
WHEN  @grid_number = 1  AND  @grid_axis  = 'x' THEN 'B'
WHEN  @grid_number = 2  AND  @grid_axis  = 'x' THEN 'C'
WHEN  @grid_number = 3  AND  @grid_axis  = 'x' THEN 'D'
WHEN  @grid_number = 4  AND  @grid_axis  = 'x' THEN 'E'
WHEN  @grid_number = 5  AND  @grid_axis  = 'x' THEN 'F'
WHEN  @grid_number = 0  AND  @grid_axis  = 'y' THEN '0'
WHEN  @grid_number = 1  AND  @grid_axis  = 'y' THEN '1'
WHEN  @grid_number = 2  AND  @grid_axis  = 'y' THEN '2'
WHEN  @grid_number = 3  AND  @grid_axis  = 'y' THEN '3'
WHEN  @grid_number = 4  AND  @grid_axis  = 'y' THEN '4'
WHEN  @grid_number = 5  AND  @grid_axis  = 'y' THEN '5'
END

And Hopefully you’ll end up with something useable. For some weird reason the grid cell wouldn’t create a vertical line on the far right and I have no idea why.enter image description here

  • 1
    thank you for this - The plugin in the answer accepted above actually doesn't allow the labeling on "all" sides, as yours has, but the data created behind the scenes allows for non-map applications (ie. list with grid location) to be created that this solution doesn't allow - but I appreciate your time on this!!! – DPSSpatial Oct 18 '16 at 15:31

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.