Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change default WKT output to honor a space between geometry type and Z, M or ZM #58010

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/core/geometry/qgsabstractgeometry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -211,10 +211,15 @@ double QgsAbstractGeometry::area() const
QString QgsAbstractGeometry::wktTypeStr() const
{
QString wkt = geometryType();
QString suffix;
if ( is3D() )
wkt += 'Z';
suffix += 'Z';
if ( isMeasure() )
wkt += 'M';
suffix += 'M';
if ( !suffix.isEmpty() )
{
wkt += ' ' + suffix;
}
return wkt;
}

Expand Down
6 changes: 3 additions & 3 deletions tests/src/3d/testqgstessellator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -407,11 +407,11 @@ void TestQgsTessellator::asMultiPolygon()

QgsTessellator t( 0, 0, false );
t.addPolygon( polygon, 0 );
QCOMPARE( t.asMultiPolygon()->asWkt(), QStringLiteral( "MultiPolygonZ (((1 2 0, 2 1 0, 3 2 0, 1 2 0)),((1 2 0, 1 1 0, 2 1 0, 1 2 0)))" ) );
QCOMPARE( t.asMultiPolygon()->asWkt(), QStringLiteral( "MultiPolygon Z (((1 2 0, 2 1 0, 3 2 0, 1 2 0)),((1 2 0, 1 1 0, 2 1 0, 1 2 0)))" ) );

QgsTessellator t2( 0, 0, false );
t2.addPolygon( polygonZ, 0 );
QCOMPARE( t2.asMultiPolygon()->asWkt( 6 ), QStringLiteral( "MultiPolygonZ (((1 2 4, 2 1 2, 3 2 3, 1 2 4)),((1 2 4, 1 1 1, 2 1 2, 1 2 4)))" ) );
QCOMPARE( t2.asMultiPolygon()->asWkt( 6 ), QStringLiteral( "MultiPolygon Z (((1 2 4, 2 1 2, 3 2 3, 1 2 4)),((1 2 4, 1 1 1, 2 1 2, 1 2 4)))" ) );
}

