27 #include "../../../geometry/Envelope.h" 28 #include "../../../geometry/GeometryProperty.h" 29 #include "../../../qt/widgets/dataset/selector/DataSetSelectorWizardPage.h" 30 #include "../../../qt/widgets/datasource/selector/DataSourceSelectorWidget.h" 31 #include "../../../qt/widgets/datasource/selector/DataSourceSelectorWizardPage.h" 32 #include "../../../qt/widgets/help/HelpPushButton.h" 33 #include "../../../se/Utils.h" 34 #include "../../../st/core/observation/ObservationDataSetInfo.h" 37 #include "ui_ObservationWizardForm.h" 40 #include <boost/uuid/random_generator.hpp> 41 #include <boost/uuid/uuid_io.hpp> 48 static boost::uuids::basic_random_generator<boost::mt19937> gen;
49 boost::uuids::uuid u = gen();
50 std::string
id = boost::uuids::to_string(u);
51 std::string title = dataType->getTitle().empty() ? dataType->getName() : dataType->getTitle();
55 observationLayer->setRendererType(
"ABSTRACT_LAYER_RENDERER");
59 observationLayer->setSRID(gp->
getSRID());
60 observationLayer->setExtent(*mbr);
62 return observationLayer;
67 m_ui(new
Ui::ObservationWizardForm)
82 m_datasetSelectorPage->setSubTitle(tr(
"Please, select the datasets you want to transfer to another data source"));
88 m_PropWidgetPage->setSubTitle(tr(
"Please, adjust the temporal properties of the new Observation Layer"));
92 connect(this->button(QWizard::NextButton), SIGNAL(pressed()),
this, SLOT(
next()));
93 connect(this->button(QWizard::BackButton), SIGNAL(pressed()),
this, SLOT(
back()));
94 connect(this->button(QWizard::FinishButton), SIGNAL(pressed()),
this, SLOT(
finish()));
97 this->setButton(QWizard::HelpButton, helpButton);
107 if(datasources.empty())
110 return datasources.front();
138 QApplication::setOverrideCursor(Qt::WaitCursor);
144 std::list<te::st::ObservationDataSetInfo*> infos =
m_PropWidgetPage->getInfo(dataInfo);
145 std::list<te::st::ObservationDataSetInfo*>::const_iterator infosBegin = infos.begin();
146 std::list<te::st::ObservationDataSetInfo*>::const_iterator infosEnd = infos.end();
147 std::list<te::da::DataSetTypePtr>::const_iterator typesItBegin = dataTypes.begin();
149 if (infos.size() == 1)
155 static boost::uuids::basic_random_generator<boost::mt19937> gen;
156 boost::uuids::uuid u = gen();
157 std::string
id = boost::uuids::to_string(u);
159 while(infosBegin != infosEnd)
169 std::cout << std::endl <<
"Failed to create a new layer and insert it into the application: " << e.
what() << std::endl;
170 QWizard::finished(1);
174 std::cout << std::endl <<
"Failed to create a new layer and insert it into the application: unknown exception!" << std::endl;
175 QWizard::finished(1);
178 QApplication::restoreOverrideCursor();
179 QWizard::finished(0);
TEDATAACCESSEXPORT te::gm::Envelope * GetExtent(const std::string &datasetName, const std::string &propertyName, const std::string &datasourceId)
boost::shared_ptr< DataSetType > DataSetTypePtr
A layer with reference to a dataset that contains observations.
This is the base class for layers.
A class that contains infos about a DataSet that contains observations.
boost::intrusive_ptr< ObservationDataSetLayer > ObservationDataSetLayerPtr
virtual const char * what() const
It outputs the exception message.
TESEEXPORT Style * CreateFeatureTypeStyle(const te::gm::GeomType &geomType)
Try creates an appropriate feature type style based on given geometry type.
int getSRID() const
It returns the spatial reference system identifier associated to this property.
GeomType getGeometryType() const
It returns the geometry subtype allowed for the property.
A WizardPage used to configure the general properties of a new spatio-temporal layer.
This class is designed to declare objects to be thrown as exceptions by TerraLib. ...
te::st::ObservationDataSetLayerPtr generateLayer(te::da::DataSetTypePtr dataType, te::st::ObservationDataSetInfo *obsInfo, te::da::DataSourceInfoPtr dataInfo, te::map::AbstractLayer *parent=nullptr)
TEDATAACCESSEXPORT te::gm::GeometryProperty * GetFirstGeomProperty(const DataSetType *dt)
A wizard used to generate a new Observationlayer.
boost::shared_ptr< DataSourceInfo > DataSourceInfoPtr
const std::string & getName() const
It returns the property name.