Skip to content
Permalink
Browse files

Adjust test result

  • Loading branch information
nyalldawson committed Feb 4, 2017
1 parent bc7f311 commit c0516a46e55ece3defad55a1fa5f964a55b92dd2
Showing with 4 additions and 4 deletions.
  1. +3 −3 tests/src/python/test_qgsgeometry.py
  2. +1 −1 tests/testdata/geom_data.csv
@@ -194,17 +194,17 @@ def testReferenceGeometry(self):
# test area calculation
exp = float(row['area'])
result = geom.geometry().area()
assert doubleNear(result, exp), "Area {}: mismatch Expected:\n{}\nGot:\n{}\n".format(i + 1, exp, result)
self.assertAlmostEqual(result, exp, 5, "Area {}: mismatch Expected:\n{}\nGot:\n{}\n".format(i + 1, exp, result))

# test length calculation
exp = float(row['length'])
result = geom.geometry().length()
assert doubleNear(result, exp, 0.00001), "Length {}: mismatch Expected:\n{}\nGot:\n{}\n".format(i + 1, exp, result)
self.assertAlmostEqual(result, exp, 5, "Length {}: mismatch Expected:\n{}\nGot:\n{}\n".format(i + 1, exp, result))

# test perimeter calculation
exp = float(row['perimeter'])
result = geom.geometry().perimeter()
assert doubleNear(result, exp, 0.00001), "Perimeter {}: mismatch Expected:\n{}\nGot:\n{}\n".format(i + 1, exp, result)
self.assertAlmostEqual(result, exp, 5, "Perimeter {}: mismatch Expected:\n{}\nGot:\n{}\n".format(i + 1, exp, result))