void TestQgsTessellator::testBadCoordinates()
Expand Down Expand Up @@ -556,7 +556,7 @@ void TestQgsTessellator::narrowPolygon()
QgsGeometry res( t.asMultiPolygon() );
res.translate( polygon.boundingBox().xMinimum(), polygon.boundingBox().yMinimum() );
QgsDebugMsgLevel( res.asWkt( 0 ), 1 );
QCOMPARE( res.asWkt( 0 ), QStringLiteral( "MultiPolygonZ (((383357 4902094 0, 383356 4902092 0, 383356 4902091 0, 383357 4902094 0)),((383357 4902088 0, 383357 4902094 0, 383356 4902091 0, 383357 4902088 0)),((383357 4902088 0, 383361 4902086 0, 383357 4902094 0, 383357 4902088 0)),((383357 4902094 0, 383361 4902086 0, 383360 4902094 0, 383357 4902094 0)),((383363 4902094 0, 383360 4902094 0, 383361 4902086 0, 383363 4902094 0)),((383368 4902093 0, 383363 4902094 0, 383361 4902086 0, 383368 4902093 0)),((383368 4902093 0, 383361 4902086 0, 383369 4902085 0, 383368 4902093 0)),((383368 4902093 0, 383369 4902085 0, 383375 4902093 0, 383368 4902093 0)),((383375 4902093 0, 383369 4902085 0, 383380 4902084 0, 383375 4902093 0)),((383375 4902093 0, 383380 4902084 0, 383384 4902093 0, 383375 4902093 0)),((383384 4902093 0, 383380 4902084 0, 383396 4902084 0, 383384 4902093 0)),((383394 4902094 0, 383384 4902093 0, 383396 4902084 0, 383394 4902094 0)),((383403 4902094 0, 383394 4902094 0, 383396 4902084 0, 383403 4902094 0)),((383396 4902084 0, 383407 4902084 0, 383403 4902094 0, 383396 4902084 0)),((383411 4902094 0, 383403 4902094 0, 383407 4902084 0, 383411 4902094 0)),((383411 4902094 0, 383407 4902084 0, 383413 4902085 0, 383411 4902094 0)),((383411 4902094 0, 383413 4902085 0, 383416 4902093 0, 383411 4902094 0)),((383416 4902093 0, 383413 4902085 0, 383417 4902086 0, 383416 4902093 0)),((383419 4902088 0, 383416 4902093 0, 383417 4902086 0, 383419 4902088 0)),((383418 4902092 0, 383416 4902093 0, 383419 4902088 0, 383418 4902092 0)),((383418 4902092 0, 383419 4902088 0, 383419 4902091 0, 383418 4902092 0)),((383419 4902091 0, 383419 4902088 0, 383420 4902090 0, 383419 4902091 0)))" ) );
QCOMPARE( res.asWkt( 0 ), QStringLiteral( "MultiPolygon Z (((383357 4902094 0, 383356 4902092 0, 383356 4902091 0, 383357 4902094 0)),((383357 4902088 0, 383357 4902094 0, 383356 4902091 0, 383357 4902088 0)),((383357 4902088 0, 383361 4902086 0, 383357 4902094 0, 383357 4902088 0)),((383357 4902094 0, 383361 4902086 0, 383360 4902094 0, 383357 4902094 0)),((383363 4902094 0, 383360 4902094 0, 383361 4902086 0, 383363 4902094 0)),((383368 4902093 0, 383363 4902094 0, 383361 4902086 0, 383368 4902093 0)),((383368 4902093 0, 383361 4902086 0, 383369 4902085 0, 383368 4902093 0)),((383368 4902093 0, 383369 4902085 0, 383375 4902093 0, 383368 4902093 0)),((383375 4902093 0, 383369 4902085 0, 383380 4902084 0, 383375 4902093 0)),((383375 4902093 0, 383380 4902084 0, 383384 4902093 0, 383375 4902093 0)),((383384 4902093 0, 383380 4902084 0, 383396 4902084 0, 383384 4902093 0)),((383394 4902094 0, 383384 4902093 0, 383396 4902084 0, 383394 4902094 0)),((383403 4902094 0, 383394 4902094 0, 383396 4902084 0, 383403 4902094 0)),((383396 4902084 0, 383407 4902084 0, 383403 4902094 0, 383396 4902084 0)),((383411 4902094 0, 383403 4902094 0, 383407 4902084 0, 383411 4902094 0)),((383411 4902094 0, 383407 4902084 0, 383413 4902085 0, 383411 4902094 0)),((383411 4902094 0, 383413 4902085 0, 383416 4902093 0, 383411 4902094 0)),((383416 4902093 0, 383413 4902085 0, 383417 4902086 0, 383416 4902093 0)),((383419 4902088 0, 383416 4902093 0, 383417 4902086 0, 383419 4902088 0)),((383418 4902092 0, 383416 4902093 0, 383419 4902088 0, 383418 4902092 0)),((383418 4902092 0, 383419 4902088 0, 383419 4902091 0, 383418 4902092 0)),((383419 4902091 0, 383419 4902088 0, 383420 4902090 0, 383419 4902091 0)))" ) );
}

QGSTEST_MAIN( TestQgsTessellator )
Expand Down
2 changes: 1 addition & 1 deletion tests/src/analysis/testqgsprocessing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2455,7 +2455,7 @@ void TestQgsProcessing::createFeatureSink()
QgsFeatureIterator it = layer->getFeatures();
QVERIFY( it.nextFeature( f ) );
QCOMPARE( f.attributes().at( 1 ).toString(), QStringLiteral( "val" ) );
QCOMPARE( f.geometry().asWkt( 1 ), QStringLiteral( "PointZ (1 2 3)" ) );
QCOMPARE( f.geometry().asWkt( 1 ), QStringLiteral( "Point Z (1 2 3)" ) );
QVERIFY( it.nextFeature( f ) );
QCOMPARE( f.attributes().at( 1 ).toString(), QStringLiteral( "val2" ) );
QGSCOMPARENEAR( f.geometry().asPoint().x(), -10199761, 10 );
Expand Down
38 changes: 19 additions & 19 deletions tests/src/analysis/testqgsprocessingalgspt2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -556,36 +556,36 @@ void TestQgsProcessingAlgsPt2::exportMeshVertices()
QgsFeatureIterator featIt = resultLayer->getFeatures();
QgsFeature feat;
featIt.nextFeature( feat );
QCOMPARE( QStringLiteral( "PointZ (1000 2000 20)" ), feat.geometry().asWkt() );
QCOMPARE( QStringLiteral( "Point Z (1000 2000 20)" ), feat.geometry().asWkt() );
QCOMPARE( feat.attributes().at( 0 ).toDouble(), 2.0 );
QCOMPARE( feat.attributes().at( 1 ).toDouble(), 2.0 );
QCOMPARE( feat.attributes().at( 2 ).toDouble(), 2.0 );
QVERIFY( qgsDoubleNearSig( feat.attributes().at( 3 ).toDouble(), 2.828, 2 ) );
QVERIFY( qgsDoubleNearSig( feat.attributes().at( 4 ).toDouble(), 45.0, 2 ) );

