Method: RTree#add_rect

Defined in:
lib/rtree.rb

#add_rect(id, coords) ⇒ self

Add a rectangle to the RTree

Examples:

Add a rectangle to a dimension two RTree

rtree = RTree.new(2)
rtree.add_rect(7, [0, 0, 1, 1])

Parameters:

  • id (Integer)

    the id of the rectangle. It is anticipated that the id will be used as an index for application specific data to which this rectangle relates, but this is entirely at the discretion of the caller, the library makes no use of the value, treating it as payload. In particular, the value may be non-unique and may be zero.

  • coords (Array<Float>)

    the extent of the rectangle, the minima for each dimension, then the maxima for each dimension.

Returns:

  • (self)


335
336
337
# File 'lib/rtree.rb', line 335

def add_rect(id, coords)
  super
end