Skip to content
Permalink
Browse files

Show datum transform parameters in datum transform selection dialog

  • Loading branch information
mhugent committed Oct 23, 2013
1 parent e2148bc commit a919eed6778bcdd7a5cefc7b79d8b274643cb4db
BIN +36 KB (100%) resources/srs.db
Binary file not shown.
@@ -213,6 +213,7 @@ class CORE_EXPORT QgsCoordinateTransform : public QObject

/**Returns list of datum transformations for the given src and dest CRS*/
static QList< QList< int > > datumTransformations( const QgsCoordinateReferenceSystem& srcCRS, const QgsCoordinateReferenceSystem& destCRS );
static QString datumTransformString( int datumTransform );

int sourceDatumTransform() const { return mSourceDatumTransform; }
void setSourceDatumTransform( int dt ) { mSourceDatumTransform = dt; }
@@ -284,7 +285,6 @@ class CORE_EXPORT QgsCoordinateTransform : public QObject
/**Removes +nadgrids and +towgs84 from proj4 string*/
static QString stripDatumTransform( const QString& proj4 );
static void searchDatumTransform( const QString& sql, QList< int >& transforms );
static QString datumTransformString( int datumTransform );
};

//! Output stream operator
@@ -1,4 +1,5 @@
#include "qgsdatumtransformdialog.h"
#include "qgscoordinatetransform.h"

QgsDatumTransformDialog::QgsDatumTransformDialog( const QList< QList< int > >& dt, QWidget* parent, Qt::WindowFlags f ): QDialog( parent, f )
{
@@ -10,10 +11,11 @@ QgsDatumTransformDialog::QgsDatumTransformDialog( const QList< QList< int > >& d
QString itemText;
for ( int i = 0; i < 2; ++i )
{
itemText = QString::number( it->at( i ) );
if ( itemText.compare( "-1" ) != 0 )
int nr = it->at( i );
if ( nr != -1 )
{
item->setText( i, itemText );
item->setData( i, Qt::UserRole, nr );
item->setText( i, QgsCoordinateTransform::datumTransformString( nr ) );
}
}
mDatumTransformTreeWidget->addTopLevelItem( item );
@@ -37,15 +39,12 @@ QList< int > QgsDatumTransformDialog::selectedDatumTransform()
{
for ( int i = 0; i < 2; ++i )
{
bool conversionOk = false;
QString itemText = item->text( i );
int transformNr = itemText.toInt( &conversionOk );
if ( !itemText.isEmpty() && conversionOk )
int transformNr = item->data( i, Qt::UserRole ).toInt();
if ( transformNr != -1 )
{
list << transformNr;
}
}
}

return list;
}
@@ -11,14 +11,19 @@
</rect>
</property>
<property name="windowTitle">
<string>Dialog</string>
<string>Select datum transformations</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QTreeWidget" name="mDatumTransformTreeWidget">
<column>
<property name="text">
<string/>
<string>src transform</string>
</property>
</column>
<column>
<property name="text">
<string>dst transform</string>
</property>
</column>
<column>

0 comments on commit a919eed

Please sign in to comment.
You can’t perform that action at this time.