featIt.nextFeature( feat );
QCOMPARE( QStringLiteral( "PointZ (2000 2000 30)" ), feat.geometry().asWkt() );
QCOMPARE( QStringLiteral( "Point Z (2000 2000 30)" ), feat.geometry().asWkt() );
QCOMPARE( feat.attributes().at( 0 ).toDouble(), 3.0 );
QCOMPARE( feat.attributes().at( 1 ).toDouble(), 3.0 );
QCOMPARE( feat.attributes().at( 2 ).toDouble(), 2.0 );
QVERIFY( qgsDoubleNearSig( feat.attributes().at( 3 ).toDouble(), 3.605, 2 ) );
QVERIFY( qgsDoubleNearSig( feat.attributes().at( 4 ).toDouble(), 56.3099, 2 ) );
featIt.nextFeature( feat );
QCOMPARE( QStringLiteral( "PointZ (3000 2000 40)" ), feat.geometry().asWkt() );
QCOMPARE( QStringLiteral( "Point Z (3000 2000 40)" ), feat.geometry().asWkt() );
QCOMPARE( feat.attributes().at( 0 ).toDouble(), 4.0 );
QCOMPARE( feat.attributes().at( 1 ).toDouble(), 4.0 );
QCOMPARE( feat.attributes().at( 2 ).toDouble(), 3.0 );
QVERIFY( qgsDoubleNearSig( feat.attributes().at( 3 ).toDouble(), 5.0, 2 ) );
QVERIFY( qgsDoubleNearSig( feat.attributes().at( 4 ).toDouble(), 53.130, 2 ) );
featIt.nextFeature( feat );
QCOMPARE( QStringLiteral( "PointZ (2000 3000 50)" ), feat.geometry().asWkt() );
QCOMPARE( QStringLiteral( "Point Z (2000 3000 50)" ), feat.geometry().asWkt() );
QCOMPARE( feat.attributes().at( 0 ).toDouble(), 3.0 );
QCOMPARE( feat.attributes().at( 1 ).toDouble(), 3.0 );
QCOMPARE( feat.attributes().at( 2 ).toDouble(), 3.0 );
QVERIFY( qgsDoubleNearSig( feat.attributes().at( 3 ).toDouble(), 4.242, 2 ) );
QVERIFY( qgsDoubleNearSig( feat.attributes().at( 4 ).toDouble(), 45, 2 ) );
featIt.nextFeature( feat );
QCOMPARE( QStringLiteral( "PointZ (1000 3000 10)" ), feat.geometry().asWkt() );
QCOMPARE( QStringLiteral( "Point Z (1000 3000 10)" ), feat.geometry().asWkt() );
QCOMPARE( feat.attributes().at( 0 ).toDouble(), 2.0 );
QCOMPARE( feat.attributes().at( 1 ).toDouble(), 2.0 );
QCOMPARE( feat.attributes().at( 2 ).toDouble(), -1.0 );
Expand Down Expand Up @@ -638,15 +638,15 @@ void TestQgsProcessingAlgsPt2::exportMeshFaces()
QgsFeatureIterator featIt = resultLayer->getFeatures();
QgsFeature feat;
featIt.nextFeature( feat );
QCOMPARE( QStringLiteral( "PolygonZ ((1000 2000 20, 2000 2000 30, 2000 3000 50, 1000 3000 10, 1000 2000 20))" ), feat.geometry().asWkt() );
QCOMPARE( QStringLiteral( "Polygon Z ((1000 2000 20, 2000 2000 30, 2000 3000 50, 1000 3000 10, 1000 2000 20))" ), feat.geometry().asWkt() );
QCOMPARE( feat.attributes().at( 0 ).toDouble(), 2.0 );
QCOMPARE( feat.attributes().at( 1 ).toDouble(), 2.0 );
QCOMPARE( feat.attributes().at( 2 ).toDouble(), 2.0 );
QVERIFY( qgsDoubleNearSig( feat.attributes().at( 3 ).toDouble(), 2.828, 2 ) );
QVERIFY( qgsDoubleNearSig( feat.attributes().at( 4 ).toDouble(), 45.0, 2 ) );

