Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

STAC core part one #58353

Merged
merged 4 commits into from
Oct 9, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions images/images.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -1009,6 +1009,7 @@
<file>themes/default/mActionTextInsideRect.svg</file>
<file>themes/default/mIconLabelingRules.svg</file>
<file>themes/default/stacked-diagram.svg</file>
<file>themes/default/mIconStac.svg</file>
</qresource>
<qresource prefix="/images/tips">
<file alias="symbol_levels.png">qgis_tips/symbol_levels.png</file>
Expand Down
82 changes: 82 additions & 0 deletions images/themes/default/mIconStac.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@
QgsManageConnectionsDialog.TiledScene = QgsManageConnectionsDialog.Type.TiledScene
QgsManageConnectionsDialog.SensorThings = QgsManageConnectionsDialog.Type.SensorThings
QgsManageConnectionsDialog.CloudStorage = QgsManageConnectionsDialog.Type.CloudStorage
QgsManageConnectionsDialog.STAC = QgsManageConnectionsDialog.Type.STAC
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ class QgsManageConnectionsDialog : QDialog
TiledScene,
SensorThings,
CloudStorage,
STAC,
};

QgsManageConnectionsDialog( QWidget *parent /TransferThis/ = 0, Mode mode = Export, Type type = WMS, const QString &fileName = QString() );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ class QgsManageConnectionsDialog : QDialog
TiledScene,
SensorThings,
CloudStorage,
STAC,
};

QgsManageConnectionsDialog( QWidget *parent /TransferThis/ = 0, Mode mode = Export, Type type = WMS, const QString &fileName = QString() );
Expand Down
4 changes: 4 additions & 0 deletions src/app/qgisapp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,8 @@
#include "qgscustomlayerorderwidget.h"
#include "qgsdataitemproviderregistry.h"
#include "qgsdataitemguiproviderregistry.h"
#include "qgsstacdataitems.h"
#include "qgsstacdataitemguiprovider.h"
#include "qgsdatasourceuri.h"
#include "qgsdatumtransformdialog.h"
#include "qgsdoublespinbox.h"
Expand Down Expand Up @@ -1442,6 +1444,7 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, bool skipBadLayers
QgsGui::dataItemGuiProviderRegistry()->addProvider( new QgsFieldDomainItemGuiProvider() );
QgsGui::dataItemGuiProviderRegistry()->addProvider( new QgsRelationshipItemGuiProvider() );
QgsGui::dataItemGuiProviderRegistry()->addProvider( new QgsDatabaseItemGuiProvider() );
QgsGui::dataItemGuiProviderRegistry()->addProvider( new QgsStacDataItemGuiProvider() );

QShortcut *showBrowserDock = new QShortcut( QKeySequence( tr( "Ctrl+2" ) ), this );
connect( showBrowserDock, &QShortcut::activated, mBrowserWidget, &QgsDockWidget::toggleUserVisible );
Expand Down Expand Up @@ -1647,6 +1650,7 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, bool skipBadLayers
#endif

QgsApplication::dataItemProviderRegistry()->addProvider( new QgsProjectDataItemProvider() );
QgsApplication::dataItemProviderRegistry()->addProvider( new QgsStacDataItemProvider() );

// now when all data item providers are registered, customize both browsers
QgsCustomization::instance()->updateBrowserWidget( mBrowserWidget );
Expand Down
29 changes: 29 additions & 0 deletions src/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,20 @@ set(QGIS_CORE_SRCS
scalebar/qgssteppedlinescalebarrenderer.cpp
scalebar/qgsticksscalebarrenderer.cpp

stac/qgsstacasset.cpp
stac/qgsstaccatalog.cpp
stac/qgsstaccollection.cpp
stac/qgsstacconnection.cpp
stac/qgsstaccontroller.cpp
stac/qgsstacdataitems.cpp
stac/qgsstacextent.cpp
stac/qgsstacitemcollection.cpp
stac/qgsstacitem.cpp
stac/qgsstaclink.cpp
stac/qgsstacobject.cpp
stac/qgsstacparser.cpp
stac/qgsstacprovider.cpp

textrenderer/qgsfontmanager.cpp
textrenderer/qgstextbackgroundsettings.cpp
textrenderer/qgstextblock.cpp
Expand Down Expand Up @@ -1945,6 +1959,20 @@ set(QGIS_CORE_HDRS
scalebar/qgssteppedlinescalebarrenderer.h
scalebar/qgsticksscalebarrenderer.h

stac/qgsstacasset.h
stac/qgsstaccatalog.h
stac/qgsstaccollection.h
stac/qgsstacconnection.h
stac/qgsstaccontroller.h
stac/qgsstacdataitems.h
stac/qgsstacextent.h
stac/qgsstacitemcollection.h
stac/qgsstacitem.h
stac/qgsstaclink.h
stac/qgsstacobject.h
stac/qgsstacparser.h
stac/qgsstacprovider.h

symbology/qgs25drenderer.h
symbology/qgsarrowsymbollayer.h
symbology/qgscategorizedsymbolrenderer.h
Expand Down Expand Up @@ -2395,6 +2423,7 @@ target_include_directories(qgis_core PUBLIC
scalebar
settings
sensor
stac
symbology
textrenderer
tiledscene
Expand Down
54 changes: 54 additions & 0 deletions src/core/stac/qgsstacasset.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/***************************************************************************
qgsstacasset.cpp
---------------------
begin : October 2024
copyright : (C) 2024 by Stefanos Natsis
email : uclaros at gmail dot com
***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/

#include "qgsstacasset.h"

QgsStacAsset::QgsStacAsset( const QString &href,
const QString &title,
const QString &description,
const QString &mediaType,
const QStringList &roles )
: mHref( href )
, mTitle( title )
, mDescription( description )
, mMediaType( mediaType )
, mRoles( roles )
{
}

QString QgsStacAsset::href() const
{
return mHref;
}

QString QgsStacAsset::title() const
{
return mTitle;
}

QString QgsStacAsset::description() const
{
return mDescription;
}

QString QgsStacAsset::mediaType() const
{
return mMediaType;
}

QStringList QgsStacAsset::roles() const
{
return mRoles;
}
72 changes: 72 additions & 0 deletions src/core/stac/qgsstacasset.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
/***************************************************************************
qgsstacasset.h
---------------------
begin : October 2024
copyright : (C) 2024 by Stefanos Natsis
email : uclaros at gmail dot com
***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/

#ifndef QGSSTACASSET_H
#define QGSSTACASSET_H

#define SIP_NO_FILE

#include "qgis_core.h"

#include <QString>
#include <QStringList>

/**
* \ingroup core
* \brief Class for storing a STAC asset's data
*
* \note Not available in python bindings
* \since QGIS 3.40
*/
class CORE_EXPORT QgsStacAsset
{
public:
//! Constructor
QgsStacAsset( const QString &href,
const QString &title,
const QString &description,
const QString &mediaType,
const QStringList &roles );

//! Returns the URI to the asset object
QString href() const;

//! Returns the the displayed title for clients and users.
QString title() const;

/**
* Returns a description of the Asset providing additional details, such as how it was processed or created.
* CommonMark 0.29 syntax MAY be used for rich text representation.
*/
QString description() const;

//! Returns the media type of the asset
QString mediaType() const;

/**
* Returns the roles assigned to the asset.
* Roles are used to describe the purpose of the asset (eg. thumbnail, data etc).
*/
QStringList roles() const;

private:
QString mHref;
QString mTitle;
QString mDescription;
QString mMediaType;
QStringList mRoles;
};

#endif // QGSSTACASSET_H
Loading
Loading