24using namespace Qt::StringLiterals;
28QString QgsStDbscanClusteringAlgorithm::name()
const
30 return u
"stdbscanclustering"_s;
33QString QgsStDbscanClusteringAlgorithm::displayName()
const
35 return QObject::tr(
"ST-DBSCAN clustering" );
38QString QgsStDbscanClusteringAlgorithm::shortDescription()
const
40 return QObject::tr(
"Clusters spatiotemporal point features using a time and density based scan algorithm." );
43QStringList QgsStDbscanClusteringAlgorithm::tags()
const
45 return QObject::tr(
"clustering,clusters,density,based,points,temporal,time,interval,duration,distance" ).split(
',' );
48QString QgsStDbscanClusteringAlgorithm::group()
const
50 return QObject::tr(
"Vector analysis" );
53QString QgsStDbscanClusteringAlgorithm::groupId()
const
55 return u
"vectoranalysis"_s;
58void QgsStDbscanClusteringAlgorithm::initAlgorithm(
const QVariantMap & )
60 QGS_MARK_ALGORITHM_SOURCE
66 addParameter(
new QgsProcessingParameterDistance( u
"EPS"_s, QObject::tr(
"Maximum distance between clustered points" ), 1, u
"INPUT"_s,
false, 0 ) );
67 auto durationParameter = std::make_unique<QgsProcessingParameterDuration>( u
"EPS2"_s, QObject::tr(
"Maximum time duration between clustered points" ), 0,
false, 0 );
69 addParameter( durationParameter.release() );
71 auto dbscanStarParam = std::make_unique<QgsProcessingParameterBoolean>( u
"DBSCAN*"_s, QObject::tr(
"Treat border points as noise (DBSCAN*)" ),
false,
true );
73 addParameter( dbscanStarParam.release() );
75 auto fieldNameParam = std::make_unique<QgsProcessingParameterString>( u
"FIELD_NAME"_s, QObject::tr(
"Cluster field name" ), u
"CLUSTER_ID"_s );
77 addParameter( fieldNameParam.release() );
78 auto sizeFieldNameParam = std::make_unique<QgsProcessingParameterString>( u
"SIZE_FIELD_NAME"_s, QObject::tr(
"Cluster size field name" ), u
"CLUSTER_SIZE"_s );
80 addParameter( sizeFieldNameParam.release() );
87QString QgsStDbscanClusteringAlgorithm::shortHelpString()
const
89 return QObject::tr(
"Clusters point features based on a 2D implementation of spatiotemporal density-based clustering of applications with noise (ST-DBSCAN) algorithm." );
92QList<QgsAcademicReference> QgsStDbscanClusteringAlgorithm::academicReferences()
const
95 { u
"Ester, M."_s, u
"Kriegel, H. P."_s, u
"Sander, J."_s, u
"Xu, X."_s },
97 u
"A Density-Based Algorithm for Discovering Clusters in Large Spatial Databases with Noise"_s,
98 u
"Proceedings of the 2nd International Conference on Knowledge Discovery and Data Mining, Portland, OR"_s,
104 createJournalArticle( { u
"Birant, D."_s, u
"Kut, A."_s }, 2007, u
"ST-DBSCAN: An algorithm for clustering spatial–temporal data"_s, u
"Data & Knowledge Engineering"_s, u
"60"_s, u
"1"_s, u
"208-221"_s );
107 createPresentation( { u
"Peca, I."_s, u
"Fuchs, G."_s, u
"Vrotsou, K."_s, u
"Andrienko, N. V."_s, u
"Andrienko, G. L."_s }, 2012, u
"Scalable Cluster Analysis of Spatial Events"_s, u
"EuroVA@ EuroVis"_s );
109 return { esterReference, birantReference, pecaReference };
112QgsStDbscanClusteringAlgorithm *QgsStDbscanClusteringAlgorithm::createInstance()
const
114 return new QgsStDbscanClusteringAlgorithm();
@ VectorPoint
Vector point layers.
@ DateTime
Accepts datetime fields.
@ Advanced
Parameter is an advanced parameter which should be hidden from users by default.
Encapsulates an academic reference and formats it according to style guidelines.
static QgsAcademicReference createPresentation(const QStringList &authors, int year, const QString &title, const QString &meeting, const QString &publisher=QString(), const QString &pages=QString())
Creates a conference paper or presentation reference.
static QgsAcademicReference createJournalArticle(const QStringList &authors, int year, const QString &title, const QString &journal, const QString &volume=QString(), const QString &issue=QString(), const QString &pages=QString())
Creates a journal article reference.
A numeric output for processing algorithms.
A double numeric parameter for distance values.
A feature sink output for processing algorithms.
An input feature source (such as vector layers) parameter for processing algorithms.
A vector layer or feature source field parameter for processing algorithms.
A numeric parameter for processing algorithms.