featIt.nextFeature( feat );
QCOMPARE( QStringLiteral( "PolygonZ ((2000 2000 30, 3000 2000 40, 2000 3000 50, 2000 2000 30))" ), feat.geometry().asWkt() );
QCOMPARE( QStringLiteral( "Polygon Z ((2000 2000 30, 3000 2000 40, 2000 3000 50, 2000 2000 30))" ), feat.geometry().asWkt() );
QCOMPARE( feat.attributes().at( 0 ).toDouble(), 3.0 );
QCOMPARE( feat.attributes().at( 1 ).toDouble(), 3.0 );
QCOMPARE( feat.attributes().at( 2 ).toDouble(), 3.0 );
Expand Down Expand Up @@ -699,23 +699,23 @@ void TestQgsProcessingAlgsPt2::exportMeshEdges()
QgsFeatureIterator featIt = resultLayer->getFeatures();
QgsFeature feat;
featIt.nextFeature( feat );
QCOMPARE( QStringLiteral( "LineStringZ (1000 2000 20, 2000 2000 30)" ), feat.geometry().asWkt() );
QCOMPARE( QStringLiteral( "LineString Z (1000 2000 20, 2000 2000 30)" ), feat.geometry().asWkt() );
QCOMPARE( feat.attributes().at( 0 ).toDouble(), 2.0 );
QCOMPARE( feat.attributes().at( 1 ).toDouble(), 2.0 );
QCOMPARE( feat.attributes().at( 2 ).toDouble(), 2.0 );
QVERIFY( qgsDoubleNearSig( feat.attributes().at( 3 ).toDouble(), 2.828, 2 ) );
QVERIFY( qgsDoubleNearSig( feat.attributes().at( 4 ).toDouble(), 45.0, 2 ) );

featIt.nextFeature( feat );
QCOMPARE( QStringLiteral( "LineStringZ (2000 2000 30, 3000 2000 40)" ), feat.geometry().asWkt() );
QCOMPARE( QStringLiteral( "LineString Z (2000 2000 30, 3000 2000 40)" ), feat.geometry().asWkt() );
QCOMPARE( feat.attributes().at( 0 ).toDouble(), 3.0 );
QCOMPARE( feat.attributes().at( 1 ).toDouble(), 3.0 );
QCOMPARE( feat.attributes().at( 2 ).toDouble(), 3.0 );
QVERIFY( qgsDoubleNearSig( feat.attributes().at( 3 ).toDouble(), 4.242, 2 ) );
QVERIFY( qgsDoubleNearSig( feat.attributes().at( 4 ).toDouble(), 45.0, 2 ) );

