31#include <dispatch/BESRequestHandlerList.h>
32#include <dispatch/BESContainerStorageList.h>
33#include <dispatch/BESFileContainerStorage.h>
34#include <dispatch/BESCatalogDirectory.h>
35#include <dispatch/BESCatalogList.h>
36#include <dispatch/BESReturnManager.h>
37#include <dispatch/BESServiceRegistry.h>
38#include <dispatch/BESDebug.h>
40#include <dap/BESDapNames.h>
41#include <dap/BESDapService.h>
43#include "GDALModule.h"
44#include "GDALRequestHandler.h"
45#include "writer/GeoTiffTransmitter.h"
46#include "writer/JPEG2000Transmitter.h"
48#define GDAL_CATALOG "catalog"
49#define RETURNAS_GEOTIFF "geotiff"
50#define RETURNAS_JPEG2000 "jpeg2000"
56void GDALModule::initialize(
const string & modname)
58 BESDEBUG(
"gdal",
"Initializing GDAL module " << modname << endl);
61 BESRequestHandlerList::TheList()->
add_handler(modname, handler);
71 if (!BESContainerStorageList::TheList()->ref_persistence(GDAL_CATALOG)) {
77 BESReturnManager::TheManager()->add_transmitter(RETURNAS_GEOTIFF,
new GeoTiffTransmitter());
78 BESServiceRegistry::TheRegistry()->
add_format(OPENDAP_SERVICE, DATA_SERVICE, RETURNAS_GEOTIFF);
81 BESReturnManager::TheManager()->add_transmitter(RETURNAS_JPEG2000,
new JPEG2000Transmitter());
82 BESServiceRegistry::TheRegistry()->
add_format(OPENDAP_SERVICE, DATA_SERVICE, RETURNAS_JPEG2000);
87 BESDEBUG(
"gdal",
"Done Initializing GDAL module " << modname << endl);
90void GDALModule::terminate(
const string & modname)
92 BESDEBUG(
"gdal",
"Cleaning GDAL module " << modname << endl);
98 BESReturnManager::TheManager()->del_transmitter(RETURNAS_GEOTIFF);
100 BESReturnManager::TheManager()->del_transmitter(RETURNAS_JPEG2000);
105 BESDEBUG(
"gdal",
"Done Cleaning GDAL module " << modname << endl);
116 strm << BESIndent::LMarg <<
"GDALModule::dump - (" << (
void *)
this <<
")" << endl;
Catalogs from a directory structure.
static BESCatalogList * TheCatalogList()
Get the singleton BESCatalogList instance.
virtual bool add_persistence(BESContainerStorage *p)
Add a persistent store to the list.
virtual bool deref_persistence(const std::string &persist_name)
dereference a persistent store in the list.
static void handle_dap_service(const std::string &handler)
static function to register a handler to handle the dap services
static void Register(const std::string &flagName)
register the specified debug flag
implementation of BESContainerStorage that represents a data within a catalog repository
virtual bool add_handler(const std::string &handler_name, BESRequestHandler *handler)
add a request handler to the list of registered handlers for this server
virtual BESRequestHandler * remove_handler(const std::string &handler_name)
remove and return the specified request handler
Represents a specific data type request handler.
virtual void add_format(const std::string &service, const std::string &cmd, const std::string &format)
add a format response to a command of a service
virtual void dump(std::ostream &strm) const
dumps information about this object
BESTransmitter class named "geotiff" that transmits an OPeNDAP data object as a geotiff file.
BESTransmitter class named "geotiff" that transmits an OPeNDAP data object as a geotiff file.