TerraME / gpm

A TerraME package to implement GPM
GNU General Public License v3.0
1 stars 5 forks source link

Open Network #7

Closed pedro-andrade-inpe closed 8 years ago

pedro-andrade-inpe commented 8 years ago

Implement a function to create an open network

roads = CellularSpace{
    project = "my project",
    layer = "roads",
    geometry = true
}

network = Network{
    strategy = "open",
    target = communities,
    lines = roads,
    weight = function(cell, distance)
        local roadtype = cell.CD_PAVIMENT

        if roadtype == "paved" then
            return distance / 5
        else
            return distance / 2
        end
    end
}
pedro-andrade-inpe commented 8 years ago

The algorithm implemented in the first version of open network will compute only the distance to the nearest target, as it is currently implemented in R.

pedro-andrade-inpe commented 8 years ago

The implementation in R is available in the following link: https://github.com/pedro-andrade-inpe/aRT-old/blob/master/R/gpmFunctions.R