featIt.nextFeature( feat );
QCOMPARE( QStringLiteral( "LineStringZ (3000 2000 40, 2000 3000 50)" ), feat.geometry().asWkt() );
QCOMPARE( QStringLiteral( "LineString Z (3000 2000 40, 2000 3000 50)" ), feat.geometry().asWkt() );
QCOMPARE( feat.attributes().at( 0 ).toDouble(), 4.0 );
QCOMPARE( feat.attributes().at( 1 ).toDouble(), 4.0 );
QCOMPARE( feat.attributes().at( 2 ).toDouble(), 4.0 );
Expand Down Expand Up @@ -925,22 +925,22 @@ void TestQgsProcessingAlgsPt2::exportMeshContours()
QgsFeatureIterator featIt = resultLinesLayer->getFeatures();
QgsFeature feat;
featIt.nextFeature( feat );
QCOMPARE( QStringLiteral( "LineStringZ (1250 3000 20, 1250 2250 27.5, 1250 2000 22.5)" ), feat.geometry().asWkt() );
QCOMPARE( QStringLiteral( "LineString Z (1250 3000 20, 1250 2250 27.5, 1250 2000 22.5)" ), feat.geometry().asWkt() );
QCOMPARE( feat.attributes().at( 0 ).toString(), QStringLiteral( "VertexScalarDataset" ) );
QCOMPARE( feat.attributes().at( 1 ).toString(), QStringLiteral( "1950-01-01 01:00:00" ) );
QCOMPARE( feat.attributes().at( 2 ).toDouble(), 2.25 );
featIt.nextFeature( feat );
QCOMPARE( QStringLiteral( "LineStringZ (1006.94319345290614365 3000 10.27772773811624596, 1000 2976.48044676110157525 10.23519553238898538)" ), feat.geometry().asWkt() );
QCOMPARE( QStringLiteral( "LineString Z (1006.94319345290614365 3000 10.27772773811624596, 1000 2976.48044676110157525 10.23519553238898538)" ), feat.geometry().asWkt() );
QCOMPARE( feat.attributes().at( 0 ).toString(), QStringLiteral( "VertexVectorDataset" ) );
QCOMPARE( feat.attributes().at( 1 ).toString(), QStringLiteral( "1950-01-01 01:00:00" ) );
QCOMPARE( feat.attributes().at( 2 ).toDouble(), 2.25 );
featIt.nextFeature( feat );
QCOMPARE( QStringLiteral( "LineStringZ (2009.71706923721990279 2990.28293076277986984 49.90282930762779756, 2462.15304528350043256 2000 34.62153045283500319)" ), feat.geometry().asWkt() );
QCOMPARE( QStringLiteral( "LineString Z (2009.71706923721990279 2990.28293076277986984 49.90282930762779756, 2462.15304528350043256 2000 34.62153045283500319)" ), feat.geometry().asWkt() );
QCOMPARE( feat.attributes().at( 0 ).toString(), QStringLiteral( "VertexVectorDataset" ) );
QCOMPARE( feat.attributes().at( 1 ).toString(), QStringLiteral( "1950-01-01 01:00:00" ) );
QCOMPARE( feat.attributes().at( 2 ).toDouble(), 4.25 );
featIt.nextFeature( feat );
QCOMPARE( QStringLiteral( "LineStringZ (1500 3000 30, 1500 2500 35, 1500 2000 25)" ), feat.geometry().asWkt() );
QCOMPARE( QStringLiteral( "LineString Z (1500 3000 30, 1500 2500 35, 1500 2000 25)" ), feat.geometry().asWkt() );
QCOMPARE( feat.attributes().at( 0 ).toString(), QStringLiteral( "FaceScalarDataset" ) );
QCOMPARE( feat.attributes().at( 1 ).toString(), QStringLiteral( "1950-01-01 01:00:00" ) );
QCOMPARE( feat.attributes().at( 2 ).toDouble(), 2.25 );
Expand All @@ -960,23 +960,23 @@ void TestQgsProcessingAlgsPt2::exportMeshContours()
featIt.nextFeature( feat );
QgsGeometry geom = feat.geometry();
geom.normalize();
QCOMPARE( geom.asWkt(), QStringLiteral( "PolygonZ ((1000 2000 20, 1000 3000 10, 1250 3000 20, 1250 2250 27.5, 1250 2000 22.5, 1000 2000 20))" ) );
QCOMPARE( geom.asWkt(), QStringLiteral( "Polygon Z ((1000 2000 20, 1000 3000 10, 1250 3000 20, 1250 2250 27.5, 1250 2000 22.5, 1000 2000 20))" ) );
QCOMPARE( feat.attributes().at( 0 ).toString(), QStringLiteral( "VertexScalarDataset" ) );
QCOMPARE( feat.attributes().at( 1 ).toString(), QStringLiteral( "1950-01-01 01:00:00" ) );
QCOMPARE( feat.attributes().at( 2 ).toDouble(), 0.25 );
QCOMPARE( feat.attributes().at( 3 ).toDouble(), 2.25 );
featIt.nextFeature( feat );
geom = feat.geometry();
geom.normalize();
QCOMPARE( geom.asWkt(), QStringLiteral( "PolygonZ ((1250 2000 22.5, 1250 2250 27.5, 1250 3000 20, 2000 3000 50, 3000 2000 40, 2000 2000 30, 1250 2000 22.5))" ) );
QCOMPARE( geom.asWkt(), QStringLiteral( "Polygon Z ((1250 2000 22.5, 1250 2250 27.5, 1250 3000 20, 2000 3000 50, 3000 2000 40, 2000 2000 30, 1250 2000 22.5))" ) );
QCOMPARE( feat.attributes().at( 0 ).toString(), QStringLiteral( "VertexScalarDataset" ) );
QCOMPARE( feat.attributes().at( 1 ).toString(), QStringLiteral( "1950-01-01 01:00:00" ) );
QCOMPARE( feat.attributes().at( 2 ).toDouble(), 2.25 );
QCOMPARE( feat.attributes().at( 3 ).toDouble(), 4.25 );
featIt.nextFeature( feat );
geom = feat.geometry();
geom.normalize();
QCOMPARE( geom.asWkt( 2 ), QStringLiteral( "PolygonZ ((1000 2976.48 10.24, 1000 3000 10, 1006.94 3000 10.28, 1000 2976.48 10.24))" ) );
QCOMPARE( geom.asWkt( 2 ), QStringLiteral( "Polygon Z ((1000 2976.48 10.24, 1000 3000 10, 1006.94 3000 10.28, 1000 2976.48 10.24))" ) );
QCOMPARE( feat.attributes().at( 0 ).toString(), QStringLiteral( "VertexVectorDataset" ) );
QCOMPARE( feat.attributes().at( 1 ).toString(), QStringLiteral( "1950-01-01 01:00:00" ) );
QCOMPARE( feat.attributes().at( 2 ).toDouble(), 0.25 );
Expand All @@ -985,15 +985,15 @@ void TestQgsProcessingAlgsPt2::exportMeshContours()
featIt.nextFeature( feat );
geom = feat.geometry();
geom.normalize();
QCOMPARE( geom.asWkt(), QStringLiteral( "PolygonZ ((1000 2000 20, 1000 3000 10, 1500 3000 30, 1500 2500 35, 1500 2000 25, 1000 2000 20))" ) );
QCOMPARE( geom.asWkt(), QStringLiteral( "Polygon Z ((1000 2000 20, 1000 3000 10, 1500 3000 30, 1500 2500 35, 1500 2000 25, 1000 2000 20))" ) );
QCOMPARE( feat.attributes().at( 0 ).toString(), QStringLiteral( "FaceScalarDataset" ) );
QCOMPARE( feat.attributes().at( 1 ).toString(), QStringLiteral( "1950-01-01 01:00:00" ) );
QCOMPARE( feat.attributes().at( 2 ).toDouble(), 0.25 );
QCOMPARE( feat.attributes().at( 3 ).toDouble(), 2.25 );
featIt.nextFeature( feat );
geom = feat.geometry();
geom.normalize();
QCOMPARE( geom.asWkt(), QStringLiteral( "PolygonZ ((1500 2000 25, 1500 2500 35, 1500 3000 30, 2000 3000 50, 3000 2000 40, 2000 2000 30, 1500 2000 25))" ) );
QCOMPARE( geom.asWkt(), QStringLiteral( "Polygon Z ((1500 2000 25, 1500 2500 35, 1500 3000 30, 2000 3000 50, 3000 2000 40, 2000 2000 30, 1500 2000 25))" ) );
QCOMPARE( feat.attributes().at( 0 ).toString(), QStringLiteral( "FaceScalarDataset" ) );
QCOMPARE( feat.attributes().at( 1 ).toString(), QStringLiteral( "1950-01-01 01:00:00" ) );
QCOMPARE( feat.attributes().at( 2 ).toDouble(), 2.25 );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ void TestQgsMapToolAddFeaturePointM::testPointM()

