|
@@ -9,7 +9,6 @@ from grass.gunittest.main import test
|
|
|
from grass.gunittest.gmodules import SimpleModule
|
|
|
|
|
|
from grass.script.core import run_command
|
|
|
-from grass.script.utils import decode
|
|
|
|
|
|
|
|
|
class TestVDbDropRow(TestCase):
|
|
@@ -18,7 +17,7 @@ class TestVDbDropRow(TestCase):
|
|
|
mapName = "elevation"
|
|
|
inputMap = "rand5k_elev"
|
|
|
outputMap = "rand5k_elev_filt"
|
|
|
- values = "min=56.12\nmax=155.157"
|
|
|
+ values = "min=100.013\nmax=149.102"
|
|
|
|
|
|
@classmethod
|
|
|
def setUpClass(cls):
|
|
@@ -37,9 +36,9 @@ class TestVDbDropRow(TestCase):
|
|
|
|
|
|
def test_drop_row_check(self):
|
|
|
"""Drop vector object from a vector map"""
|
|
|
- run_command("v.random", output=self.inputMap, n=5000)
|
|
|
+ run_command("v.mkgrid", map=self.inputMap, grid=[10, 10], type="point")
|
|
|
run_command(
|
|
|
- "v.db.addtable", map=self.inputMap, column="elevation double precision"
|
|
|
+ "v.db.addcolumn", map=self.inputMap, column="elevation double precision"
|
|
|
)
|
|
|
run_command(
|
|
|
"v.what.rast", map=self.inputMap, raster=self.mapName, column=self.mapName
|
|
@@ -49,12 +48,15 @@ class TestVDbDropRow(TestCase):
|
|
|
"v.db.droprow",
|
|
|
input=self.inputMap,
|
|
|
output=self.outputMap,
|
|
|
- where="elevation IS NULL",
|
|
|
+ where="elevation < 100",
|
|
|
)
|
|
|
self.assertModule(module)
|
|
|
|
|
|
self.assertVectorFitsUnivar(
|
|
|
- map=self.outputMap, column="elevation", reference=self.values, precision=5
|
|
|
+ map=self.outputMap,
|
|
|
+ column="elevation",
|
|
|
+ reference=self.values,
|
|
|
+ precision=0.001,
|
|
|
)
|
|
|
|
|
|
|