diff --git a/packages/gis/lua/Layer.lua b/packages/gis/lua/Layer.lua index 22ebfbc8..38923aa8 100644 --- a/packages/gis/lua/Layer.lua +++ b/packages/gis/lua/Layer.lua @@ -1396,9 +1396,6 @@ Layer_ = { --- Checks if data layer geometries are valid. -- If some invalid geometry are found, a warning is show about the problem. -- Return true if no problem is found. - -- @arg fix A boolean value which if true tries to fix the geometries problems found. - -- If not set, its value will be false. - -- If it is not possible fix the geometries a error will be show. -- @arg progress A boolean value indicating whether progress will be shown while fixing the geometries. -- @usage --DONTRUN -- local layer = Layer{ @@ -1410,14 +1407,12 @@ Layer_ = { -- if not layer:check() then -- layer:check(true) -- end - check = function(self, fix, progress) - optionalArgument(2, "boolean", fix) - if fix == nil then fix = false end - optionalArgument(3, "boolean", progress) + check = function(self, progress) + optionalArgument(2, "boolean", progress) if progress == nil then progress = true end TerraLib().setProgressVisible(progress) - local problems = TerraLib().checkLayerGeometries(self.project, self.name, fix) + local problems = TerraLib().checkLayerGeometries(self.project, self.name) if #problems > 0 then customWarning(formatCheckGeometriesMsg(problems)) diff --git a/packages/gis/lua/TerraLib.lua b/packages/gis/lua/TerraLib.lua index 79d40ab9..b134bef8 100644 --- a/packages/gis/lua/TerraLib.lua +++ b/packages/gis/lua/TerraLib.lua @@ -3681,11 +3681,10 @@ TerraLib_ = { -- If invalid geometries are found, it returns a list of the problems. -- @arg project A project. -- @arg layerName The name of the layer. - -- @arg fix A boolean value which if true tries to fix the geometries problems founded. -- @usage --DONTRUN -- local problems = TerraLib().checkLayerGeometries(self.project, self.name) -- print(problems[1].error, problems[1].coord.x, problems[1].coord.y) - checkLayerGeometries = function(project, layerName, fix) + checkLayerGeometries = function(project, layerName) local problems = {} local fixErrorMsg = "" @@ -3707,13 +3706,6 @@ TerraLib_ = { coord = {x = problem.coordX, y = problem.coordY}}) end - if fix and (#problems > 0) then - viewerId = createProgressViewer("Fixing '"..layerName.."' geometries") - fixErrorMsg = binding.te.vp.MakeGeometryValid.makeValid(layer, - layer:getDataSetName(), geomError.objectIdSet) - finalizeProgressViewer(viewerId) - end - releaseProject(project) end diff --git a/packages/gis/tests/functional/alternative/Layer.lua b/packages/gis/tests/functional/alternative/Layer.lua index e9ff7748..e5e84307 100644 --- a/packages/gis/tests/functional/alternative/Layer.lua +++ b/packages/gis/tests/functional/alternative/Layer.lua @@ -1350,17 +1350,11 @@ return{ } local fixTypeError = function() - l1:check(1, false) + l1:check(1) end unitTest:assertError(fixTypeError, incompatibleTypeMsg(2, "boolean", 1)) - local progressTypeError = function() - l1:check(true, "true") - end - - unitTest:assertError(progressTypeError, incompatibleTypeMsg(3, "boolean", "true")) - l1:delete() proj.file:delete() end diff --git a/packages/gis/tests/functional/basic/Project.lua b/packages/gis/tests/functional/basic/Project.lua index 8bcf33e5..681d14e8 100644 --- a/packages/gis/tests/functional/basic/Project.lua +++ b/packages/gis/tests/functional/basic/Project.lua @@ -245,7 +245,7 @@ return { directory = packageInfo("gis").data.."test" } - unitTest:assertEquals(getn(proj.layers), 27) + unitTest:assertEquals(getn(proj.layers), 28) file:deleteIfExists() local version = "" @@ -312,8 +312,7 @@ return { spfile:copy(currentDir()) local qgp = Project { - file = File("sampa_v3.qgs"), - clean = true + file = File("sampa_v3.qgs") } local l1 = Layer{ diff --git a/packages/gis/tests/shapefile/basic/Layer.lua b/packages/gis/tests/shapefile/basic/Layer.lua index f6d71e33..f3d09011 100644 --- a/packages/gis/tests/shapefile/basic/Layer.lua +++ b/packages/gis/tests/shapefile/basic/Layer.lua @@ -894,7 +894,7 @@ return { warnMsg = msg end - unitTest:assert(not l1:check(true, false)) + unitTest:assert(not l1:check(false)) if string.find(warnMsg, "5502300.9611873") then unitTest:assertEquals(warnMsg, "The following problems were found in the geometries:\n" --SKIP @@ -1264,7 +1264,7 @@ return { warnMsg = msg end - unitTest:assert(not l1:check(true, false)) + unitTest:assert(not l1:check(false)) if string.find(warnMsg, "5502300.9611873") then unitTest:assertEquals(warnMsg, "The following problems were found in the geometries:\n" --SKIP @@ -1284,8 +1284,6 @@ return { customWarning = customWarningBkp - unitTest:assert(l1:check(true, false)) - l1:delete() proj.file:delete() end diff --git a/packages/gis/tests/shapefile/basic/TerraLib.lua b/packages/gis/tests/shapefile/basic/TerraLib.lua index a98c04a0..76c0b6ee 100644 --- a/packages/gis/tests/shapefile/basic/TerraLib.lua +++ b/packages/gis/tests/shapefile/basic/TerraLib.lua @@ -2480,8 +2480,7 @@ return { TerraLib().setProgressVisible(false) - local fix = true - local problems = TerraLib().checkLayerGeometries(proj, l1Name, fix) + local problems = TerraLib().checkLayerGeometries(proj, l1Name) unitTest:assertEquals(problems[1].pk.value, "404") unitTest:assertEquals(problems[2].pk.value, "448") @@ -2489,10 +2488,6 @@ return { unitTest:assertEquals(problems[4].pk.value, "640") unitTest:assertEquals(problems[5].pk.value, "763") - problems = TerraLib().checkLayerGeometries(proj, l1Name, fix) - - unitTest:assertEquals(#problems, 0) - l1File:delete() proj.file:delete() end