QCOMPARE( mLayerPointM->featureCount(), ( long )2 );

QString wkt = "PointM (4 0 333)";
QString wkt = "Point M (4 0 333)";
QCOMPARE( mLayerPointM->getFeature( newFid ).geometry().asWkt(), wkt );

mLayerPointM->undoStack()->undo();
Expand All @@ -138,7 +138,7 @@ void TestQgsMapToolAddFeaturePointM::testPointM()
utils.mouseClick( 6, 6, Qt::LeftButton, Qt::KeyboardModifiers(), true );
newFid = utils.newFeatureId( oldFids );

wkt = "PointM (6 6 123)";
wkt = "Point M (6 6 123)";
QCOMPARE( mLayerPointM->getFeature( newFid ).geometry().asWkt(), wkt );

mLayerPointM->undoStack()->undo();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ void TestQgsMapToolAddFeaturePointZ::testPointZ()

QCOMPARE( mLayerPointZ->featureCount(), ( long )2 );

QString wkt = "PointZ (4 0 333)";
QString wkt = "Point Z (4 0 333)";
QCOMPARE( mLayerPointZ->getFeature( newFid ).geometry().asWkt(), wkt );

mLayerPointZ->undoStack()->undo();
Expand All @@ -176,7 +176,7 @@ void TestQgsMapToolAddFeaturePointZ::testPointZ()
utils.mouseClick( 6, 6, Qt::LeftButton, Qt::KeyboardModifiers(), true );
newFid = utils.newFeatureId( oldFids );

