Navigation Menu

Skip to content

Commit

Permalink
use projection string from MDAL provider in Mesh Layer
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterPetrik committed Sep 24, 2018
1 parent 7a85fb0 commit 7ad1b71
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/providers/mdal/qgsmdalprovider.cpp
Expand Up @@ -44,14 +44,20 @@ QString QgsMdalProvider::description() const

QgsCoordinateReferenceSystem QgsMdalProvider::crs() const
{
return QgsCoordinateReferenceSystem();
return mCrs;
}

QgsMdalProvider::QgsMdalProvider( const QString &uri, const ProviderOptions &options )
: QgsMeshDataProvider( uri, options )
{
QByteArray curi = uri.toAscii();
mMeshH = MDAL_LoadMesh( curi.constData() );
if ( mMeshH )
{
const QString proj = MDAL_M_projection( mMeshH );
if ( !proj.isEmpty() )
mCrs.createFromString( proj );
}
}

QgsMdalProvider::~QgsMdalProvider()
Expand Down
2 changes: 2 additions & 0 deletions src/providers/mdal/qgsmdalprovider.h
Expand Up @@ -26,6 +26,7 @@

class QMutex;
class QgsCoordinateTransform;
class QgsCoordinateReferenceSystem;

/**
\brief Data provider for MDAL layers.
Expand Down Expand Up @@ -69,6 +70,7 @@ class QgsMdalProvider : public QgsMeshDataProvider
private:
MeshH mMeshH;
QStringList mExtraDatasetUris;
QgsCoordinateReferenceSystem mCrs;
};

#endif //QGSMDALPROVIDER_H

0 comments on commit 7ad1b71

Please sign in to comment.