Closed vilmount closed 7 years ago
Strange. The test for windows looks fine: https://github.com/TerraME/terrame/blob/master/packages/terralib/log/windows/lines-count.png
@vilmount, can you provide a script and data to reproduce such problem?
My result
The script creates attribute "rodcount", while the image has attribute "apcount". Anyway, I need script and data in order to reproduce such problem.
It seems associated to default
argument.
There is no default
for count
.
You are right:
count = function()
if belong(repr, {"point", "line", "polygon", "surface"}) then
verifyUnnecessaryArguments(data, {"attribute", "layer", "operation"})
data.select = "FID"
else
customError("The operation '"..data.operation.."' is not available for layers with "..repr.." data.") -- SKIP
end
end,
Just set the default value of default
to zero and check the images in the log directory. The only strange point is why it is shown as zero in the logs.
This issue might be related to #1784 (although the other one is a PostGIS problem).
@pedro-andrade-inpe,
I guess that there is another problema here beyond the default
.
The count
operation creates a data with null values, but Map
is coloring as 0
.
test/shapefile/Layer.lua
clamaz:fill{
operation = "count",
layer = portos,
attribute = "pointcount"
}
cs = CellularSpace{
project = proj,
layer = clamaz.name
}
map = Map{
target = cs,
select = "pointcount",
value = {0, 1, 2},
color = {"green", "red", "blue"}
}
When a cellularspace is loaded, how null values are read?
@pedro-andrade-inpe
Currently, terralib returns the value as 0
, but it is possible to check if the value is null, however, if a value is set as nil
in a table, the key is removed.
What would be the solution for it?
The default value for the count operation is null, not 0.
cs:fill{ layer = "teste", operation = "count", attribute = "rodcount" }