Level.pm

Summary
Level.pm
BE4::LevelDescribe a level in a pyramid.
STRLEVELTMPLTDefine the template XML for a level in the pyramid’s descriptor.
STRLEVELTMPLTMASKDefine the template XML for the mask part of a level in the pyramid’s descriptor.
STRLEVELTMPLTMOREDefine the template XML for the metadat part of a level in the pyramid’s descriptor.
Constructors
newLevel constructor.
_initCheck and store level’s attributes values.
Getters - Setters
getID
getOrder
getDirImage
getDirNodata
getDirMask
getLimits
updateExtremTilesCompare old extrems rows/columns with the news and update values.
Export methods
exportToXMLInsert Level’s attributes in the XML template, write in the pyramid’s descriptor.
exportForDebugReturns all level’s informations.

BE4::Level

Exporter
BE4::Level

Describe a level in a pyramid.

Using

use BE4::Level;

my $params = {
    id                => level_5,
    order             => 12,
    dir_image         => "/home/ign/BDORTHO/IMAGE/level_5/",
    dir_nodata        => "/home/ign/BDORTHO/NODATA/level_5/",
    dir_mask          => "/home/ign/BDORTHO/MASK/level_5/",
    dir_metadata      => undef,
    compress_metadata => undef,
    type_metadata     => undef,
    size              => [16, 16],
    dir_depth         => 2,
    limits            => [365,368,1026,1035]
};

my $objLevel = BE4::Level->new($params);

Attributes

idstring - Level identifiant.
orderinteger - Level order (ascending resolution)
dir_imagestring - Absolute images’ directory path for this level.
dir_nodatastring - Absolute nodata’s directory path for this level.
dir_maskstring - Absolute mask’ directory path for this level.
dir_metadataNOT IMPLEMENTED
compress_metadataNOT IMPLEMENTED
type_metadataNOT IMPLEMENTED
sizeinteger array - Number of tile in one image for this level, widthwise and heightwise : [width, height].
dir_depthinteger - Number of subdirectories from the level root to the image : depth = 2 => /.../LevelID/SUB1/SUB2/IMG.tif, in the images’ pyramid.
limitsinteger array - Extrems columns and rows for the level (Extrems tiles which contains data) : [rowMin,rowMax,colMin,colMax]

Limitations

Metadata not implemented.

Summary
STRLEVELTMPLTDefine the template XML for a level in the pyramid’s descriptor.
STRLEVELTMPLTMASKDefine the template XML for the mask part of a level in the pyramid’s descriptor.
STRLEVELTMPLTMOREDefine the template XML for the metadat part of a level in the pyramid’s descriptor.
Constructors
newLevel constructor.
_initCheck and store level’s attributes values.
Getters - Setters
getID
getOrder
getDirImage
getDirNodata
getDirMask
getLimits
updateExtremTilesCompare old extrems rows/columns with the news and update values.
Export methods
exportToXMLInsert Level’s attributes in the XML template, write in the pyramid’s descriptor.
exportForDebugReturns all level’s informations.

STRLEVELTMPLT

my $STRLEVELTMPLT

Define the template XML for a level in the pyramid’s descriptor.

STRLEVELTMPLTMASK

my $STRLEVELTMPLTMASK

Define the template XML for the mask part of a level in the pyramid’s descriptor.

STRLEVELTMPLTMORE

my $STRLEVELTMPLTMORE

Define the template XML for the metadat part of a level in the pyramid’s descriptor.

Constructors

new

sub new

Level constructor.  Bless an instance.

Parameters (hash)

idstring - Level identifiant
orderinteger - Level order (ascending resolution)
sizeinteger array - Number of tile in one image for this level
limitsinteger array - Optionnal.  Current level’s limits.  Set to [undef,undef,undef,undef] if not defined.
dir_depthinteger - Number of subdirectories from the level root to the image
dir_imagestring - Absolute images’ directory path for this level.
dir_nodatastring - Absolute nodata’s directory path for this level.
dir_maskstring - Optionnal (if we want to keep mask in the final images’ pyramid).  Absolute mask’ directory path for this level.

See also

_init

_init

sub _init

Check and store level’s attributes values.

Parameters (hash)

idstring - Level identifiant
orderinteger - Level order (ascending resolution)
sizeinteger array - Number of tile in one image for this level
limitsinteger array - Optionnal.  Current level’s limits.  Set to [undef,undef,undef,undef] if not defined.
dir_depthinteger - Number of subdirectories from the level root to the image
dir_imagestring - Absolute images’ directory path for this level.
dir_nodatastring - Absolute nodata’s directory path for this level.
dir_maskstring - Optionnal (if we want to keep mask in the final images’ pyramid).  Absolute mask’ directory path for this level.

Getters - Setters

getID

sub getID

getOrder

sub getOrder

getDirImage

sub getDirImage

getDirNodata

sub getDirNodata

getDirMask

sub getDirMask

getLimits

sub getLimits

updateExtremTiles

sub updateExtremTiles

Compare old extrems rows/columns with the news and update values.

Parameters (list)

jMin, jMax, iMin, iMaxinteger list - Tiles indices to compare with current extrems

Export methods

exportToXML

sub exportToXML

Insert Level’s attributes in the XML template, write in the pyramid’s descriptor.

Returns a string to XML format.

Parameter (list)

descriptorDirstring - Pyramid’s descriptor directory, to make relative data’s paths.

Example

<level>
    <tileMatrix>level_5</tileMatrix>
    <baseDir>./BDORTHO/IMAGE/level_5/</baseDir>
    <mask>
        <baseDir>./BDORTHO/MASK/level_5/</baseDir>
    </mask>
    <tilesPerWidth>16</tilesPerWidth>
    <tilesPerHeight>16</tilesPerHeight>
    <pathDepth>2</pathDepth>
    <nodata>
        <filePath>./BDORTHO/NODATA/level_5/nd.tif</filePath>
    </nodata>
    <TMSLimits>
        <minTileRow>365</minTileRow>
        <maxTileRow>368</maxTileRow>
        <minTileCol>1026</minTileCol>
        <maxTileCol>1035</maxTileCol>
    </TMSLimits>
</level>

exportForDebug

sub exportForDebug

Returns all level’s informations.  Useful for debug.

Example

Object BE4::Level :
     ID (string) : 16, and order (integer) : 5
     Directories (depth = 2):
            - Images : /home/ign/data/pyramid/IMAGE/16
            - Nodata : /home/ign/data/pyramid/NODATA/16
            - Mask : /home/ign/data/pyramid/MASK/16
     Tile limits :
            - Column min : 783
            - Column max : 797
            - Row min : 6265
            - Row max : 6276
     Tiles per image :
            - widthwise : 16
            - heightwise : 16
my $STRLEVELTMPLT
Define the template XML for a level in the pyramid’s descriptor.
my $STRLEVELTMPLTMASK
Define the template XML for the mask part of a level in the pyramid’s descriptor.
my $STRLEVELTMPLTMORE
Define the template XML for the metadat part of a level in the pyramid’s descriptor.
sub new
Level constructor.
sub _init
Check and store level’s attributes values.
sub getID
sub getOrder
sub getDirImage
sub getDirNodata
sub getDirMask
sub getLimits
sub updateExtremTiles
Compare old extrems rows/columns with the news and update values.
sub exportToXML
Insert Level’s attributes in the XML template, write in the pyramid’s descriptor.
sub exportForDebug
Returns all level’s informations.
Close