Skip to content
Permalink
Browse files

use projection string from MDAL provider in Mesh Layer

  • Loading branch information
PeterPetrik committed Sep 24, 2018
1 parent 7a85fb0 commit 7ad1b7174d9685e9d9ab9f2a55ef459240dc4ff7
Showing with 9 additions and 1 deletion.
  1. +7 −1 src/providers/mdal/qgsmdalprovider.cpp
  2. +2 −0 src/providers/mdal/qgsmdalprovider.h
@@ -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()
@@ -26,6 +26,7 @@

class QMutex;
class QgsCoordinateTransform;
class QgsCoordinateReferenceSystem;

/**
\brief Data provider for MDAL layers.
@@ -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.
You can’t perform that action at this time.