QGIS 2.x: You can run but you can’t hide from projection issues.

Mar 5, 2014 | ArcGIS Desktop, Projections, QGIS

We received an email today from Michael Cliverton with a problem he was experiencing within QGIS Desktop concerning projections. Don’t ask me why, but I enjoy solving projection issues while others scream at their computers in tongues. The screaming is occasionally laced with profanities, but I digress. Michael did nothing of the sort. He actually found an issue we have been seeing pop up and even discussed it briefly in our Introduction to QGIS workshop as a potential gotcha to look out for. I’ll go over the problem and provide a few workarounds.

The problem:
Michael provided us with a few sample files that I reviewed in ArcMap. Projections for the files were as follows:
  • Imagery:
NAD_1983_StatePlane_New_York_Central_FIPS_3102_Feet
WKID: 2261 Authority: EPSG
  • Shapefiles:
NAD_1983_UTM_Zone_18N
WKID: 26918 Authority: EPSG
The files overlay within ArcMap with no problem using the reproject-on-the-fly built into the project data frame. Unfortunately, this is an issue that Randy and I have been witnessing within QGIS when trying to use its Enable ‘on the fly’ CRS transformation within the Project Properties. Projections in ArcMap are not defined the same way as they need to be in QGIS. QGIS is reading the ArcMap projections as custom-like projections and making a best guess OR ArcMap isn’t using the same EPSG codes for similar projections that QGIS is using (example below). If you look on the same website, you’ll see that ESRI has their own list of codes which may be the root of the problem. Same projections, differing reference codes. I’m really not sure which it is but either way, QGIS isn’t happy. Neither ESRI nor QGIS seems to be doing anything wrong, it’s the way they are communicating with one another when passing data between the two.

The workarounds:
The workarounds are a bit clunky and there is a bit of guess work. The assumption with these workarounds is that you are very familiar with most of the projections you are working with to take some of the guess work out of the equation.
1. Setting (defining) the CRS for each layer as well as the Project Properties for ‘on the fly’ transformations:
  • Load your data into QGIS. I like to start with the imagery then load the shapefiles. For each layer, right-click then select Properties > General then click on Specify under the Coordinate reference system heading. The CRS information for Michael’s imagery appears as EPSG:32116 – NAD83 / New York Central which is the best guess that QGIS has made based on what ESRI has provided but is not correct for QGIS to work with. You can use the Filter to narrow down your selection and find the projection. In Michael’s case, I entered “New York” into the filter then was able to scroll through the list to match the FIPS code (3102) and the units (feet) with the proper CRS within QGIS which turned out to be EPSG: 102716 for NAD_StatePlane_New_York_Central_FIPS_3102_Feet.
  • I prefer to reproject the shapefiles rather than the imagery, so once the imagery’s CRS is discovered, go to Project > Project Properties > CRS. Here you can select the imagery’s CRS from the list. It will most likely now show up in the recently used list. Click on OK after selecting the CRS. If all the layers have been redefined, you should see the canvas go blank (Zoom to layer extent for the image) or all layers aligned.

2.  Saving layers as new files with defined projection:

  • Once you know the EPSG codes for the layers, you can redefine them and save them as new files to be in the same CRS. I did this by defining the layer projections as described in workaround #1 then right-clicking on the layer and selecting Save As… to save our as a new shapefile. The defined projection should already show up as Layer CRS just under Encoding in the tool’s form or you can manually select it as described before.

3. Reproject the shapefiles into the imagery’s CRS:

  • Once you know the CRS’s of the imagery and the shapefiles, you will still need to redefine all the layers as described above. However, you can now reproject the shapefiles into the same CRS as the imagery has to save from having this issue. You do this the same as in workaround #2, except that you will select Project CRS instead of leaving it as Layer CRS. I like to have all of my files in the same projection whenever possible because of some quirky ArcMap problems I have run across, particularly when dealing with unit conversions between horizontal and vertical and selecting by location.

Hope this helps others and happy (Q)GISing!

You may also like

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...

Tricks with an ESRI File Geodatabase

Tricks with an ESRI File Geodatabase

A few years back I jumped in way over my head with QGIS/Postgis. I had moved a process out of one software and into my favorite two (QGIS/PostGIS) and little did I know the final output had to be a ESRI File Geodatabase. So what did I do? I shamed them into using a...

Making the Invalid Valid

Making the Invalid Valid

I could argue I'm doing that on multiple levels these days. Except I want to talk Geometry, QGIS, and Forks in the Road. I haven't done just a "QGIS Tech Post" in a while. I talk about it and training and generalities but hardly dive into the specifics. So here is a...