27 #include "../../../dataaccess/dataset/DataSet.h"
28 #include "../../../dataaccess/dataset/DataSetAdapter.h"
29 #include "../../../dataaccess/dataset/DataSetType.h"
30 #include "../../../dataaccess/dataset/DataSetTypeConverter.h"
31 #include "../../../dataaccess/datasource/DataSource.h"
32 #include "../../../dataaccess/utils/Utils.h"
33 #include "../../../geometry/GeometryProperty.h"
34 #include "../../../maptools/DataSetAdapterLayer.h"
35 #include "../../../se/FeatureTypeStyle.h"
36 #include "../../../se/Utils.h"
39 #include "ui_DataPropertiesDialogForm.h"
40 #include "ui_DataPropertiesWidgetForm.h"
43 #include <boost/uuid/random_generator.hpp>
44 #include <boost/uuid/uuid_io.hpp>
48 const std::string& propertyName)
52 while(dataset->moveNext())
63 m_ui(new Ui::DataPropertiesDialogForm)
71 QGridLayout* layout =
new QGridLayout(
m_ui->m_dataWidgetFrame);
73 layout->setContentsMargins(0,0,0,0);
74 this->layout()->setSizeConstraint(QLayout::SetFixedSize);
79 m_ui->m_helpPushButton->setPageReference(
"widgets/external_table/external_table.html");
84 delete m_dataPropertiesWidget;
89 static boost::uuids::basic_random_generator<boost::mt19937> gen;
90 boost::uuids::uuid u = gen();
91 std::string
id = boost::uuids::to_string(u);
93 if(m_dataPropertiesWidget->getDataSetType())
95 std::string title = m_dataPropertiesWidget->getDataSetType()->getTitle().empty() ? m_dataPropertiesWidget->getDataSetType()->getName() : m_dataPropertiesWidget->getDataSetType()->getTitle();
97 m_DataSetAdapterLayer->setDataSetName(m_dataPropertiesWidget->getDataSetType()->getName());
98 m_DataSetAdapterLayer->setDataSourceId(m_dataPropertiesWidget->getDataSource()->getId());
100 m_DataSetAdapterLayer->setRendererType(
"ABSTRACT_LAYER_RENDERER");
101 m_DataSetAdapterLayer->setConverter(m_dataPropertiesWidget->getConverter());
103 if(m_DataSetAdapterLayer->getConverter()->getResult()->hasGeom())
106 std::auto_ptr<te::gm::Envelope> mbr(
te::da::GetExtent(m_DataSetAdapterLayer->getDataSetName(), gp->
getName(), m_DataSetAdapterLayer->getDataSourceId()));
112 m_DataSetAdapterLayer->setExtent(*(mbr.release()));
114 m_DataSetAdapterLayer->setSRID(gp->
getSRID());
126 return m_DataSetAdapterLayer;
TEDATAACCESSEXPORT te::gm::Envelope * GetExtent(const std::string &datasetName, const std::string &propertyName, const std::string &datasourceId)
void Union(const Envelope &rhs)
It updates the envelop with coordinates of another envelope.
TESEEXPORT Style * CreateFeatureTypeStyle(const te::gm::GeomType &geomType)
Try creates an appropriate feature type style based on given geometry type.
A layer with reference to a DataSetTypeConverter.
int getSRID() const
It returns the spatial reference system identifier associated to this property.
An Envelope defines a 2D rectangular region.
GeomType getGeometryType() const
It returns the geometry subtype allowed for the property.
Geometry is the root class of the geometries hierarchy, it follows OGC and ISO standards.
boost::intrusive_ptr< DataSetAdapterLayer > DataSetAdapterLayerPtr
A dialog used to configure the properties of a new textual file based layer.
TEDATAACCESSEXPORT te::gm::GeometryProperty * GetFirstGeomProperty(const DataSetType *dt)
const Envelope * getMBR() const
It returns the minimum bounding rectangle for the geometry in an internal representation.
te::gm::Envelope & computeDataSetEnvelope(std::auto_ptr< te::da::DataSet > dataset, const std::string &propertyName)
const std::string & getName() const
It returns the property name.