def testIntersection(self):
myLine = QgsGeometry.fromPolyline([
@@ -120,4 +120,4 @@ Polygon,,,,,,,,,,,,,,Malformed WKT
"PolygonM ((0 0 1, 10 0 1, 10 10 1, 0 10 1, 0 0 1),(5 5 1, 7 5 1, 7 7 1, 5 7 1, 5 5 1),(1 1 1,2 1 1, 2 2 1, 1 2 1, 1 1 1))","POLYGON M ((0 0 1,10 0 1,10 10 1,0 10 1,0 0 1),(5 5 1,7 5 1,7 7 1,5 7 1,5 5 1),(1 1 1,2 1 1,2 2 1,1 2 1,1 1 1))",15,0,95,52,1,2,0,POINT(4.99473684210526 4.99473684210526),0,0,10,10,
"PolygonZ ((0 0 1 , 10 0 1, 10 10 1, 0 10 1, 0 0 1))","POLYGON Z ((0 0 1,10 0 1,10 10 1,0 10 1,0 0 1))",5,0,100,40,1,0,0,POINT(5 5),0,0,10,10,
"PolygonZ ((0 0 1, 10 0 1, 10 10 1, 0 10 1, 0 0 1),(5 5 1, 7 5 1, 7 7 1 , 5 7 1, 5 5 1))","POLYGON Z ((0 0 1,10 0 1,10 10 1,0 10 1,0 0 1),(5 5 1,7 5 1,7 7 1,5 7 1,5 5 1))",10,0,96,48,1,1,0,POINT(4.95833333333333 4.95833333333333),0,0,10,10,
"CurvePolygon (CompoundCurve ((2678124.57778842002153397 1225804.43286111624911427, 2678251.0684670670889318 1225964.66278979112394154, 2678201.75901959836483002 1226077.95337014575488865, 2678199.27904875669628382 1226083.94340024818666279, 2678198.13904719380661845 1226083.5034040967002511, 2678188.08903313148766756 1226079.56343783461488783, 2678164.688993189483881 1226068.85351158352568746, 2678152.65896565327420831 1226061.85354482522234321, 2678133.63892276119440794 1226050.92359781125560403),CircularString (2678133.63892276119440794 1226050.92359781125560403, 2678124.47892813989892602 1226045.71365369856357574, 2678115.92887723352760077 1226039.55364341707900167, 2678110.39902341179549694 1226025.70413719792850316, 2678113.52874504774808884 1226011.12356549175456166, 2678117.04747172351926565 1226004.70550769660621881, 2678121.17868330329656601 1225998.66349145700223744, 2678122.91810466628521681 1225991.71089569479227066, 2678120.73861891590058804 1225984.88345037144608796, 2678109.63862727722153068 1225981.37343537760898471, 2678097.99861149024218321 1225981.17354299034923315, 2678087.07146158767864108 1225984.57272616261616349, 2678076.13865283969789743 1225987.95366438734345138, 2678068.26173875294625759 1225987.17441278789192438, 2678060.82864314317703247 1225984.45372360944747925, 2678052.37183309439569712 1225977.24715672573074698, 2678045.5285750487819314 1225968.49374381266534328, 2678039.90821403311565518 1225957.94303491595201194, 2678035.46847799280658364 1225946.84372220188379288, 2678033.64745173417031765 1225940.12937669246457517, 2678032.40841578459367156 1225933.28369381325319409, 2678033.68931351415812969 1225925.84029478346928954, 2678036.55834634136408567 1225918.85362965753301978, 2678039.0693440935574472 1225913.78109931806102395, 2678040.70829536207020283 1225908.363577825948596),(2678040.70829536207020283 1225908.363577825948596, 2678124.57778842002153397 1225804.43286111624911427)))","CurvePolygon (CompoundCurve ((2678124.57778842002153397 1225804.43286111624911427, 2678251.0684670670889318 1225964.66278979112394154, 2678201.75901959836483002 1226077.95337014575488865, 2678199.27904875669628382 1226083.94340024818666279, 2678198.13904719380661845 1226083.5034040967002511, 2678188.08903313148766756 1226079.56343783461488783, 2678164.688993189483881 1226068.85351158352568746, 2678152.65896565327420831 1226061.85354482522234321, 2678133.63892276119440794 1226050.92359781125560403),CircularString (2678133.63892276119440794 1226050.92359781125560403, 2678124.47892813989892602 1226045.71365369856357574, 2678115.92887723352760077 1226039.55364341707900167, 2678110.39902341179549694 1226025.70413719792850316, 2678113.52874504774808884 1226011.12356549175456166, 2678117.04747172351926565 1226004.70550769660621881, 2678121.17868330329656601 1225998.66349145700223744, 2678122.91810466628521681 1225991.71089569479227066, 2678120.73861891590058804 1225984.88345037144608796, 2678109.63862727722153068 1225981.37343537760898471, 2678097.99861149024218321 1225981.17354299034923315, 2678087.07146158767864108 1225984.57272616261616349, 2678076.13865283969789743 1225987.95366438734345138, 2678068.26173875294625759 1225987.17441278789192438, 2678060.82864314317703247 1225984.45372360944747925, 2678052.37183309439569712 1225977.24715672573074698, 2678045.5285750487819314 1225968.49374381266534328, 2678039.90821403311565518 1225957.94303491595201194, 2678035.46847799280658364 1225946.84372220188379288, 2678033.64745173417031765 1225940.12937669246457517, 2678032.40841578459367156 1225933.28369381325319409, 2678033.68931351415812969 1225925.84029478346928954, 2678036.55834634136408567 1225918.85362965753301978, 2678039.0693440935574472 1225913.78109931806102395, 2678040.70829536207020283 1225908.363577825948596),(2678040.70829536207020283 1225908.363577825948596, 2678124.57778842002153397 1225804.43286111624911427)))",34,0,32086.0647870698,770.542777805,1,1,0,Point (2678143.67776390677317977 1225948.36456208629533648),2678032.40842,1225804.43286112,2678251.06846707,1226083.94340025,
"CurvePolygon (CompoundCurve ((2678124.57778842002153397 1225804.43286111624911427, 2678251.0684670670889318 1225964.66278979112394154, 2678201.75901959836483002 1226077.95337014575488865, 2678199.27904875669628382 1226083.94340024818666279, 2678198.13904719380661845 1226083.5034040967002511, 2678188.08903313148766756 1226079.56343783461488783, 2678164.688993189483881 1226068.85351158352568746, 2678152.65896565327420831 1226061.85354482522234321, 2678133.63892276119440794 1226050.92359781125560403),CircularString (2678133.63892276119440794 1226050.92359781125560403, 2678124.47892813989892602 1226045.71365369856357574, 2678115.92887723352760077 1226039.55364341707900167, 2678110.39902341179549694 1226025.70413719792850316, 2678113.52874504774808884 1226011.12356549175456166, 2678117.04747172351926565 1226004.70550769660621881, 2678121.17868330329656601 1225998.66349145700223744, 2678122.91810466628521681 1225991.71089569479227066, 2678120.73861891590058804 1225984.88345037144608796, 2678109.63862727722153068 1225981.37343537760898471, 2678097.99861149024218321 1225981.17354299034923315, 2678087.07146158767864108 1225984.57272616261616349, 2678076.13865283969789743 1225987.95366438734345138, 2678068.26173875294625759 1225987.17441278789192438, 2678060.82864314317703247 1225984.45372360944747925, 2678052.37183309439569712 1225977.24715672573074698, 2678045.5285750487819314 1225968.49374381266534328, 2678039.90821403311565518 1225957.94303491595201194, 2678035.46847799280658364 1225946.84372220188379288, 2678033.64745173417031765 1225940.12937669246457517, 2678032.40841578459367156 1225933.28369381325319409, 2678033.68931351415812969 1225925.84029478346928954, 2678036.55834634136408567 1225918.85362965753301978, 2678039.0693440935574472 1225913.78109931806102395, 2678040.70829536207020283 1225908.363577825948596),(2678040.70829536207020283 1225908.363577825948596, 2678124.57778842002153397 1225804.43286111624911427)))","CurvePolygon (CompoundCurve ((2678124.57778842002153397 1225804.43286111624911427, 2678251.0684670670889318 1225964.66278979112394154, 2678201.75901959836483002 1226077.95337014575488865, 2678199.27904875669628382 1226083.94340024818666279, 2678198.13904719380661845 1226083.5034040967002511, 2678188.08903313148766756 1226079.56343783461488783, 2678164.688993189483881 1226068.85351158352568746, 2678152.65896565327420831 1226061.85354482522234321, 2678133.63892276119440794 1226050.92359781125560403),CircularString (2678133.63892276119440794 1226050.92359781125560403, 2678124.47892813989892602 1226045.71365369856357574, 2678115.92887723352760077 1226039.55364341707900167, 2678110.39902341179549694 1226025.70413719792850316, 2678113.52874504774808884 1226011.12356549175456166, 2678117.04747172351926565 1226004.70550769660621881, 2678121.17868330329656601 1225998.66349145700223744, 2678122.91810466628521681 1225991.71089569479227066, 2678120.73861891590058804 1225984.88345037144608796, 2678109.63862727722153068 1225981.37343537760898471, 2678097.99861149024218321 1225981.17354299034923315, 2678087.07146158767864108 1225984.57272616261616349, 2678076.13865283969789743 1225987.95366438734345138, 2678068.26173875294625759 1225987.17441278789192438, 2678060.82864314317703247 1225984.45372360944747925, 2678052.37183309439569712 1225977.24715672573074698, 2678045.5285750487819314 1225968.49374381266534328, 2678039.90821403311565518 1225957.94303491595201194, 2678035.46847799280658364 1225946.84372220188379288, 2678033.64745173417031765 1225940.12937669246457517, 2678032.40841578459367156 1225933.28369381325319409, 2678033.68931351415812969 1225925.84029478346928954, 2678036.55834634136408567 1225918.85362965753301978, 2678039.0693440935574472 1225913.78109931806102395, 2678040.70829536207020283 1225908.363577825948596),(2678040.70829536207020283 1225908.363577825948596, 2678124.57778842002153397 1225804.43286111624911427)))",34,0,32087.8047511,770.542777805,1,1,0,Point (2678143.67776390677317977 1225948.36456208629533648),2678032.40842,1225804.43286112,2678251.06846707,1226083.94340025,

0 comments on commit c0516a4

Please sign in to comment.
You can’t perform that action at this time.