TerraME / terrame

TerraME is a programming environment for spatial dynamical modelling
www.terrame.org
GNU Lesser General Public License v3.0
35 stars 13 forks source link

problem with fill using multipolygon data #1891

Open pedro-andrade-inpe opened 7 years ago

pedro-andrade-inpe commented 7 years ago

Layer:fill takes too long to fill cells with a data that contains multipolygons. Additionally, it does not work properly. See the script below:

Data: areas.zip

import("terralib")

p = Project{
    file = "areas.tview",
    clean = true,
    areas = "areas_protegidas_clip.shp"
}

time1 = os.clock()

cl = Layer{
    project = p,
    resolution = 100000,
    name = "cells",
    input = "areas",
    clean = true,
    file = "cells.shp"
}

time2 = os.clock()

print("Time: "..round(time2 - time1, 2))

print(#cl)

cl:fill{
    operation = "coverage",
    layer = "areas",
    attribute = "mav",
    select = "ANO_CRIA6"
}

time3 = os.clock()
print("Time: "..round(time3 - time2, 2))

cl:fill{
    operation = "area",
    layer = "areas",
    attribute = "marea"
}

time4 = os.clock()
print("Time: "..round(time4 - time3, 2))
avancinirodrigo commented 7 years ago

@pedro-andrade-inpe Apparently, the error is associated with the data shp. I will need to send it to terralib team, but firstly, is this data reliable? Have it already worked in TerraME?