Commands.pm

Summary
Commands.pm
BE4::CommandsConfigure and assemble commands used to generate pyramid’s images.
Commands’ weights and calls
MERGE4TIFF_W
MERGENTIFF_W
MERGENTIFF_W
CACHE2WORK_W
WGET_W
TIFF2TILE_W
BASHFUNCTIONSDefine bash functions, used to factorize and reduce scripts :
Constructors
newCommands constructor.
Commands methods
wms2workFetch image corresponding to the node thanks to ‘wget’, in one or more steps at a time.
cache2workCopy image from cache to work directory and transform (work format : untiled, zip-compression).
work2cacheCopy image from work directory to cache and transform it (tiled and compressed) thanks to the ‘Work2cache’ bash function (tiff2tile).
mergeNtiffUse the ‘MergeNtiff’ bash function.
decimateNtiffUse the ‘decimateNtiff’ bash function.
merge4tiffUse the ‘Merge4tiff’ bash function.
configureFunctionsConfigure bash functions to write in scripts’ header thanks to pyramid’s components.
Getters - Setters
getNodata
getPyramid
setConfDirStore the directory for mergeNtiff and decimateNtiff configuration files.
Export methods
exportForDebugReturns all commands’ informations.

BE4::Commands

Exporter
BE4::Commands

Configure and assemble commands used to generate pyramid’s images.

All schemes in this page respect this legend :

Using

use BE4::Commands;

# Commands object creation
my $objCommands = BE4::Commands->new(
    $objPyramid, # BE4::Pyramid object
    TRUE, # useMasks
);

Attributes

pyramidPyramid - Allowed to know output format specifications and configure commands.
mntConfDirstring - Directory, where to write mergeNtiff configuration files.
dntConfDirstring - Directory, where to write decimateNtiff configuration files.
useMasksboolean - If TRUE, all generating tools (mergeNtiff, merge4tiff...) use masks if present and generate a resulting mask.  This processing is longer, that’s why default behaviour is without mask.
Summary
Commands’ weights and calls
MERGE4TIFF_W
MERGENTIFF_W
MERGENTIFF_W
CACHE2WORK_W
WGET_W
TIFF2TILE_W
BASHFUNCTIONSDefine bash functions, used to factorize and reduce scripts :
Constructors
newCommands constructor.
Commands methods
wms2workFetch image corresponding to the node thanks to ‘wget’, in one or more steps at a time.
cache2workCopy image from cache to work directory and transform (work format : untiled, zip-compression).
work2cacheCopy image from work directory to cache and transform it (tiled and compressed) thanks to the ‘Work2cache’ bash function (tiff2tile).
mergeNtiffUse the ‘MergeNtiff’ bash function.
decimateNtiffUse the ‘decimateNtiff’ bash function.
merge4tiffUse the ‘Merge4tiff’ bash function.
configureFunctionsConfigure bash functions to write in scripts’ header thanks to pyramid’s components.
Getters - Setters
getNodata
getPyramid
setConfDirStore the directory for mergeNtiff and decimateNtiff configuration files.
Export methods
exportForDebugReturns all commands’ informations.

Commands’ weights and calls

MERGE4TIFF_W

MERGENTIFF_W

MERGENTIFF_W

CACHE2WORK_W

WGET_W

TIFF2TILE_W

BASHFUNCTIONS

my $BASHFUNCTIONS

Define bash functions, used to factorize and reduce scripts :

  • Wms2work
  • Cache2work
  • Work2cache
  • MergeNtiff
  • Merge4tiff
  • DecimateNtiff

Constructors

new

sub new

Commands constructor.  Bless an instance.

Parameters (list)

pyrPyramid - Image pyramid to generate
useMasksstring - Do we want use masks to generate images ?

Commands methods

wms2work

sub wms2work

Fetch image corresponding to the node thanks to ‘wget’, in one or more steps at a time.  WMS service is described in the current graph’s datasource.  Use the ‘Wms2work’ bash function.

Example

