QGIS API Documentation
4.3.0-Master (52aa6503bed)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
core
stac
qgsstacitemcollection.cpp
Go to the documentation of this file.
1
/***************************************************************************
2
qgsstacitemcollection.cpp
3
---------------------
4
begin : August 2024
5
copyright : (C) 2024 by Stefanos Natsis
6
email : uclaros at gmail dot com
7
***************************************************************************
8
* *
9
* This program is free software; you can redistribute it and/or modify *
10
* it under the terms of the GNU General Public License as published by *
11
* the Free Software Foundation; either version 2 of the License, or *
12
* (at your option) any later version. *
13
* *
14
***************************************************************************/
15
16
#include "
qgsstacitemcollection.h
"
17
18
#include "
qgsstacitem.h
"
19
20
#include <QString>
21
22
using namespace
Qt::StringLiterals;
23
24
QgsStacItemCollection::QgsStacItemCollection
(
const
QVector< QgsStacItem * > &
items
,
const
QVector< QgsStacLink > &links,
int
numberMatched
)
25
: mItems(
items
)
26
, mLinks( links )
27
, mNumberMatched(
numberMatched
)
28
{
29
for
(
const
QgsStacLink
&link : mLinks )
30
{
31
if
( link.relation() ==
"self"
_L1 || link.relation() ==
"root"
_L1 || link.relation() ==
"parent"
_L1 || link.relation() ==
"collection"
_L1 || link.relation() ==
"next"
_L1 )
32
mUrls.insert( link.relation(), link.href() );
33
}
34
}
35
36
QgsStacItemCollection::~QgsStacItemCollection
()
37
{
38
qDeleteAll( mItems );
39
}
40
41
QVector< QgsStacItem * >
QgsStacItemCollection::items
()
const
42
{
43
return
mItems;
44
}
45
46
QVector< QgsStacItem * >
QgsStacItemCollection::takeItems
()
47
{
48
QVector< QgsStacItem * >
items
= mItems;
49
mItems.clear();
// detach
50
return
items
;
51
}
52
53
QUrl
QgsStacItemCollection::url
()
const
54
{
55
return
QUrl( mUrls.value( u
"self"
_s, QString() ) );
56
}
57
58
QUrl
QgsStacItemCollection::rootUrl
()
const
59
{
60
return
QUrl( mUrls.value( u
"root"
_s, QString() ) );
61
}
62
63
QUrl
QgsStacItemCollection::parentUrl
()
const
64
{
65
return
QUrl( mUrls.value( u
"parent"
_s, QString() ) );
66
}
67
68
QUrl
QgsStacItemCollection::collectionUrl
()
const
69
{
70
return
QUrl( mUrls.value( u
"collection"
_s, QString() ) );
71
}
72
73
QUrl
QgsStacItemCollection::nextUrl
()
const
74
{
75
return
QUrl( mUrls.value( u
"next"
_s, QString() ) );
76
}
77
78
int
QgsStacItemCollection::numberReturned
()
const
79
{
80
return
mItems.size();
81
}
82
83
int
QgsStacItemCollection::numberMatched
()
const
84
{
85
return
mNumberMatched;
86
}
QgsStacItemCollection::numberReturned
int numberReturned() const
Returns the number of items in the collection.
Definition
qgsstacitemcollection.cpp:78
QgsStacItemCollection::parentUrl
QUrl parentUrl() const
Returns the url of the item collection's "parent" link.
Definition
qgsstacitemcollection.cpp:63
QgsStacItemCollection::~QgsStacItemCollection
~QgsStacItemCollection()
Destructor.
Definition
qgsstacitemcollection.cpp:36
QgsStacItemCollection::items
QVector< QgsStacItem * > items() const
Returns the items in the collection Ownership is not transferred.
Definition
qgsstacitemcollection.cpp:41
QgsStacItemCollection::nextUrl
QUrl nextUrl() const
Returns the url of the item collection's "next" link.
Definition
qgsstacitemcollection.cpp:73
QgsStacItemCollection::numberMatched
int numberMatched() const
Returns the total number of items in the parent collection If this information was not available by t...
Definition
qgsstacitemcollection.cpp:83
QgsStacItemCollection::QgsStacItemCollection
QgsStacItemCollection()=delete
Default constructor deleted, use the variant with required parameters.
QgsStacItemCollection::rootUrl
QUrl rootUrl() const
Returns the url of the item collection's "root" link.
Definition
qgsstacitemcollection.cpp:58
QgsStacItemCollection::url
QUrl url() const
Returns the url of the item collection's "self" link.
Definition
qgsstacitemcollection.cpp:53
QgsStacItemCollection::takeItems
QVector< QgsStacItem * > takeItems()
Returns the items in the collection Caller takes ownership of the returned items.
Definition
qgsstacitemcollection.cpp:46
QgsStacItemCollection::collectionUrl
QUrl collectionUrl() const
Returns the url of the item collection's "collection" link.
Definition
qgsstacitemcollection.cpp:68
QgsStacLink
Stores data associated with a STAC link.
Definition
qgsstaclink.h:31
qgsstacitem.h
qgsstacitemcollection.h
Generated on
for QGIS API Documentation by
1.17.0