Closed pedro-andrade-inpe closed 8 years ago
To reproduce this error just run the script below:
local projName = "cellular_layer_fill_shape2.tview"
import("terralib")
local proj = Project {
file = projName,
clean = true
}
local layerName1 = "setores"
Layer{
project = proj,
name = layerName1,
file = filePath("Setores_Censitarios_2000_pol.shp", "terralib")
}
local clName1 = "cells_set"
local shp1 = clName1..".shp"
local cl = Layer{
project = proj,
source = "shp",
clean = true,
input = layerName1,
name = clName1,
resolution = 50000,
file = clName1..".shp"
}
-- AVERAGE
local polavgLayerName = clName1.."_polavg"
local shp1 = polavgLayerName..".shp"
cl:fill{
operation = "average",
layer = layerName1,
attribute = "polavg",
clean = true,
select = "Densde_Pop",
output = polavgLayerName,
area = true
}
local cs = CellularSpace{
project = proj,
layer = polavgLayerName
}
local map = Map{
target = cs,
select = "polmode",
min = 0,
max = 20000,
slices = 8,
color = {"red", "green"}
}
-- unitTest:assertSnapshot(map, "polygons-mode.png")
@pedro-andrade-inpe, please, check terralib tests after, because this operation works there.
@pedro-andrade-inpe
This error happens even after to update terralib release-5.2.
It is associeted to data, if change the data, it woks.
Try to this: municipiosAML_ok.shp
and select POPULACAO_
Yes, it worked.The problem is that the strategy "average weighted by area" should only be used by an attribute that represents an average and therefore the only good example is the one above. Let's see if it works when we migrate to the newest version.
It was fixed after last update that was associated to #1087. Please, check it.
This operation does not work properly and aborts terrame. In TerraView it works.