wkt = "PointZ (6 6 3)";
wkt = "Point Z (6 6 3)";
QCOMPARE( mLayerPointZ->getFeature( newFid ).geometry().asWkt(), wkt );

mLayerPointZ->undoStack()->undo();
Expand All @@ -199,13 +199,13 @@ void TestQgsMapToolAddFeaturePointZ::testTopologicalEditingZ()

QCOMPARE( mLayerPointZ->featureCount(), ( long )2 );

QString wkt = "PointZ (3 3 3)";
QString wkt = "Point Z (3 3 3)";
QCOMPARE( mLayerPointZ->getFeature( newFid ).geometry().asWkt(), wkt );


QCOMPARE( mLayerLineZSnap->featureCount(), ( long )1 );

wkt = "LineStringZ (1 1 1, 3 3 3, 5 5 5)";
wkt = "LineString Z (1 1 1, 3 3 3, 5 5 5)";
QgsFeature f;
QgsFeatureIterator it = mLayerLineZSnap->getFeatures();
it.nextFeature( f );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ void TestQgsMapToolAddFeaturePointZM::testPointZM()

QCOMPARE( mLayerPointZM->featureCount(), ( long )2 );

QString wkt = "PointZM (4 0 123 333)";
QString wkt = "Point ZM (4 0 123 333)";
QCOMPARE( mLayerPointZM->getFeature( newFid ).geometry().asWkt(), wkt );

mLayerPointZM->undoStack()->undo();
Expand All @@ -142,7 +142,7 @@ void TestQgsMapToolAddFeaturePointZM::testPointZM()
utils.mouseClick( 6, 6, Qt::LeftButton, Qt::KeyboardModifiers(), true );
newFid = utils.newFeatureId( oldFids );

wkt = "PointZM (6 6 345 123)";
wkt = "Point ZM (6 6 345 123)";
QCOMPARE( mLayerPointZM->getFeature( newFid ).geometry().asWkt(), wkt );

mLayerPointZM->undoStack()->undo();
Expand Down
2 changes: 1 addition & 1 deletion tests/src/app/testqgsadvanceddigitizing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,7 @@ void TestQgsAdvancedDigitizing::coordinateConstraintWithZM()
utils.mouseClick( 0, 2, Qt::RightButton );

QCOMPARE( getWktFromLastAddedFeature( utils, oldFeatures ),
QStringLiteral( "LineStringZM (5 0 33 66, 3 5 33 66, 4 4 5 66, 6 6 33 5, 9 9 9 9)" ) );
QStringLiteral( "LineString ZM (5 0 33 66, 3 5 33 66, 4 4 5 66, 6 6 33 5, 9 9 9 9)" ) );
}

void TestQgsAdvancedDigitizing::coordinateConstraintWhenSnapping()
Expand Down
Loading
Loading