QGIS API Documentation 4.3.0-Master (7c7bd4d7018)
Loading...
Searching...
No Matches
qgsdistanceutils.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsdistanceutils.cpp
3 ---------------------
4 begin : June 2026
5 copyright : (C) 2026 by Alexander Bruy
6 email : alexander dot bruy at gmail dot com
7 ***************************************************************************/
8
9/***************************************************************************
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 ***************************************************************************/
17
18#ifndef QGSDISTANCEUTILS_H
19#define QGSDISTANCEUTILS_H
20
21#include <utility>
22#include <vector>
23
24#include "qgis_analysis.h"
25#include "qgis_sip.h"
26#include "qgsfeatureid.h"
27#include "qgspointxy.h"
28
29#define SIP_NO_FILE
30
31class QgsDistanceArea;
33
35
36namespace QgsDistanceUtils
37{
38 struct ANALYSIS_EXPORT NeighborResult
39 {
40 QgsFeatureId featureId;
41 double distance;
42 QgsPointXY point;
43 };
44
57 ANALYSIS_EXPORT std::vector<QgsDistanceUtils::NeighborResult> nearestNeighbors(
58 const QgsPointXY &sourcePoint, const std::vector<std::pair<QgsFeatureId, QgsPointXY>> &targetPoints, const QgsDistanceArea &da, long long k, QgsProcessingFeedback *feedback = nullptr
59 );
60} //namespace QgsDistanceUtils
61
63
64#endif // QGSDISTANCEUTILS_H
A general purpose distance and area calculator, capable of performing ellipsoid based calculations.
Represents a 2D point.
Definition qgspointxy.h:62
Base class for providing feedback from a processing algorithm.
qint64 QgsFeatureId
64 bit feature ids negative numbers are used for uncommitted/newly added features