23 QString QgsSwapXYAlgorithm::name()
const 25 return QStringLiteral(
"swapxy" );
28 QString QgsSwapXYAlgorithm::displayName()
const 30 return QObject::tr(
"Swap X and Y coordinates" );
33 QStringList QgsSwapXYAlgorithm::tags()
const 35 return QObject::tr(
"invert,flip,swap,latitude,longitude" ).split(
',' );
38 QString QgsSwapXYAlgorithm::group()
const 40 return QObject::tr(
"Vector geometry" );
43 QString QgsSwapXYAlgorithm::groupId()
const 45 return QStringLiteral(
"vectorgeometry" );
48 QString QgsSwapXYAlgorithm::outputName()
const 50 return QObject::tr(
"Swapped" );
53 QString QgsSwapXYAlgorithm::shortHelpString()
const 55 return QObject::tr(
"This algorithm swaps the X and Y coordinate values in input geometries. It can be used to repair geometries " 56 "which have accidentally had their latitude and longitude values reversed." );
59 QgsSwapXYAlgorithm *QgsSwapXYAlgorithm::createInstance()
const 61 return new QgsSwapXYAlgorithm();
64 bool QgsSwapXYAlgorithm::supportInPlaceEdit(
const QgsMapLayer *l )
const 89 std::unique_ptr< QgsAbstractGeometry > swappedGeom( geom.
constGet()->
clone() );
90 swappedGeom->swapXy();
Base class for all map layer types.
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.
bool isSpatial() const FINAL
Returns true if this is a geometry layer and false in case of NoGeometry (table only) or UnknownGeome...
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.
bool supportInPlaceEdit(const QgsMapLayer *layer) const override
Checks whether this algorithm supports in-place editing on the given layer Default implementation for...
Represents a vector layer which manages a vector based data sets.
Contains information about the context in which a processing algorithm is executed.