QGIS 2.x: More fun with projections – defining and reprojecting

Mar 13, 2014 | Projections, QGIS, Tutorial

I was asked to make a tutorial on defining and reprojecting files in QGIS. I wrote this for specific data sets that were being used and approached it as a workflow instead of just a how-to tutorial. This might help others in understanding some of the quirkiness with QGIS and projections at the moment. Obviously, there is more than one way to do this but I wrote this as a, hopefully, simple solution.

Just as a recap for those that need a refresher or are new to defining and reprojecting:

  • Defining projection – the data (vector or raster files) are already drawn in a projection but the actual spatial reference description (like UTM or State Plane or Geographic) is not with the files. QGIS and ArcMap rely on knowing the spatial reference descriptions to reproject files with different defined projections on the fly within the data frame so that they overlay correctly.
  • Reproject – When the spatial reference of a file is known, the software can translate the file into another defined spatial reference. An example of this would be like the conversion we did to your second set of files that were in a UTM projection with units in feet and we later reprojected them into a different UTM projection that had units in meters.

This is what we know about the files being used:

  • Topo DRG – downloaded in UTM NAD83 in feet from ChartTiff
  • Polygon of tract – drawn over the DRG in QGIS (will be in same coordinates as DRG)

Especially because of what QGIS is currently doing, it’s going to be very important to check the metadata of the files used to get the spatial references. (But I would definitely suggest making this a habit regardless!) If they do not come with metadata, you may need to contact the files’ creator and ask for that information as a starting point. I would also recommend going into the files’s Properties after adding it to QGIS to review the CRS information and make sure it matches what you know about the files’ spatial reference before starting to work with the files.

The workflow will go as follows:

(I’m using QGIS 2.0.1 for my example and this should not be any different if you have 2.2 installed.)

Overview:

  1. Add DRG to QGIS and check the Properties of the file for the CRS that QGIS has defined it as against what you know the file is in. If the projections are different, go to step 2.

  2. Define the projection for the DRG.

  3. Create a new shapefile and choose the same projection as the DRG.

  4. Reproject the files for your GPS unit.

1. Add DRG to QGIS and check projections.

  • Open QGIS, and click on the Add Raster Layer button in the sidebar. Browse to the DRG.
  • After adding the DRG to QGIS, right-click and select Properties > General. Click on the Specify button under Coordinate Reference System. The screenshot below shows the CRS that QGIS has chosen for the DRG.
Raster Layer Projection

QGIS made a best guess for the CRS of the DRG.

2. Define the projection for the DRG:

  • Since we know that the DRG is in UTM with units in feet, we know that the above information chosen by QGIS is incorrect and we will need to redefine the projection within the Properties of the file. To do this, go back to Properties > General and click on the Specify button under Coordinate Reference System if you closed the window. In most cases, you would use the filter to find the projection in the list and select the correct projection.

However, in this specific case, we need a projection that is not included in QGIS. I had to create a custom projection from the NAD83 / UTM zone 18N parameters that was in feet instead of meters. You can create a custom projection under Settings > Custom CRS. The parameters I used to define the DRG were: +proj=utm +zone=18 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs

3. Create a new shapefile in same projection as DRG:

  • Go to Layer > New > New Shapefile Layer (or use the icon in the sidebar) to create the new file using the screenshot below as a guide to change the default projection to match that of the DRG:

Vector Layer Projection

4. Reproject files:

  • To reproject the files from the UTM units in feet to UTM units in meters (to work with your GPS unit), right-click on the layer you want to reproject and select Save As. Fill out the tool form with the relevant information (giving it a new name, etc…). Both raster and vector files will have a place to select the desired projection you want the data converted to:

For rasters:

Reprojecting Rasters

For shapefiles:

Reprojecting Vectors

That’s it for today.

Happy (Q)GISing!

 

You may also like

QGIS Fun: Chickamauga Mound

QGIS Fun: Chickamauga Mound

I've been trying to stop once a week and do something fun with QGIS. Post Heart Incident I do a lot of walking. I've been re-exploring some places I used to go in town to exercise and one is the TN River Walk. I realized the other day I needed to do some OpenStreetMap...

The Trail Map – Part 1

The Trail Map – Part 1

A few posts ago I babbled about cartography. I've never had the patience for Cartography mainly because two things usually happen...well three things: the map can't be bigger than 8x11 the map must have everything on it Make the map however you want except we will...

My So called Life as a Map Maker

My So called Life as a Map Maker

I can sum it up: It's not much of one. Way back in my younger days I was infatuated with ArcPlot (which was the plotting portion of ArcINFO). From there I moved to Arcview, ArcMap, and eventually here to QGIS. All of my work typically revolves around Data. I usually...