1

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.

3

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.

  • i didn't know there was such an option while exporting..nice to know.. – vinayan Apr 7 '12 at 15:07
  • Thank you so much for making that clear. It now works perfectly. – slth Apr 7 '12 at 15:50
0

Prject CRS is only for temporary display in map. For reprojection you need to use Define Projection as mentioned below..

  1. Enable Ftools plugin in qgis.
  2. select define current projection

enter image description here

Select the target projection(google mercator) as shown below..

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.