Skip to content

Commit

Permalink
Bugfix from Fernando Pacheco so that coord capture plugin works with …
Browse files Browse the repository at this point in the history
…non EPSG based CRSes in selector list

git-svn-id: http://svn.osgeo.org/qgis/trunk@9497 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
timlinux committed Oct 19, 2008
1 parent 7c0bb66 commit 2fe497f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/plugins/coordinate_capture/coordinatecapture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ void CoordinateCapture::setCRS()
if ( mySelector.exec() )
{
mEpsgId = mySelector.selectedEpsg();
mProj4Str = mySelector.selectedProj4String();
}
}

Expand All @@ -185,7 +186,7 @@ void CoordinateCapture::update( QgsPoint thePoint )
{
//this is the coordinate resolved back to lat / lon
QgsCoordinateReferenceSystem mySrs;
mySrs.createFromEpsg( mEpsgId ); //geo lat lon
mySrs.createFromProj4( mProj4Str );
QgsCoordinateTransform myTransform( mQGisIface->mapCanvas()->mapRenderer()->destinationSrs(), mySrs );
QgsPoint myUserCrsPoint = myTransform.transform( thePoint );
mpUserCrsEdit->setText( QString::number( myUserCrsPoint.x(), 'f', 3 ) + "," +
Expand Down
2 changes: 2 additions & 0 deletions src/plugins/coordinate_capture/coordinatecapture.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ class CoordinateCapture: public QObject, public QgisPlugin

//!epsg id for showin in geoedit box
long mEpsgId;
//!proj4 string for coordinate translation
QString mProj4Str;

////////////////////////////////////////////////////////////////////
//
Expand Down

0 comments on commit 2fe497f

Please sign in to comment.