top of page

Creating Grids with QGIS

Updated: 23 hours ago

Gridlines provide a visual presentation of horizontial and vertical lines that form organized equal areas on a map which represent many geographic coordinate pairs (x, y) or graticules. These coordinate pairs make it easier to pinpoint exact locations on a map. It helps you to identify feature locations and assist in discovering distances between features, such as with nautical charts. They can help discover patterns and trends from analyzing thematic maps or it can simply be utilized to provide an appealing look for your map.

Creating the grids associated with these coordinate pairs is fairly easy in QGis. Click the toggles and follow the instructions:


Add feature(s) to map

  • Select: Layer- Add Layer- Add Vector Layer

  • 'Data Source Management | Vector' box appears

  • Source: Click BROWSE button

  • Select your vector file from your directory

  • Click OPEN button

  • Click ADD

  • Click CLOSE

Project your map (the map projection associated with your map determines its accuracy.)

The choice of your projection depends on its' usage. If you are working with maps that require measurements you will need a projection that is best for direction and distance. If you are focused on analyzing data or searching for patterns, you should choose a projection that will display less distorted area features.


There are many things to consider in selecting a projection for the usage of your map.  You should consider the location on the earth and its orientation to the earth. This includes the characteristics and properties (distance, direction, etc.) you wish to keep for the purpose of your map. Note: There are projection tools that can assist you in determining the best projection, which are available on the internet, such as the projection wizard.


In this exercise we will use the most universally utilized projection for the entire world, the WGS84 Projected Web Mercator. It accounts for the best navigatial maps (except at the poles) and is the best to present shapes and sizes. We will utilize a country within the 75N - 75S latitudial areas of the map and nearest the equator, in the country of Venzuela.


Keep in mind your CRS distance units, the format of the coordinates and map extent.


If you want to change the projection of your map, then follow these steps to update your projection:

  • Right click your feature

  • Export- Save as feature as..

  • 'Save Vector Layer as...' box appears

  • File Name: create a new name for the projected file (i.e. projected_Map)

    • Click BROWSE button

    • navigate to the directory to put your file

    • Click SAVE

  • CRS: select the GLOBE button

  • Select coordinate system according to the need of your map.

  • Click OK button

  • Click CLOSE button

Create Layout

  • Select: Project- Layout Manager

  • 'Layout Manager' box appears

  • Select 'New from Template' toggle: Click CREATE button

  • 'Create Print Layout' box appears

  • Type: a layout title (i.e. Venzuela)

  • Click OK button

  • Layout interface appears with 'Venzuela' as the header

  • Click CLOSE button in 'Layout Manager' box

  • Select: Add Items- Add Map

  • Drag a rectangle in layout to place on the map

  • Ensure the map is selected in the view interface

  • Select or Open 'Item Properties' tab

    • To select: Click the 'Item Properties' tab

    • To open: View- Panels- Check the 'Item Properties'

  • Select 'Map Properties' toggle: Select the Scale and CRS for your map, if the Project CRS is different than your map

    • Select Scale for your map

    • CLICK GLOBE button

    • Select your projectd CRS (i.e. WGS_1984_Web_Mercator)

  • Select 'Items' tab

    • Check box to lock the map

Select the Grid

  • Select GRIDS toggle

  • Click the PLUS SIGN button to add a grid

  • Grid name will appear in the box (by default it is called 'Grid 1')

  • Highlight the grid name (optional: double-click the 'Grid 1' to rename the grid)

  • Click MODIFY GRID... button

  • 'Map Grid Properties' interface appears

Create Grid

  • Select 'Appearance' toggle

    • Grid type: Solid

    • CRS: Use Map CRS

    • Intervals: Choose one of the following or both

Select 'Fit Segment width' (This selection creates the grid lines automatically. It adjusts the spacing between the gridlines based on the map extent by calculating and selecting the best intervals to display. This ensures the correct spacing between the grid lines whenever the map scale is adjusted or changes.)

  • At the top of the 'Map grid Properties' interface, Click the 'Enable grid' off, then back on to display the gridlines

  • Minimum & Maximum Values (By default these ranges are min (50) & max (100). They are the range of distances that is searched to discover the best grid intervals. These values can be adjusted to suit your map needs.

Select 'Map Units' (You determine the distance between the grid references based on the CRS for the X and Y direction.)

  • X: the number of intervals between coordinates (i.e. the distance between geographic coordinates in the X direction)

  • Y: the number of intervals between coordinates (i.e. the distance between geographic coordinates in the Y direction)Scroll to Frame toggle

Select 'Frame' toggle

  • Frame style: Choose a style (i.e. Interior and Exterior Ticks)

  • The frame style you selected will appear

  • You can keep all the defaults or change the Frame (margin, thickness, etc.)

Scroll to 'Draw Coordinates' toggle

  • Check box 'Draw Coordinates'

  • Format: select the format for your labels (i.e. decimal, decimals with suffix, etc.)

  • The format label you selected will appear

  • Note: to change the annotation for the coordinates from decimal to degree, mintue, second, etc.), then click to this link: customize coordinates to navigate to the bottom of the page for instructions.

  • Format: Select a Coordinate format (i.e. degrees with Suffix)

  • Left, Right, Top & Bottom: Choose the location of the annotation or coordintes to display inside the grid, outside the grid, latitude only, etc.)

  • Font: change the font style

  • Distance to map frame: the coordinate annotation's distance from the grid border.

  • Choose precision: Choose how to display the level of accuracy of each coordinate annotation based on the map units.


  • Select 'Appearance' toggle 

    • Offset: (select the position of the gridlines or adjust the labels)

    • Line style: configuring the gridlines (color, width, etc.)

    • positive number will shift to the right (X) and up (Y)

  • negative number will shift to the left(X) and down (y)


(1) Additonal Hints: If your map only creates decimal degrees or you wish to customize the coordinates to your label, then

  • Navigate to 'Draw Coordinates' toggle

  • Format: select 'Custom'

  • Click the EXPRESSION BASED ANNOTATION button (i.e. 'e' symbol)

  • Type the following code:

CASE

WHEN @grid_axis='x' THEN --grid_axis identifies the direction of the x-axis (longitude)

to_dms(@grid_number, 'x', 1) || 'E' -- converts to degree, minute, seconds

-- the '||' symbol appends the annotation 'E'

WHEN @grid_axis='y' THEN --grid_axis identifies the direction of the y-axis (latitude)

to_dms(@grid_number, 'y', 1) || 'N' -- converts to degree, minute, seconds

                                                               -- the '||' symbol appends the annotation 'N'

END

  • Click OK

  • This will populate your labels to degree-minute -second


(2) Additonal Hints: In the 'Appearance'- Interval: Map Units, you can customize the format of the coordinates. A helpful tool to covert coordinates from degrees to decimals, minuties and seconds, or vis versa.


(3) Additonal Hints: Anytime you make changes to the grid, or need to display labels, or the gridlines do not appear, then

  • Navigate to the top of the 'Map grid Properties' interface

  • Click the 'Enable grid' off, then back on (or vis versa).


(4) Additonal Hints: Whenever you create a border or frame for your grid, the 'interior ticks', 'exterior ticks' or 'interior and exterior ticks' will not draw a box, thus,

  • Navigate back to main 'Item Properties' interface

  • Scroll to 'Frame' toggle

  • Check box to create a border with the tick marks.
















Comments


bottom of page