Skip to content

Commit 7ad1b71

Browse files
committedSep 24, 2018
use projection string from MDAL provider in Mesh Layer
1 parent 7a85fb0 commit 7ad1b71

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed
 

‎src/providers/mdal/qgsmdalprovider.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,20 @@ QString QgsMdalProvider::description() const
4444

4545
QgsCoordinateReferenceSystem QgsMdalProvider::crs() const
4646
{
47-
return QgsCoordinateReferenceSystem();
47+
return mCrs;
4848
}
4949

5050
QgsMdalProvider::QgsMdalProvider( const QString &uri, const ProviderOptions &options )
5151
: QgsMeshDataProvider( uri, options )
5252
{
5353
QByteArray curi = uri.toAscii();
5454
mMeshH = MDAL_LoadMesh( curi.constData() );
55+
if ( mMeshH )
56+
{
57+
const QString proj = MDAL_M_projection( mMeshH );
58+
if ( !proj.isEmpty() )
59+
mCrs.createFromString( proj );
60+
}
5561
}
5662

5763
QgsMdalProvider::~QgsMdalProvider()

‎src/providers/mdal/qgsmdalprovider.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626

2727
class QMutex;
2828
class QgsCoordinateTransform;
29+
class QgsCoordinateReferenceSystem;
2930

3031
/**
3132
\brief Data provider for MDAL layers.
@@ -69,6 +70,7 @@ class QgsMdalProvider : public QgsMeshDataProvider
6970
private:
7071
MeshH mMeshH;
7172
QStringList mExtraDatasetUris;
73+
QgsCoordinateReferenceSystem mCrs;
7274
};
7375

7476
#endif //QGSMDALPROVIDER_H

0 commit comments

Comments
 (0)