BBOXES="10018754.17139461632,-626172.13571215872,10644926.30710678016,0.00000000512
10644926.30710678016,-626172.13571215872,11271098.442818944,0.00000000512
11271098.442818944,-626172.13571215872,11897270.57853110784,0.00000000512
11897270.57853110784,-626172.13571215872,12523442.71424327168,0.00000000512
10018754.17139461632,-1252344.27142432256,10644926.30710678016,-626172.13571215872
10644926.30710678016,-1252344.27142432256,11271098.442818944,-626172.13571215872
11271098.442818944,-1252344.27142432256,11897270.57853110784,-626172.13571215872
11897270.57853110784,-1252344.27142432256,12523442.71424327168,-626172.13571215872
10018754.17139461632,-1878516.4071364864,10644926.30710678016,-1252344.27142432256
10644926.30710678016,-1878516.4071364864,11271098.442818944,-1252344.27142432256
11271098.442818944,-1878516.4071364864,11897270.57853110784,-1252344.27142432256
11897270.57853110784,-1878516.4071364864,12523442.71424327168,-1252344.27142432256
10018754.17139461632,-2504688.54284865024,10644926.30710678016,-1878516.4071364864
10644926.30710678016,-2504688.54284865024,11271098.442818944,-1878516.4071364864
11271098.442818944,-2504688.54284865024,11897270.57853110784,-1878516.4071364864
11897270.57853110784,-2504688.54284865024,12523442.71424327168,-1878516.4071364864"
#
Wms2work "path/image_several_requests" "png" "tif" "4 4" "250000" "http://localhost/wms-vector?LAYERS=BDD_WLD_WM&SERVICE=WMS&VERSION=1.3.0&REQUEST=getMap&FORMAT=image/png&CRS=EPSG:3857&WIDTH=1024&HEIGHT=1024&STYLES=line&BGCOLOR=0x80BBDA&TRANSPARENT=0X80BBDA" $BBOXES

Parameters (list)

nodeNode - Node whose image have to be harvested.
harvestingHarvesting - To use to harvest image.

Returns

An array (code, weight), (undef,WGET_W) if error.

cache2work

sub cache2work

Copy image from cache to work directory and transform (work format : untiled, zip-compression).  Use the ‘Cache2work’ bash function.

Examples

Cache2work ${PYR_DIR}/IMAGE/19/02/BF/24.tif ${TMP_DIR}/19_398_3136_BgI
Cache2work ${PYR_DIR}/IMAGE/19/02/BF/24.tif ${TMP_DIR}/19_398_3136_BgM

Parameters (list)

nodeNode - Node whose image have to be transfered in the work directory.

Returns

An array (code, weight), (“”,-1) if error.

work2cache

sub work2cache

Copy image from work directory to cache and transform it (tiled and compressed) thanks to the ‘Work2cache’ bash function (tiff2tile).

Example

Work2cache ${TMP_DIR}/19_395_3137.tif IMAGE/19/02/AF/Z5.tif

Parameter

nodeNode - Node whose image have to be transfered in the cache.
workDirstring - Work image directory, can be an environment variable.

Returns

An array (code, weight), (“”,-1) if error.

mergeNtiff

sub mergeNtiff

Use the ‘MergeNtiff’ bash function.  Write a configuration file, with sources.

Parameters (list)

nodeNode - Node to generate thanks to a ‘mergeNtiff’ command.

Example

MergeNtiff 19_397_3134.txt

Returns

An array (code, weight), (“”,-1) if error.

decimateNtiff

sub decimateNtiff

Use the ‘decimateNtiff’ bash function.  Write a configuration file, with sources.

(see decimateNtiff.png)

Parameters (list)

nodeNode - Node to generate thanks to a ‘decimateNtiff’ command.

Example

DecimateNtiff 12_26_17.txt

Returns

An array (code, weight), (“”,-1) if error.

merge4tiff

sub merge4tiff

Use the ‘Merge4tiff’ bash function.

                  i1  i2
backGround    +              =  resultImg
                  i3  i4

Parameters (list)

nodeNode - Node to generate thanks to a ‘merge4tiff’ command.

Example

Returns

An array (code, weight), (“”,-1) if error.

configureFunctions

sub configureFunctions

Configure bash functions to write in scripts’ header thanks to pyramid’s components.

Getters - Setters

getNodata

sub getNodata

getPyramid

sub getPyramid

setConfDir

sub setConfDir

Store the directory for mergeNtiff and decimateNtiff configuration files.

Parameters (list)

mntConfDirstring - mergeNtiff configurations’ directory
dntConfDirstring - decimateNtiff configurations’ directory

Export methods

exportForDebug

sub exportForDebug

Returns all commands’ informations.  Useful for debug.

Example

my $BASHFUNCTIONS
Define bash functions, used to factorize and reduce scripts :
sub new
Commands constructor.
sub wms2work
Fetch image corresponding to the node thanks to ‘wget’, in one or more steps at a time.
sub cache2work
Copy image from cache to work directory and transform (work format : untiled, zip-compression).
sub work2cache
Copy image from work directory to cache and transform it (tiled and compressed) thanks to the ‘Work2cache’ bash function (tiff2tile).
sub mergeNtiff
Use the ‘MergeNtiff’ bash function.
sub decimateNtiff
Use the ‘decimateNtiff’ bash function.
sub merge4tiff
Use the ‘Merge4tiff’ bash function.
sub configureFunctions
Configure bash functions to write in scripts’ header thanks to pyramid’s components.
sub getNodata
sub getPyramid
sub setConfDir
Store the directory for mergeNtiff and decimateNtiff configuration files.
sub exportForDebug
Returns all commands’ informations.
Store all informations about a pyramid.
Descibe a node of a QTree or a Graph.
Stores parameters and builds WMS request.
Close