QGIS – How to Project TIGER & WGS84 to Spherical Mercator

coordinate systemqgis

So I've been banging my head on this for about a week now. I'm using QGIS on a Mac. I have various shapefiles in WGS84 and Census TIGER NAD83 (EPSG:4269) and I would like to give them the same projection as Google, Bing and Openstreetmaps.

My map of the world, the one in WGS84, is always slightly off. Here is a screenshot of Florida compared to a Cloudmade tileset:

enter image description here

The map on the bottom is Cloudmade and the grey one on top is mine.

I'm starting to think that I could be doing this wrong in QGIS. Here are my steps:

  1. Import shapefile.

  2. Settings -> Custom CRS -> Create & save a custom CRS called Spherical Mercator and using parameters: +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs

  3. Set the layer and project to be using that CRS.

  4. Right clicking on layer and save as shapefile.

I'm using Tilestache to display my tiles. They are getting rendered through Mapnik. The Map XML property "srs" is also set to: +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs

Any insight on what my issue could be would be greatly appreciated.

Thanks.

Best Answer

3. Set the layer and project to be using that CRS.

That's where the process is going wrong. When you set the layer CRS to Mercator, you are basically telling QGIS that the coordinates of that layer are in Mercator instead of WGS84. Changing the layer CRS this way does NOT reproject the coordinates.

To reproject a layer, go to "Save as ..." and choose a target CRS like "Google Mercator".

Note: You don't need to define a "user defined CRS". "Spherical Mercator" aka "Google Mercator" is supported by default as EPSG:900913.