4 #include "../../../../core/translator/Translator.h" 5 #include "../../../../dataaccess/datasource/DataSource.h" 6 #include "../../../../dataaccess/datasource/DataSourceManager.h" 7 #include "../../../../dataaccess/datasource/DataSourceInfoManager.h" 8 #include "../../../../maptools/DataSetLayer.h" 9 #include "../../../../qt/widgets/dataset/selector/DataSetSelectorDialog.h" 10 #include "../../../../qt/widgets/layer/utils/DataSet2Layer.h" 11 #include "../dataaccess/DataSource.h" 12 #include "../client/WCSClient.h" 13 #include "../client/DataTypes.h" 18 #include <boost/uuid/random_generator.hpp> 19 #include <boost/uuid/uuid_io.hpp> 22 :
te::qt::widgets::AbstractLayerSelector(parent, f)
36 std::list<te::map::AbstractLayerPtr> layers;
40 if(datasource.get() ==
nullptr)
46 if(!datasource->isOpened())
51 std::shared_ptr<te::ws::ogc::WCSClient> client = wcsDataSource->
getWCSClient();
54 ldialog->set(*it,
true);
55 int retval = ldialog->exec();
56 if(retval == QDialog::Rejected)
58 std::list<te::da::DataSetTypePtr> datasets = ldialog->getCheckedDataSets();
60 std::list<te::da::DataSetTypePtr>::iterator itDataset = datasets.begin();
62 for(;itDataset != datasets.end(); ++itDataset)
66 request.
format =
"image/tiff";
69 boost::uuids::basic_random_generator<boost::mt19937> gen;
70 boost::uuids::uuid u = gen();
71 std::string
id = boost::uuids::to_string(u);
76 std::string coverageDiskPath = client->getCoverage(request, &task);
81 dsInfo->setConnInfo(
"file://" + coverageDiskPath);
82 dsInfo->setTitle(coverageDiskPath);
83 dsInfo->setAccessDriver(
"GDAL");
84 dsInfo->setType(
"GDAL");
85 dsInfo->setDescription(coverageDiskPath);
90 std::string dataSetName = ds->getDataSetNames()[0];
96 layers.push_back(layer);
Implementation of the data source for the WCS driver.
void setMessage(const std::string &message)
Set the task message.
A simple widget that allows the selection of datasets from a given WCS server.
boost::shared_ptr< DataSetType > DataSetTypePtr
boost::shared_ptr< DataSource > DataSourcePtr
This XML Schema Document named xlinks xsd has been stored here based on the change request
This class can be used to inform the progress of a task.
static te::dt::Date ds(2010, 01, 01)
void setTotalSteps(int value)
Set the task total stepes.
std::shared_ptr< te::ws::ogc::WCSClient > getWCSClient() const
static DataSourceManager & getInstance()
It returns a reference to the singleton instance.
static te::dt::TimeDuration dt(20, 30, 50, 11)
A struct to set the parameters of requested coverage.
std::list< te::da::DataSourceInfoPtr > m_datasources
A class that represents a data source component.
std::list< te::map::AbstractLayerPtr > getLayers()
void set(const std::list< te::da::DataSourceInfoPtr > &datasources)
WCSLayerSelector(QWidget *parent=0, Qt::WindowFlags f=0)
boost::intrusive_ptr< AbstractLayer > AbstractLayerPtr
boost::shared_ptr< DataSourceInfo > DataSourceInfoPtr