22 QString QgsSwapXYAlgorithm::name()
const 24 return QStringLiteral(
"swapxy" );
27 QString QgsSwapXYAlgorithm::displayName()
const 29 return QObject::tr(
"Swap X and Y coordinates" );
32 QStringList QgsSwapXYAlgorithm::tags()
const 34 return QObject::tr(
"invert,flip,swap,latitude,longitude" ).split(
',' );
37 QString QgsSwapXYAlgorithm::group()
const 39 return QObject::tr(
"Vector geometry" );
42 QString QgsSwapXYAlgorithm::groupId()
const 44 return QStringLiteral(
"vectorgeometry" );
47 QString QgsSwapXYAlgorithm::outputName()
const 49 return QObject::tr(
"Swapped" );
52 QString QgsSwapXYAlgorithm::shortHelpString()
const 54 return QObject::tr(
"This algorithm swaps the X and Y coordinate values in input geometries. It can be used to repair geometries " 55 "which have accidentally had their latitude and longitude values reversed." );
58 QgsSwapXYAlgorithm *QgsSwapXYAlgorithm::createInstance()
const 60 return new QgsSwapXYAlgorithm();
76 std::unique_ptr< QgsAbstractGeometry > swappedGeom( geom.
constGet()->
clone() );
77 swappedGeom->swapXy();
Base class for providing feedback from a processing algorithm.
Invalid geometry checks should always be skipped. This flag can be useful for algorithms which always...
QList< QgsFeature > QgsFeatureList
A geometry is the spatial representation of a feature.
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
bool hasGeometry() const
Returns true if the feature has an associated geometry.
virtual QgsAbstractGeometry * clone() const =0
Clones the geometry by performing a deep copy.
QgsGeometry geometry() const
Returns the geometry associated with this feature.
Flag
Flags controlling how QgsProcessingFeatureSource fetches features.
const QgsAbstractGeometry * constGet() const
Returns a non-modifiable (const) reference to the underlying abstract geometry primitive.
void setGeometry(const QgsGeometry &geometry)
Set the feature's geometry.
Contains information about the context in which a processing algorithm is executed.