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

update documentation of fill distance for polygons #2360

Open pedro-andrade-inpe opened 3 years ago

pedro-andrade-inpe commented 3 years ago

The strategy distance for polygons is not clear in the documentation. It says that " The distance is computed from the centroid of the cell to the closest point, line, or border of a polygon." What happens when the centroid is within the polygon?

avancinirodrigo commented 3 years ago

The distance operation considering both centroids.

See it in attached image. distance

import("gis")

local proj = Project{
    file = "project.qgs",
    clean = true
}
local f1 = filePath("amazonia-limit.shp", "gis")
local f2 = filePath("amazonia-ports.shp", "gis")
f1:copy(currentDir())
f2:copy(currentDir())
local l1 = Layer{
    project = proj,
    name = "limit",
    file = "amazonia-limit.shp"
}
print(l1)
local l2 = Layer{
    project = proj,
    name = "ports",
    file = "amazonia-ports.shp"
}
print(l2)
l1:fill{
    attribute = "dist",
    operation = "distance",
    layer = l2.name
}
pedro-andrade-inpe commented 3 years ago

So it is not to the border of a polygon. Just update this sentence, please.

avancinirodrigo commented 3 years ago

@pedro-andrade-inpe Actually, it has been changed in #1566.