Node.pm

Summary
Node.pm
BE4::NodeDescibe a node of a QTree or a <Graph>.
Constructors
newNode constructor.
_initCheck and store node’s attributes values.
Geographic tools
isPointInNodeBboxReturns a boolean indicating if the point is inside the bbox of the node.
isBboxIntersectingNodeBboxTests if the provided bbox intersects the bbox of the node.
Getters - Setters
getScript
writeInScriptWrite own code in the associated script.
setScript
getCol
getRow
getPyramidName
setWorkExtension
addBgImage
getWorkImageName
getWorkMaskName
getWorkBaseNameReturns the work image base name (no extension) : “level_col_row”
addBgImage
getBgImageName
addBgMask
getBgMaskName
getLevel
getTM
getGraph
getNodeSources
getGeoImages
addNodeSources
addGeoImages
setCode
getBBox
getOwnWeight
getAccumulatedWeight
setOwnWeight
getScriptID
setAccumulatedWeightAccumulatedWeight = children’s weights sum + own weight = provided weight + already store own weight.
getPossibleChildrenReturns a Node array, containing children (length is always 4, with undefined value for children which don’t exist), an empty array if the node is a leaf.
getChildrenReturns a Node array, containing real children (max length = 4), an empty array if the node is a leaf.
Export methods
exportForMntConfExport attributes of the Node for mergeNtiff configuration file.
exportForDntConfExport attributes of the Node for decimateNtiff configuration file.
exportForM4tConfExport work files (output) and eventually background (input) of the Node for the Merge4tiff call line.
exportForDebugReturns all image’s components.

BE4::Node

Exporter
BE4::Node

Descibe a node of a QTree or a <Graph>.

Using

use BE4::Node

my $tm = BE4::TileMatrix->new(...)

my $graph = BE4::Qtree->new(...)
#or
my $graph = BE4::Graph->new(...)

my $node = BE4::Node->new({
    i => 51,
    j => 756,
    tm => $tm,
    graph => $graph,
});

Attributes

iinteger - Column, according to the TMS grid.
jinteger - Row, according to the TMS grid.
pyramidNamestring - relative path of this node in the pyramid (generated from i,j).  Example : level16/00/12/L5.tif
bgImageBasenamestring -
bgMaskBasenamestring -
workImageBasenamestring -
workMaskBasenamestring -
workExtensionstring - extension of the temporary work image, lower case.  Default value : tif.
tmTileMatrix - Tile matrix associated to the level which the node belong to.
graph<Graph> or QTree - Graph which contains the node.
winteger - Own node’s weight
Winteger - Accumulated weight (own weight + childs’ accumulated weights sum)
codestring - Commands to execute to generate this node (to write in a script)
scriptScript - Script in which the node will be generated
nodeSourcesNode array - Nodes from which this node is generated (working for NNGraph)
geoImagesGeoImage array - Source images from which this node (if it belongs to the tree’s bottom level) is generated (working for QTree)
Summary
Constructors
newNode constructor.
_initCheck and store node’s attributes values.
Geographic tools
isPointInNodeBboxReturns a boolean indicating if the point is inside the bbox of the node.
isBboxIntersectingNodeBboxTests if the provided bbox intersects the bbox of the node.
Getters - Setters
getScript
writeInScriptWrite own code in the associated script.
setScript
getCol
getRow
getPyramidName
setWorkExtension
addBgImage
getWorkImageName
getWorkMaskName
getWorkBaseNameReturns the work image base name (no extension) : “level_col_row”
addBgImage
getBgImageName
addBgMask
getBgMaskName
getLevel
getTM
getGraph
getNodeSources
getGeoImages
addNodeSources
addGeoImages
setCode
getBBox
getOwnWeight
getAccumulatedWeight
setOwnWeight
getScriptID
setAccumulatedWeightAccumulatedWeight = children’s weights sum + own weight = provided weight + already store own weight.
getPossibleChildrenReturns a Node array, containing children (length is always 4, with undefined value for children which don’t exist), an empty array if the node is a leaf.
getChildrenReturns a Node array, containing real children (max length = 4), an empty array if the node is a leaf.
Export methods
exportForMntConfExport attributes of the Node for mergeNtiff configuration file.
exportForDntConfExport attributes of the Node for decimateNtiff configuration file.
exportForM4tConfExport work files (output) and eventually background (input) of the Node for the Merge4tiff call line.
exportForDebugReturns all image’s components.

Constructors

new

sub new

Node constructor.  Bless an instance.

Parameters (hash)

iinteger - Node’s column
jinteger - Node’s row
tmTileMatrix - Tile matrix of the level which node belong to
graph<Graph> or QTree - Graph containing the node.

See also

_init

_init

sub _init

Check and store node’s attributes values.  Initialize weights to 0.  Calculate the pyramid’s relative path, from indices, thanks to Base36::indicesToB36Path.

Parameters (hash)

iinteger - Node’s column
jinteger - Node’s row
tmTileMatrix - Tile matrix of the level which node belong to
graph<Graph> or QTree - Graph containing the node.

Geographic tools

isPointInNodeBbox

sub isPointInNodeBbox

Returns a boolean indicating if the point is inside the bbox of the node.

Parameters

xdouble - X coordinate of the point you want to know if it is in
ydouble - Y coordinate of the point you want to know if it is in

