DataSourceLoader.pm

Summary
DataSourceLoader.pm
BE4::DataSourceLoaderLoads, validates and manages data sources.
Constructors
newDataSourceLoader constructor.
_initChecks the “datasource” section.
_loadReads the specific data sources configuration file and creates corresponding DataSource objects.
_loadOldAllow to use old method to define datasource (just one).
Data sources update
updateDataSourcesFrom data sources, TMS and parameters, we identify top and bottom :
Getters - Setters
getDataSources
getNumberDataSources
Export methods
exportForDebugReturns all informations about the data sources loader.
detailsConfiguration file exmaples.

BE4::DataSourceLoader

Exporter
BE4::DataSourceLoader

Loads, validates and manages data sources.  Data sources informations are read from a specific configuration file or directly in an hash (old working).

Using

use BE4::DataSourceLoader

# DataSourceLoader object creation
my $objDataSourceLoader = BE4::DataSourceLoader->new({
    filepath_conf => "/home/IGN/CONF/source.txt",
});

# DataSourceLoader object creation for old configuration (just one data source)
my $objDataSourceLoader = BE4::DataSourceLoader->new(
    { # datasource section
        SRS         => "IGNF:LAMB93",
        path_image  => "/home/IGN/DATA/IMAGES/",
    },
    { # harvesting section
        wms_layer   => ORTHO_RAW_LAMB93_PARIS_OUEST
        wms_url     => http://localhost/wmts/rok4
        wms_version => 1.3.0
        wms_request => getMap
        wms_format  => image/tiff
    },
    $bottomLevel, # bottom level for this one data source
);

Attributes

FILEPATH_DATACONFstring - Path to the specific datasources configuration file.  Is undefined if old way is used.
dataSourcesDataSource array - Data sources ensemble.  Can contain just one element.

Limitations

Metadata managing not yet implemented.

Summary
Constructors
newDataSourceLoader constructor.
_initChecks the “datasource” section.
_loadReads the specific data sources configuration file and creates corresponding DataSource objects.
_loadOldAllow to use old method to define datasource (just one).
Data sources update
updateDataSourcesFrom data sources, TMS and parameters, we identify top and bottom :
Getters - Setters
getDataSources
getNumberDataSources
Export methods
exportForDebugReturns all informations about the data sources loader.
detailsConfiguration file exmaples.

Constructors

new

sub new

DataSourceLoader constructor.  Bless an instance.

Parameters (list)

datasourcehash - Section datasource, in the general BE4 configuration file.  Contains the key “filepath_conf” if we use a specific data sources configuration file :
filepath_conf - string - Path to the data sources configuration file

or keys “srs” and “path_image” if we use the old way :

srs - string - Source images' SRS
path_image - string - Directory contaning images
harvestinghash - If we use the old ways, section harvesting, in the general BE4 configuration file
bottomIdstring - If we use the old ways, parameter pyr_level_bottom in the section pyramid, in the general BE4 configuration file, to define from which level data source is used.

See also

_init, _load, _loadOld

_init

sub _init

Checks the “datasource” section.  Must contain keys “path_image” or “filepath_conf” (and path is tested)

Parameters (list)

datasourcehash - Section datasource, in the general BE4 configuration file.  Contains the key “filepath_conf” if we use a specific data sources configuration file :
filepath_conf - string - Path to the data sources configuration file

or keys “srs” and “path_image” if we use the old way :

srs - string - Source images' SRS
path_image - string - Directory contaning images

_load

sub _load

Reads the specific data sources configuration file and creates corresponding DataSource objects.

_loadOld

sub _loadOld

Allow to use old method to define datasource (just one).  Use be4 configuration sections datasource, harvesting and parameter pyr_level_bottom.  Creates a DataSource.

Parameters (list)

datasourcehash - Section datasource, in the general BE4 configuration file.  Contains the keys “srs” and “path_image” :
srs - string - Source images' SRS
path_image - string - Directory contaning images
harvestinghash - If we use the old ways, section harvesting, in the general BE4 configuration file
bottomIdstring - If we use the old ways, parameter pyr_level_bottom in the section pyramid, in the general BE4 configuration file, to define from which level data source is used.

Data sources update

updateDataSources

sub updateDataSources

From data sources, TMS and parameters, we identify top and bottom :

  • bottom level = the lowest level among data source base levels
  • top level = levelID in parameters if defined, top level of TMS otherwise.

For each datasource, we store the order and the ID of the higher level which use this datasource.  The base level (from which datasource is used) is already known.

Example (with 2 data sources) :

  • DataSource1: from level_18 (order 2) to level_16 (order 4)
  • DataSource1: from level_15 (order 5) to level_12 (order 8)

There are no superposition between data sources.

Parameters

TMSTileMatrixSet - To know levels’ orders
topIDstring - Optionnal, from the pyramid section in the configuration file

Returns the global bottom and top order, in a integer list : (bottomOrder,topOrder), (-1,-1) if failure.

Getters - Setters

getDataSources

sub getDataSources

getNumberDataSources

sub getNumberDataSources

Export methods

exportForDebug

sub exportForDebug

Returns all informations about the data sources loader.  Useful for debug.

Example

details

Configuration file exmaples.

In the be4 configuration, section datasource (multidata.conf)

[ datasource ]
filepath_conf       = /home/IGN/CONF/source.txt

In the source configuration (source.txt)

[ 19 ]

srs                 = IGNF:LAMB93
path_image          = /home/theo/DONNEES/BDORTHO_PARIS-OUEST_2011_L93/DATA

wms_layer   = ORTHO_RAW_LAMB93_PARIS_OUEST
wms_url     = http://localhost/wmts/rok4
wms_version = 1.3.0
wms_request = getMap
wms_format  = image/tiff
max_width = 2048
max_height = 2048

[ 14 ]

srs = IGNF:WGS84G
extent = /home/IGN/SHAPE/Polygon.txt

wms_layer   = ORTHO_RAW_LAMB93_D075-O
wms_url     = http://localhost/wmts/rok4
wms_version = 1.3.0
wms_request = getMap
wms_format  = image/tiff
max_width = 4096
max_height = 4096
sub new
DataSourceLoader constructor.
sub _init
Checks the “datasource” section.
sub _load
Reads the specific data sources configuration file and creates corresponding DataSource objects.
Manage a data source, physical (image files) or virtual (WMS server) or both.
sub _loadOld
Allow to use old method to define datasource (just one).
sub updateDataSources
From data sources, TMS and parameters, we identify top and bottom :
sub getDataSources
sub getNumberDataSources
sub exportForDebug
Returns all informations about the data sources loader.
Load and store all information about a Tile Matrix Set.
Close