ImageSource.pm

Summary
ImageSource.pm
BE4::ImageSourceDefine a data source, with georeferenced image directory.
Constructors
newImageSource constructor.
_initChecks and stores informations.
Images treatments
computeImageSourceDetects all handled files in PATHIMG and subdirectories and creates a corresponding GeoImage object.
getListImagesRecursive method to browse a directory and list all handled file.
computeBBoxCalculate extrem limits of images, in the source SRS.
Getters - Setters
getResolution
getSRS
getImages
Export methods
exportForDebugReturns all image source’s informations.

BE4::ImageSource

Exporter
BE4::ImageSource

Define a data source, with georeferenced image directory.

Using

use BE4::ImageSource;

# ImageSource object creation
my $objImageSource = BE4::XXX->new({
    path_image => "/home/ign/DATA",
    path_metadata=> "/home/ign/METADATA",
});

Attributes

PATHIMGstring - Path to images directory.
PATHMTDstring - Path to metadata directory.  NOT IMPLEMENTED.
imagesGeoImage array - Georeferenced images’ ensemble, found in PATHIMG and subdirectories
srsstring - SRS of the georeferenced images
bestResXdouble - Best X resolution among all images.
bestResYdouble - Best Y resolution among all images.
pixelPixel - Pixel components of all images, have to be same for each one.
preprocess_commandstring[] - elements forming an eventual call to a preprocessing command (optionnal):
_ [0] the command itself
_ [1] command arguments placed between the command and the source file (optionnal even with a command specified)
_ [2] command arguments placed between the source file and the target file (optionnal even with a command specified)
_ [3] command arguments placed after the target file (optionnal even with a command specified)
preprocess_tmp_dirstring - directory in which preprocessed images will be created.  Mandatory if a preprocessing command is given.
_ command call structure : command[0] [command[1]] PATHIMG/img.ext [command[2]] preprocess_tmp_dir/img.ext [command[3]]

Limitations

Constraint on the input format of images : TIFF (extensions .tif, .TIF, .tiff and .TIFF) PNG (extensions .png, .PNG) JPEG2000 (extensions .jp2, .JP2) BIL (extensions .bil, .BIL, .zbil, .ZBIL)

Summary
Constructors
newImageSource constructor.
_initChecks and stores informations.
Images treatments
computeImageSourceDetects all handled files in PATHIMG and subdirectories and creates a corresponding GeoImage object.
getListImagesRecursive method to browse a directory and list all handled file.
computeBBoxCalculate extrem limits of images, in the source SRS.
Getters - Setters
getResolution
getSRS
getImages
Export methods
exportForDebugReturns all image source’s informations.

Constructors

new

sub new

ImageSource constructor.  Bless an instance.

Parameters (hash)

path_imagestring - Path to images’ directory, to analyze.
srsstring - SRS of the georeferenced images

See also

_init, computeImageSource

_init

sub _init

Checks and stores informations.

Parameters (hash)

path_imagestring - Path to images’ directory, to analyze.
path_metadatastring - Path to metadata’s directory, to analyze.
srsstring - SRS of the georeferenced images
preprocess_commandstring - command to call to preprocess source images (optionnal)
preprocess_opt_begstring - command arguments placed between the command and the source file (optionnal even with a command specified)
preprocess_opt_midstring - command arguments placed between the source file and the target file (optionnal even with a command specified)
preprocess_opt_endstring - command arguments placed after the target file (optionnal even with a command specified)
preprocess_tmp_dirstring - directory in which preprocessed images will be created.  Mandatory if a preprocessing command is given.

Images treatments

computeImageSource

sub computeImageSource

Detects all handled files in PATHIMG and subdirectories and creates a corresponding GeoImage object.  Determines data’s components and check them.

See also

getListImages, GeoImage::computeInfo

getListImages

sub getListImages

Recursive method to browse a directory and list all handled file.  Returns an hash containing the image file path’s array.

{
    images => [...],
};

Parameters (list)

directorystring - Path to directory, to browse.

computeBBox

sub computeBBox

Calculate extrem limits of images, in the source SRS.

Returns a double list : (xMin,yMin,xMax,yMax).

Getters - Setters

getResolution

sub getResolution

getSRS

sub getSRS

getImages

sub getImages

Export methods

exportForDebug

sub exportForDebug

Returns all image source’s informations.  Useful for debug.

Example

sub new
ImageSource constructor.
sub _init
Checks and stores informations.
sub computeImageSource
Detects all handled files in PATHIMG and subdirectories and creates a corresponding GeoImage object.
Describes a georeferenced image and enable to know its components.
sub getListImages
Recursive method to browse a directory and list all handled file.
sub computeBBox
Calculate extrem limits of images, in the source SRS.
sub getResolution
sub getSRS
sub getImages
sub exportForDebug
Returns all image source’s informations.
Store all pixel’s intrinsic components.
sub computeInfo
Extracts and calculates all GeoImage attributes’ values, using GDAL library (see Details).
Close