isBboxIntersectingNodeBbox

sub isBboxIntersectingNodeBbox

Tests if the provided bbox intersects the bbox of the node.

Parameters

Bboxdouble list - (xmin,ymin,xmax,ymax) : coordinates of the bbox

Getters - Setters

getScript

sub getScript

writeInScript

sub writeInScript

Write own code in the associated script.

Parameters (list)

additionnalTextstring - Optionnal, can be undefined, text to add after the own code.

setScript

sub setScript

Parameters (list)

scriptScript - Script to set.

getCol

sub getCol

getRow

sub getRow

getPyramidName

sub getPyramidName

setWorkExtension

sub setWorkExtension

addBgImage

getWorkImageName

sub getWorkImageName

getWorkMaskName

sub getWorkMaskName

getWorkBaseName

sub getWorkBaseName

Returns the work image base name (no extension) : “level_col_row”

addBgImage

sub addBgImage

getBgImageName

sub getBgImageName

addBgMask

sub addBgMask

getBgMaskName

sub getBgMaskName

getLevel

sub getLevel

getTM

sub getTM

getGraph

sub getGraph

getNodeSources

sub getNodeSources

getGeoImages

sub getGeoImages

addNodeSources

sub addNodeSources

Parameters (list)

nodesNode array - Source nodes to add

addGeoImages

sub addGeoImages

Parameters (list)

imagesGeoImage array - Source images to add

setCode

sub setCode

Parameters (list)

codestring - Code to set.

getBBox

sub getBBox

getOwnWeight

sub getOwnWeight

getAccumulatedWeight

sub getAccumulatedWeight

setOwnWeight

sub setOwnWeight

Parameters (list)

weightinteger - Own weight to set

getScriptID

sub getScriptID

setAccumulatedWeight

sub setAccumulatedWeight

AccumulatedWeight = children’s weights sum + own weight = provided weight + already store own weight.

getPossibleChildren

sub getPossibleChildren

Returns a Node array, containing children (length is always 4, with undefined value for children which don’t exist), an empty array if the node is a leaf.

Warning

Do not mistake with getChildren

getChildren

sub getChildren

Returns a Node array, containing real children (max length = 4), an empty array if the node is a leaf.

Warning

Do not mistake with getPossibleChildren

Export methods

exportForMntConf

sub exportForMntConf

Export attributes of the Node for mergeNtiff configuration file.  Provided paths will be written as is, so can be relative or absolute (or use environment variables).

Masks and backgrounds are always TIFF images.

Parameters (list)

exportBgboolean - Export background files (image + mask) if presents.
prefixstring - String to add before paths, can be undefined.

exportForDntConf

sub exportForDntConf

Export attributes of the Node for decimateNtiff configuration file.  Provided paths will be written as is, so can be relative or absolute.

Masks and backgrounds are always TIFF images.

Parameters (list)

exportBgboolean - Export background files (image + mask) if presents.
prefixstring - String to add before paths, can be undefined.

exportForM4tConf

sub exportForM4tConf

Export work files (output) and eventually background (input) of the Node for the Merge4tiff call line.

Parameters (list)

exportBgboolean - Export background files (image + mask) if presents.

exportForDebug

sub exportForDebug

Returns all image’s components.  Useful for debug.

Example

Representation of a quad tree image pyramid : pyramid’s image = Node
sub new
Node constructor.
sub _init
Check and store node’s attributes values.
sub isPointInNodeBbox
Returns a boolean indicating if the point is inside the bbox of the node.
sub isBboxIntersectingNodeBbox
Tests if the provided bbox intersects the bbox of the node.
sub getScript
sub writeInScript
Write own code in the associated script.
sub setScript
sub getCol
sub getRow
sub getPyramidName
sub setWorkExtension
sub getWorkImageName
sub getWorkMaskName
sub getWorkBaseName
Returns the work image base name (no extension) : “level_col_row”
sub addBgImage
sub getBgImageName
sub addBgMask
sub getBgMaskName
sub getLevel
sub getTM
sub getGraph
sub getNodeSources
sub getGeoImages
sub addNodeSources
sub addGeoImages
sub setCode
sub getBBox
sub getOwnWeight
sub getAccumulatedWeight
sub setOwnWeight
sub getScriptID
sub setAccumulatedWeight
AccumulatedWeight = children’s weights sum + own weight = provided weight + already store own weight.
sub getPossibleChildren
Returns a Node array, containing children (length is always 4, with undefined value for children which don’t exist), an empty array if the node is a leaf.
Descibe a node of a QTree or a Graph.
sub getChildren
Returns a Node array, containing real children (max length = 4), an empty array if the node is a leaf.
sub exportForMntConf
Export attributes of the Node for mergeNtiff configuration file.
sub exportForDntConf
Export attributes of the Node for decimateNtiff configuration file.
sub exportForM4tConf
Export work files (output) and eventually background (input) of the Node for the Merge4tiff call line.
sub exportForDebug
Returns all image’s components.
A Tile Matrix defines a grid for a level.
Describe a script, its weight and allowed to write in.
Representation of a “nearest neighbour” pyramid : pyramid’s image = Node.
Describes a georeferenced image and enable to know its components.
sub indicesToB36Path
Convert base-10 indices into a base-36 path (string).
Close