Skip to content
Permalink
Browse files

PDAL provider should be preferred for las/laz files

  • Loading branch information
nyalldawson committed Nov 5, 2020
1 parent 9f53f70 commit fdcedb4ed0e59153469887bd5fc7052f936d6bb9
Showing with 11 additions and 0 deletions.
  1. +10 −0 src/providers/pdal/qgspdalprovider.cpp
  2. +1 −0 src/providers/pdal/qgspdalprovider.h
@@ -146,6 +146,16 @@ QVariantMap QgsPdalProviderMetadata::decodeUri( const QString &uri ) const
return uriComponents;
}

int QgsPdalProviderMetadata::priorityForUri( const QString &uri ) const
{
const QVariantMap parts = decodeUri( uri );
QFileInfo fi( parts.value( QStringLiteral( "path" ) ).toString() );
if ( fi.suffix().compare( QLatin1String( "las" ), Qt::CaseInsensitive ) == 0 || fi.suffix().compare( QLatin1String( "laz" ), Qt::CaseInsensitive ) == 0 )
return 100;

return 0;
}

QString QgsPdalProviderMetadata::filters( QgsProviderMetadata::FilterType type )
{
switch ( type )
@@ -60,6 +60,7 @@ class QgsPdalProviderMetadata : public QgsProviderMetadata
QList< QgsDataItemProvider * > dataItemProviders() const override;
QString encodeUri( const QVariantMap &parts ) const override;
QVariantMap decodeUri( const QString &uri ) const override;
int priorityForUri( const QString &uri ) const override;
QString filters( FilterType type ) override;
};

0 comments on commit fdcedb4

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