Giter VIP home page Giter VIP logo

gpm's People

Contributors

avancinirodrigo avatar joaovitor123 avatar pedro-andrade-inpe avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

gpm's Issues

review data files

Translate all values and names of attributes of shape files to english. Use also better attribute names. Update tests. For example:

roads:get(id).CD_PAVIMEN == "pavimentada"

should be

roads:get(id).status == "paved"

Add strategy "distance" to GPM

Implement a strategy "distance" to GPM that compute relations based on their euclidean distances. One can choose a maximum distance as argument or a maximum quantity. Note that these two arguments cannot be used at the same time.

Connect closer points

Add a function to connect closer points in a network according to a maximum tolerance. Return the number of connected points (and possibly where they were located).

Validate the network

Implement a function to validade a network. It must be possible to go from any node to any node of the network. It should stop with an error if it is not possible. In the error, show the number of separate networks found.

GPM:progress

Add a new argument progress to GPM to print as values are being processed, such as:

gpm = GPM{
    -- ...
    progress = true
}

will show the following output:

Processing origin 1/4
Processing origin 2/4
Processing origin 3/4
Processing origin 4/4

study SUMO simulator

It can import several network formats.

Krajzewicz, D.; Eedmann, J.; Behrisch, M.; Bieker, L. (2012). Recent Development and Applications of SUMO - Simulation of Urban MObility. International Journal On Advances in Systems and Measurements, (v.3-4, n.5, p.128–138).

Neighbourhood along a line

Implement a strategy to create a neighbourhood of cells that have touching relations and share the same road.

Validate Network

Type Network should verify if all the Network is connected. Otherwise, an error should be prompted.

GPM save attribute

Think in a way to allow saving an attribute of GPM. There are three possibilities:

  1. Save the id of the nearest object
  2. Save the length of the shortest path
  3. Save several attributes, one with each destination as a name, and value equals to the distance to the respective destination.

Add strategy to gpm

Add strategies, and check documentation.
strategy 'relations': Creates networks between polygons and cells.
strategy 'distanceFromTarget': Returns the cells within the distance of the target.

GPM:save with decimal places

Add a second argument to GPM:save to indicate the number of decimal places to save weights. The default value should be 5.

distances using geospatial data with angles

Create an example that uses data stored in angles, such as polyconic projection. Ensure that distances are computed in meters, and not in angles in the Network and in GPM.

number of destinations in the Network

Add an argument destination to Network, in order to say how many destinations will be computed. When this argument is missing (default), the algorithm will compute the distance to all destinations (which belong to the target). Therefore there will exist three algorithms:

  1. Compute the distance to all destinations
  2. Compute the distance to the nearest destinations (which is already implemented)
  3. Compute the distance to a given number of destinations

This algorithm will be useful to create neighbourhoods between objects.

Network:progress

Add a new argument progress to Network to print as values are being processed, such as:

net = Network{
    -- ...
    progress = true
}

will show the following output:

Reducing distances 1/4
Reducing distances 2/4
Reducing distances 3/4
It is not possible to reduce distances anymore

4 in this case is the number of lines.

Type GPM

Implement type GPM, to compute a generalised proximity matrix from a Network. It gets a Network and a target as parameters and compute the distance from the targets to the targets of the Network. It will return an object of type "GPM".

The implementation of this function must have an optional argument "strategy" to allow having different behaviour to be implemented in future versions. For now, it is only required to follow the TerraME standard for this kind of type. See the documentation of CellularSpace:createNeighborhood of Society:createSocialNetwork as examples. The only strategy available in version 0.1 will be "network".

Add an error argument to Network

Add an error argument to connect the lines in the Network:

network = Network{
    target = communities,
    lines = roads,
    error = 10, -- 10m
    weight = function(cell, distance)
        local roadtype = cell.CD_PAVIMENT

        if roadtype == "paved" then
            return distance / 5
        else
            return distance / 2
        end
    end
}

add argument buffer to GPM

Add an optional argument buffer to GPM. When using this argument, all polygons from the target will be converted to their buffers, according to the values in the argument.

Open Network

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
}

distance outside Network

Add an argument to Network described as a function to compute the distance outside the Network. This function is useful as usually the starting and ending points are not connected to the network. In this case, this function should take the euclidean distance and id of the object as argument and return the real distance. This is an optional function and should have as default a function that returns zero.

Add argument outside to Network

Add an argument outside to Network, a user-defined function that computes the distance based on an Euclidean to enter and to leave the Network.

network = Network{
    strategy = "open",
    target = communities,
    lines = roads,
    outside = function(d)
        return d * 2
    end,
    weight = function(cell, distance)
        local roadtype = cell.CD_PAVIMENT

        if roadtype == "paved" then
            return distance / 5
        else
            return distance / 2
        end
    end
}

As default, this function is a function that returns the distance itself:

if data.outside == nil then
    data.outside = function(d) return d end
end

Add strategy "area" to GPM

Implement a new strategy "area" for GPM, which calculates neighbourhoods according to the intersection area. It can compute relations to all polygons that have some intersection area or limit a given quantity (argument quantity, optional).

review data

Review the data available in the package. Remove some useless attributes and rename the others.

Convert Network origins to centroids

All the elements belonging to the source of a Network must be converted into centroids if they are not point data. Investigate how to do so using TerraLib algorithms.

implement scripts and functionalities to rebuild all neighborhood files from base package

Implement functionalities as well as scripts to rebuild all neighborhood files from base package:

./cabecadeboi-neigh.gpm
./gpmlinesDbEmas.gpm
./test/brazil.gal
./test/cabecadeboi-neigh.gal
./test/cabecadeboi-neigh.gwt
./test/emas-distance.gal
./test/emas-distance.gpm
./test/emas-distance.gwt
./test/emas-pollin.gpm
./test/gpmAreaCellsPols.gpm
./test/gpmdistanceDbEmasCells.gpm

Add strategy "length" to GPM

Implement a strategy "length", that create relations between objects whose intersection is a line. For example, between a polygon and a line, or between two polygons that share some border. This relation can be created according to a maximum quantity or a minimum length. Note that these two arguments cannot be used at the same time.

Open network verifications

  • target must be a CellularSpace with points
  • lines must be a CellularSpace with lines
  • weight must be a function

Add alternative tests

avoid string concatenation

Avoid concatenating strings several times when creating a GPM. Create an auxiliary table that stores all strings, indexed by x and y locations, such as table[x][y] to get such string.

distance between two points within lines

Add a new argument to Network to set the desired distance between two points within each line. If two consecutive points from a line have more than the desired distance, a new point should be created in the middle of them. If three or more consecutive points fit in the desired distance, the intermediate points can be removed.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.