Using a different status bar CRS than the map
Sometimes, you may want to display a different coordinate system for the mouse coordinates in the status bar than what the source data is. With this recipe, you can set a different coordinate system without changing the data coordinate reference system or the CRS for the map.
Getting ready
Download the zipped shapefile and unzip it to your qgis_data/ms
directory from the following:
https://geospatialpython.googlecode.com/files/MSCities_Geo.zip
How to do it...
We will load our layer, establish a message in the status bar, create a special event listener to transform the map coordinates at the mouse's location to our alternate CRS, and then connect the map signal for the mouse's map coordinates to our listener function. To do this, we need to perform the following steps:
- First, we need to import the Qt core library:
from PyQt4.QtCore import *
- Then, we will set up the path to the shapefile and load it as a layer:
pth = "/qgis_data/ms/MSCities_Geo_Pts...