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
66 const QgsVectorLayer *layer = qobject_cast< const QgsVectorLayer * >( l );
89 std::unique_ptr< QgsAbstractGeometry > swappedGeom( geom.
constGet()->
clone() );
90 swappedGeom->swapXy();