Skip to content
Permalink
Browse files

fix loading

  • Loading branch information
PeterPetrik authored and nyalldawson committed Oct 26, 2020
1 parent 8ea34de commit aa814bce49c7df5846d907ce26d4b5ef20766744
@@ -350,11 +350,11 @@ IF(WITH_CORE)
FIND_PACKAGE(ZLIB REQUIRED) # for decompression of vector tiles in MBTiles file
MESSAGE(STATUS "Found zlib: ${ZLIB_LIBRARIES}")

FIND_PACKAGE(ZSTD REQUIRED) # for decompression of point clouds
FIND_PACKAGE(ZSTD) # for decompression of point clouds
IF (ZSTD_FOUND)
SET(HAVE_ZSTD TRUE) # used in qgsconfig.h
ENDIF (ZSTD_FOUND)
FIND_PACKAGE(LazPerf REQUIRED) # for decompression of point clouds
FIND_PACKAGE(LazPerf) # for decompression of point clouds
IF (LazPerf_FOUND)
SET(HAVE_LAZPERF TRUE) # used in qgsconfig.h
ENDIF (LazPerf_FOUND)
@@ -2762,7 +2762,7 @@ void QgisApp::createActions()
connect( mActionAddWmsLayer, &QAction::triggered, this, [ = ] { dataSourceManager( QStringLiteral( "wms" ) ); } );
connect( mActionAddXyzLayer, &QAction::triggered, this, [ = ] { dataSourceManager( QStringLiteral( "xyz" ) ); } );
connect( mActionAddVectorTileLayer, &QAction::triggered, this, [ = ] { dataSourceManager( QStringLiteral( "vectortile" ) ); } );
connect( mActionAddPointCloudLayer, &QAction::triggered, this, [ = ] { dataSourceManager( QStringLiteral( "pointcloud" ) ); } );
connect( mActionAddPointCloudLayer, &QAction::triggered, this, [ = ] { dataSourceManager( QStringLiteral( "ept" ) ); } );
connect( mActionAddWcsLayer, &QAction::triggered, this, [ = ] { dataSourceManager( QStringLiteral( "wcs" ) ); } );
connect( mActionAddWfsLayer, &QAction::triggered, this, [ = ] { dataSourceManager( QStringLiteral( "WFS" ) ); } );
connect( mActionAddAfsLayer, &QAction::triggered, this, [ = ] { dataSourceManager( QStringLiteral( "arcgisfeatureserver" ) ); } );
@@ -7623,7 +7623,7 @@ bool QgisApp::openLayer( const QString &fileName, bool allowInteractive )
// Try to load as point cloud layer after raster & vector & mesh
if ( !ok )
{
ok = static_cast< bool >( addPointCloudLayerPrivate( fileName, fileInfo.completeBaseName(), QStringLiteral( "pointcloud" ), false ) );
ok = static_cast< bool >( addPointCloudLayerPrivate( fileName, fileInfo.completeBaseName(), QStringLiteral( "ept" ), false ) );
}

if ( !ok )
@@ -25,8 +25,8 @@
///@cond PRIVATE

QgsEptLayerItem::QgsEptLayerItem( QgsDataItem *parent,
const QString &name, const QString &path, const QString &uri )
: QgsLayerItem( parent, name, path, uri, QgsLayerItem::PointCloud, QStringLiteral( "pointcloud" ) )
const QString &name, const QString &path, const QString &uri )
: QgsLayerItem( parent, name, path, uri, QgsLayerItem::PointCloud, QStringLiteral( "ept" ) )
{
mToolTip = uri;
setState( Populated );
@@ -59,7 +59,6 @@ QgsDataItem *QgsEptDataItemProvider::createDataItem( const QString &path, QgsDat
// get suffix, removing .gz if present
QFileInfo info( path );
info.setFile( path );
QString name = info.fileName();

// allow only normal files
if ( !info.isFile() )
@@ -69,6 +68,8 @@ QgsDataItem *QgsEptDataItemProvider::createDataItem( const QString &path, QgsDat
if ( !path.endsWith( QStringLiteral( "ept.json" ) ) )
return nullptr;

QString name = info.dir().dirName();

return new QgsEptLayerItem( parentItem, name, path, path );
}

@@ -72,6 +72,11 @@ QgsEptProviderMetadata::QgsEptProviderMetadata():
{
}

QgsEptProvider *QgsEptProviderMetadata::createProvider( const QString &uri, const QgsDataProvider::ProviderOptions &options, QgsDataProvider::ReadFlags flags )
{
return new QgsEptProvider( uri, options, flags );
}

QList<QgsDataItemProvider *> QgsEptProviderMetadata::dataItemProviders() const
{
QList< QgsDataItemProvider * > providers;
@@ -36,8 +36,8 @@ class QgsEptProvider: public QgsPointCloudDataProvider
Q_OBJECT
public:
QgsEptProvider( const QString &uri,
const QgsDataProvider::ProviderOptions &providerOptions,
QgsDataProvider::ReadFlags flags = QgsDataProvider::ReadFlags() );
const QgsDataProvider::ProviderOptions &providerOptions,
QgsDataProvider::ReadFlags flags = QgsDataProvider::ReadFlags() );

~QgsEptProvider();
QgsCoordinateReferenceSystem crs() const override;
@@ -61,6 +61,7 @@ class QgsEptProviderMetadata : public QgsProviderMetadata
{
public:
QgsEptProviderMetadata();
QgsEptProvider *createProvider( const QString &uri, const QgsDataProvider::ProviderOptions &options, QgsDataProvider::ReadFlags flags = QgsDataProvider::ReadFlags() ) override;
QList< QgsDataItemProvider * > dataItemProviders() const override;
};

0 comments on commit aa814bc

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