aRTtable-createAndFillColumn       package:aRT       R Documentation

_C_r_e_a_t_e_s _a_n_d _f_i_l_l_s _a _c_o_l_u_m_n

_D_e_s_c_r_i_p_t_i_o_n:

     Create a new column in a table of a cellular layer,  filling it
     with the result of a spatial operation, which can also involve 
     some attribute.

_U_s_a_g_e:

     ## S4 method for signature 'aRTtable':
     createAndFillColumn(object, newatt="", target, strategy=
     c("average", "stdev", "sum", "minimum", "maximum", "majority", "distance", "xdistance", "count", "presence", "area", "length", "averagewba", "sumwba", "percentage", "weighbra"), geometry=c("point", "line", "polygon", "raster"), att="", proportion=FALSE, itime="", ftime="", dist=50, raster=NULL, validValues=NULL, band=NULL)

_A_r_g_u_m_e_n_t_s:

  object: Object of class 'aRTtable'.

  newatt: The name of the new column.

  target: An 'aRTraster' or 'aRTtheme' object.

strategy: The way to calculate the attribute of each cell:

             *  average: Average of an attribute of the objects that
                have some intersection with the cell, without taking
                into account their geometric properties. 

             *  stdev: Standard deviation of an attribute of the
                objects that have some intersection with the cell,
                without taking into account their geometric properties.

             *  sum: Sum of an attribute of the objects that have some
                intersection with the cell, without taking into account
                their geometric properties.

             *  minimum: Minimum value of an attribute among the
                objects that have some intersection with the cell,
                without taking into account their geometric properties.

             *  maximum: Maximum value of  an attribute among the
                objects that have some intersection with the cell,
                without taking into account their geometric properties.

             *  majority: More common value in the objects that have
                some intersection with the cell, without taking into
                account their geometric properties.

             *  distance: Distance to the nearest object of a chosen
                geometry (requires argument geometry).

             *  xdistance: Approximated distance to the nearest object
                of a chosen geometry (requires arguments geometry and
                dist).

             *  count: Number of objects that have some overlay with
                the cell (requires argument geometry).

             *  presence: Boolean value pointing out whether some
                object has an overlay with the cell.

             *  area: Total area of overlay between the cell and the
                layer of polygons.

             *  length: Total length of overlay between the cell and
                the layer of lines.

             *  averagewba: Average weighted by area, based on the
                proportion of the intersection area. Useful when you
                want to distribute atributes that represent averages,
                such as per capita income.

             *  sumwba: Sum weighted by area, based on the proportion
                of the intersection area. Useful when you want to
                preserve the total amount in both layers, such as
                population size.

             *  percentage: Percentages of each class of a raster data.
                It creates one attribute for each class of the raster.

             *  weighbra: ???

geometry: The geometry to compute the attribute. One of "point",
          "polygon", "line", "raster".

     att: The atribute used to compute the new column. It is only
          required when the strategy uses an attribute (such as
          average, sum, etc.)

proportion: Whether the calculation will be based on the intersection
          area, or the weights are equal for each object whth some
          overlap.

   itime: The initial time (for temporal tables).

   ftime: The final time (for temporal tables).

    dist: The maximum error when calculating the distance.

  raster: An object of class 'aRTraster', used only in the strategy
          weighbra.

validValues: A set of valid raster values, used only in the strategy
          weighbra. The other values are ignored.

    band: An integer value representing the band of the raster to be
          used. This argument is used only in the strategy weighbra.

_A_u_t_h_o_r(_s):

     Pedro Ribeiro de Andrade

_S_e_e _A_l_s_o:

     See 'aRTtable-class' to show the description of this class. See
     'createLayer' to know how to create a layer of cells.

