Is there a way to create what is called a 'reference grid' in ArcMap using QGIS print composer:
-
1possible duplicate of gis.stackexchange.com/questions/31200/…– Ian Turton ♦Mar 3, 2016 at 18:52
-
@that's more of a grid/graticule, right?– DPSSpatial_BoycottingGISSEMar 3, 2016 at 19:44
-
1could you please edit your question to show why it is not a duplicate of gis.stackexchange.com/questions/31200/… This is not an exact copy of ArcGIS but does the work.– radouxjuOct 14, 2016 at 6:57
-
1Maybe here: gis.stackexchange.com/questions/195293/…– thibautgOct 14, 2016 at 7:06
-
1This question is not a duplicate of question 31200 because the user wants to create a grid based on paper space in the layout, not geographic space. Question 195293 could probably be considered a duplicate, but this question is better described and graphically depicted, and has better answers. The answer from 195293 could probably be merged into this question.– RyanKDaltonOct 18, 2016 at 15:09
3 Answers
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.
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! Oct 14, 2016 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. Oct 18, 2016 at 15:21
-
This is what I was after - @RyanDalton the plugin called "Grids for Atlas" might be what you're after? Oct 18, 2016 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!!! Oct 18, 2016 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. Oct 18, 2016 at 15:33
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.
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.
-
1thank 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!!! Oct 18, 2016 at 15:31