27 #include "../../../geometry/GeometryProperty.h" 28 #include "../../../qt/widgets/dataset/selector/DataSetSelectorWizardPage.h" 29 #include "../../../qt/widgets/datasource/selector/DataSourceSelectorWidget.h" 30 #include "../../../qt/widgets/datasource/selector/DataSourceSelectorWizardPage.h" 31 #include "../../../qt/widgets/help/HelpPushButton.h" 32 #include "../../../se/Utils.h" 33 #include "../../../st/core/trajectory/TrajectoryDataSetInfo.h" 36 #include "ui_TrajectoryWizardForm.h" 39 #include <boost/uuid/random_generator.hpp> 40 #include <boost/uuid/uuid_io.hpp> 47 static boost::uuids::basic_random_generator<boost::mt19937> gen;
48 boost::uuids::uuid u = gen();
49 std::string
id = boost::uuids::to_string(u);
50 std::string title = dataType->getTitle().empty() ? dataType->getName() : dataType->getTitle();
54 trajectoryLayer->setRendererType(
"ABSTRACT_LAYER_RENDERER");
58 trajectoryLayer->setSRID(gp->
getSRID());
59 trajectoryLayer->setExtent(*mbr);
61 return trajectoryLayer;
66 m_ui(new
Ui::TrajectoryWizardForm)
81 m_datasetSelectorPage->setSubTitle(tr(
"Please, select the datasets you want to transfer to another data source"));
87 m_PropWidgetPage->setSubTitle(tr(
"Please, adjust the temporal properties of the new Trajectory Layer"));
91 connect(this->button(QWizard::NextButton), SIGNAL(pressed()),
this, SLOT(
next()));
92 connect(this->button(QWizard::BackButton), SIGNAL(pressed()),
this, SLOT(
back()));
93 connect(this->button(QWizard::FinishButton), SIGNAL(pressed()),
this, SLOT(
finish()));
96 this->setButton(QWizard::HelpButton, helpButton);
106 if(datasources.empty())
109 return datasources.front();
137 QApplication::setOverrideCursor(Qt::WaitCursor);
143 std::list<te::st::TrajectoryDataSetInfo*> infos =
m_PropWidgetPage->getInfo(dataInfo);
144 std::list<te::st::TrajectoryDataSetInfo*>::const_iterator infosBegin = infos.begin();
145 std::list<te::st::TrajectoryDataSetInfo*>::const_iterator infosEnd = infos.end();
146 std::list<te::da::DataSetTypePtr>::const_iterator typesItBegin = dataTypes.begin();
148 if (infos.size() == 1)
154 while(infosBegin != infosEnd)
164 std::cout << std::endl <<
"Failed to create a new layer and insert it into the application: " << e.
what() << std::endl;
165 QWizard::finished(1);
169 std::cout << std::endl <<
"Failed to create a new layer and insert it into the application: unknown exception!" << std::endl;
170 QWizard::finished(1);
173 QApplication::restoreOverrideCursor();
174 QWizard::finished(0);
boost::intrusive_ptr< TrajectoryDataSetLayer > TrajectoryDataSetLayerPtr
TEDATAACCESSEXPORT te::gm::Envelope * GetExtent(const std::string &datasetName, const std::string &propertyName, const std::string &datasourceId)
boost::shared_ptr< DataSetType > DataSetTypePtr
This is the base class for layers.
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.
A wizard used to generate a new Trajectorylayer.
te::st::TrajectoryDataSetLayerPtr generateLayer(te::da::DataSetTypePtr dataType, te::st::TrajectoryDataSetInfo *trajInfo, te::da::DataSourceInfoPtr dataInfo, te::map::AbstractLayer *parent=nullptr)
A WizardPage used to configure the general properties of a new spatio-temporal layer.
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.
This class is designed to declare objects to be thrown as exceptions by TerraLib. ...
A class that contains infos about a DataSet that contains observations of one or more trajectories...
A layer with reference to a dataset that contains trajectories.
TEDATAACCESSEXPORT te::gm::GeometryProperty * GetFirstGeomProperty(const DataSetType *dt)
boost::shared_ptr< DataSourceInfo > DataSourceInfoPtr
const std::string & getName() const
It returns the property name.