mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-26 00:02:08 -05:00
adapt some tests to 'better' wkt (followup b1efd479)
This commit is contained in:
parent
8fc14f8ac0
commit
ba35b23fd5
@ -211,7 +211,7 @@ double QgsRasterChecker::tolerance( double val, int places )
|
||||
QString QgsRasterChecker::compareHead()
|
||||
{
|
||||
QString html;
|
||||
html += QString( "<tr><th style='%1'>Param name</th><th style='%1'>Verified value</th><th style='%1'>Eexpected value</th><th style='%1'>Difference</th><th style='%1'>Tolerance</th></tr>" ).arg( mCellStyle );
|
||||
html += QString( "<tr><th style='%1'>Param name</th><th style='%1'>Verified value</th><th style='%1'>Expected value</th><th style='%1'>Difference</th><th style='%1'>Tolerance</th></tr>" ).arg( mCellStyle );
|
||||
return html;
|
||||
}
|
||||
|
||||
|
@ -80,14 +80,14 @@ void TestQgsOgcUtils::testGeometryToGML()
|
||||
QVERIFY( !elemPoint.isNull() );
|
||||
|
||||
doc.appendChild( elemPoint );
|
||||
QCOMPARE( doc.toString( -1 ), QString( "<gml:Point><gml:coordinates cs=\",\" ts=\" \">111.0,222.0</gml:coordinates></gml:Point>" ) );
|
||||
QCOMPARE( doc.toString( -1 ), QString( "<gml:Point><gml:coordinates cs=\",\" ts=\" \">111,222</gml:coordinates></gml:Point>" ) );
|
||||
doc.removeChild( elemPoint );
|
||||
|
||||
QDomElement elemLine = QgsOgcUtils::geometryToGML( geomLine, doc );
|
||||
QVERIFY( !elemLine.isNull() );
|
||||
|
||||
doc.appendChild( elemLine );
|
||||
QCOMPARE( doc.toString( -1 ), QString( "<gml:LineString><gml:coordinates cs=\",\" ts=\" \">111.0,222.0 222.0,222.0</gml:coordinates></gml:LineString>" ) );
|
||||
QCOMPARE( doc.toString( -1 ), QString( "<gml:LineString><gml:coordinates cs=\",\" ts=\" \">111,222 222,222</gml:coordinates></gml:LineString>" ) );
|
||||
doc.removeChild( elemLine );
|
||||
|
||||
// Test GML3
|
||||
@ -98,14 +98,14 @@ void TestQgsOgcUtils::testGeometryToGML()
|
||||
QVERIFY( !elemPoint.isNull() );
|
||||
|
||||
doc.appendChild( elemPoint );
|
||||
QCOMPARE( doc.toString( -1 ), QString( "<gml:Point><gml:pos srsDimension=\"2\">111.0 222.0</gml:pos></gml:Point>" ) );
|
||||
QCOMPARE( doc.toString( -1 ), QString( "<gml:Point><gml:pos srsDimension=\"2\">111 222</gml:pos></gml:Point>" ) );
|
||||
doc.removeChild( elemPoint );
|
||||
|
||||
elemLine = QgsOgcUtils::geometryToGML( geomLine, doc, "GML3" );
|
||||
QVERIFY( !elemLine.isNull() );
|
||||
|
||||
doc.appendChild( elemLine );
|
||||
QCOMPARE( doc.toString( -1 ), QString( "<gml:LineString><gml:posList srsDimension=\"2\">111.0 222.0 222.0 222.0</gml:posList></gml:LineString>" ) );
|
||||
QCOMPARE( doc.toString( -1 ), QString( "<gml:LineString><gml:posList srsDimension=\"2\">111 222 222 222</gml:posList></gml:LineString>" ) );
|
||||
doc.removeChild( elemLine );
|
||||
|
||||
delete geomPoint;
|
||||
@ -315,15 +315,15 @@ void TestQgsOgcUtils::testExpressionToOgcFilter_data()
|
||||
"<ogc:Filter>"
|
||||
"<ogc:Intersects>"
|
||||
"<ogc:PropertyName>geometry</ogc:PropertyName>"
|
||||
"<gml:Point><gml:coordinates cs=\",\" ts=\" \">5.0,6.0</gml:coordinates></gml:Point>"
|
||||
"<gml:Point><gml:coordinates cs=\",\" ts=\" \">5,6</gml:coordinates></gml:Point>"
|
||||
"</ogc:Intersects>"
|
||||
"</ogc:Filter>" );
|
||||
|
||||
QTest::newRow( "contains + gml" ) << QString( "contains($geometry, geomFromGML('<Point><coordinates cs=\",\" ts=\" \">5.0,6.0</coordinates></Point>'))" ) << QString(
|
||||
QTest::newRow( "contains + gml" ) << QString( "contains($geometry, geomFromGML('<Point><coordinates cs=\",\" ts=\" \">5,6</coordinates></Point>'))" ) << QString(
|
||||
"<ogc:Filter>"
|
||||
"<ogc:Contains>"
|
||||
"<ogc:PropertyName>geometry</ogc:PropertyName>"
|
||||
"<Point><coordinates cs=\",\" ts=\" \">5.0,6.0</coordinates></Point>"
|
||||
"<Point><coordinates cs=\",\" ts=\" \">5,6</coordinates></Point>"
|
||||
"</ogc:Contains>"
|
||||
"</ogc:Filter>" );
|
||||
|
||||
|
@ -321,7 +321,7 @@ class TestQgsGeometry(TestCase):
|
||||
#print 'Difference: %s' % myDifferenceGeometry.exportToWkt()
|
||||
print 'Symmetrical: %s' % mySymmetricalGeometry.exportToWkt()
|
||||
|
||||
myExpectedWkt = 'LINESTRING(20.0 20.0, 30.0 30.0)'
|
||||
myExpectedWkt = 'LINESTRING(20 20, 30 30)'
|
||||
# There should only be one feature that intersects this clip
|
||||
# poly so this assertion should work.
|
||||
self.assertEqual(myExpectedWkt,
|
||||
|
@ -179,8 +179,8 @@ class TestQgsRectangle(TestCase):
|
||||
def testAsWktCoordinates(self):
|
||||
"""Test that we can get a proper wkt representation fo the rect"""
|
||||
rect1 = QgsRectangle( 0.0, 0.0, 5.0, 5.0)
|
||||
myExpectedWkt = ('0.0 0.0, '
|
||||
'5.0 5.0')
|
||||
myExpectedWkt = ('0 0, '
|
||||
'5 5')
|
||||
myWkt = rect1.asWktCoordinates()
|
||||
myMessage = ('Expected: %s\nGot: %s\n' %
|
||||
(myExpectedWkt, myWkt))
|
||||
@ -189,11 +189,11 @@ class TestQgsRectangle(TestCase):
|
||||
def testAsWktPolygon(self):
|
||||
"""Test that we can get a proper rect wkt polygon representation for rect"""
|
||||
rect1 = QgsRectangle( 0.0, 0.0, 5.0, 5.0)
|
||||
myExpectedWkt = ('POLYGON((0.0 0.0, '
|
||||
'5.0 0.0, '
|
||||
'5.0 5.0, '
|
||||
'0.0 5.0, '
|
||||
'0.0 0.0))')
|
||||
myExpectedWkt = ('POLYGON((0 0, '
|
||||
'5 0, '
|
||||
'5 5, '
|
||||
'0 5, '
|
||||
'0 0))')
|
||||
myWkt = rect1.asWktPolygon()
|
||||
myMessage = ('Expected: %s\nGot: %s\n' %
|
||||
(myExpectedWkt, myWkt))
|
||||
|
Loading…
x
Reference in New Issue
Block a user