Two Different Graticules with QGIS

Quantum GIS now has a well thought out grid feature to add a grid or graticule to your map layout. It’s implemented in the Print Composer as part of the map item. However sometimes you require two grids representing different Coordinate Reference Systems on the same map. The grid feature creates the grid in the project’s current CRS. In order to display a second grid in some other CRS, you’ll need a trick outlined in this post.

So, suppose we want to make a map displaying both Lon-Lat geographic coordinates, and a local CRS. Begin by loading a layer covering the region of interest and setting the project CRS to EPSG:4326 (Lon-Lat, WGS84) with on-the-flye projection enabled. Now use the “Vector->Research Tools->Vector Grid” option to create a grid with the spacing and extents required. Once the grid shapefile is created, open it’s *.dbf file in Openoffice.org Calc and, following the details in the above post, add columns for X_OFFSET, Y_OFFSET, ANGLE, and INTERVAL. The offsets you will enter refer to the current CRS (Lon-Lat WGS84 in this case). Once you have that setup, display this new grid shapefile with labels. You’ll use the label options (as explained in the same post mentioned above) to set the angle and X and Y coordinates to get the labels placed around the edges of your map.

Now change the project’s CRS to whatever the second grid should be, and maintain on-the-fly projection enabled. You’ll notice that the first Lon-Lat grid will now be slightly “distorted” due to the reprojection.  Open the Print Composer, and add a Map element. In the Map Item configuration window, go to the Grid tab, and check “Show Grid?”. Set up the intervals, and fonts, etc for the grid. This grid will represent the project’s projected coordinate system.

Here’s an example. The data were obtained from the Natural Earth data website, and reprojected within QGIS to Jordan Transverse Mercator – EPSG:3066 (the blue lines). The red coordinate grid represents Lon-Lat geographic coordinates:

Middle east map
Map of Middle east, Jordan Transverse Mercator projection

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>