27 #include "../common/ByteSwapUtils.h" 28 #include "../common/Globals.h" 29 #include "../common/StringUtils.h" 30 #include "../core/translator/Translator.h" 31 #include "../dataaccess/dataset/DataSetType.h" 32 #include "../datatype/Array.h" 33 #include "../datatype/ByteArray.h" 34 #include "../datatype/DateTimeProperty.h" 35 #include "../datatype/SimpleData.h" 36 #include "../datatype/TimeInstant.h" 37 #include "../geometry/Envelope.h" 38 #include "../geometry/Geometry.h" 39 #include "../geometry/GeometryProperty.h" 40 #include "../geometry/MultiLineString.h" 41 #include "../geometry/MultiPoint.h" 42 #include "../geometry/MultiPolygon.h" 43 #include "../geometry/WKBReader.h" 51 #include <terralib4/kernel/TeAttribute.h> 52 #include <terralib4/kernel/TeDatabase.h> 53 #include <terralib4/kernel/TeLayer.h> 55 #include <terralib4/kernel/TeQuerierParams.h> 62 #include <boost/dynamic_bitset.hpp> 63 #include <boost/lexical_cast.hpp> 75 TeQuerierParams params(
true,
true);
88 for(
int i = 0; i !=
m_nCols; ++i)
95 if((
m_layer->hasGeometry(TePOLYGONS) ||
96 m_layer->hasGeometry(TeLINES) ||
97 m_layer->hasGeometry(TePOINTS) ||
98 m_layer->hasGeometry(TeNODES) ||
157 return !(
size() > 0);
238 int ii =
static_cast<int>(i);
241 return boost::lexical_cast<boost::int16_t>(val);
247 int ii =
static_cast<int>(i);
250 return boost::lexical_cast<boost::int32_t>(val);
256 int ii =
static_cast<int>(i);
259 return boost::lexical_cast<boost::int64_t>(val);
265 int ii =
static_cast<int>(i);
268 return boost::lexical_cast<
bool>(val);
279 int ii =
static_cast<int>(i);
284 return boost::lexical_cast<
double>(val);
290 int ii =
static_cast<int>(i);
302 int ii =
static_cast<int>(i);
323 std::vector<TeGeometry*> geoms;
326 int srid =
m_layer->projection()->epsgCode();
332 std::unique_ptr<te::gm::Geometry> result;
352 for (std::size_t i = 0; i < geoms.size(); ++i)
358 aux->
add(t5g.release());
361 result->setSRID(srid);
380 return std::unique_ptr<te::dt::Array>();
393 int ii =
static_cast<int>(i);
Property * getProperty(std::size_t i) const
It returns the i-th property.
MultiPolygon is a MultiSurface whose elements are Polygons.
bool moveLast()
It sets the dataset internal pointer to the last item in the collection.
std::unique_ptr< te::dt::ByteArray > getByteArray(std::size_t i) const
Method for retrieving a byte array.
std::size_t size() const
It returns the collection size, if it is known.
GeomType
Each enumerated type is compatible with a Well-known Binary (WKB) type code.
VectorDataSet(TeLayer *layer)
TETERRALIB4EXPORT std::string Convert2Utf8(const std::string &str)
boost::int32_t getInt32(std::size_t i) const
Method for retrieving a 32-bit integer attribute value (4 bytes long).
A class that models the description of a dataset.
te::common::AccessPolicy getAccessPolicy() const
It returns the read and write permission associated to the dataset.
std::size_t getNumProperties() const
It returns the number of properties that composes an item of the dataset.
bool isBeforeBegin() const
It tells if the dataset internal pointer is in a position before the first element of the collection ...
std::string getNumeric(std::size_t i) const
Method for retrieving a numeric attribute value.
unsigned char getUChar(std::size_t i) const
Method for retrieving an unsigned character attribute value (1 byte long).
char getChar(std::size_t i) const
Method for retrieving a signed character attribute value (1 byte long).
int getPropertyDataType(std::size_t i) const
It returns the underlying data type of the property at position pos.
bool move(std::size_t i)
It moves the dataset internal pointer to a given position.
std::unique_ptr< te::rst::Raster > getRaster(std::size_t i) const
Method for retrieving a raster attribute value.
boost::int16_t getInt16(std::size_t i) const
Method for retrieving a 16-bit integer attribute value (2 bytes long).
std::unique_ptr< te::dt::Property > Convert2T5(const TeAttributeRep &attRep)
It creates a valid TerraLib 5 property given a valid TerraLib 4.x attribute representation.
std::unique_ptr< te::dt::DateTime > getDateTime(std::size_t i) const
Method for retrieving a date and time attribute value.
std::unique_ptr< te::dt::Array > getArray(std::size_t i) const
Method for retrieving an array.
std::string getPropertyName(std::size_t i) const
It returns the property name at position pos.
AccessPolicy
Supported data access policies (can be used as bitfield).
TraverseType
A dataset can be traversed in two ways:
MultiPoint is a GeometryCollection whose elements are restricted to points.
double getDouble(std::size_t i) const
Method for retrieving a double attribute value.
static std::unique_ptr< te::gm::Geometry > getGeometry(const TeGeometry &geom)
Implements the DataSource class for the TerraLib 4.x Data Access Driver.
std::unique_ptr< te::gm::Envelope > getExtent(std::size_t i)
It computes the bounding rectangle for a spatial property of the dataset.
te::gm::GeomType GetMinimalRepresentation(const std::vector< TeGeometry * > &geoms)
std::unique_ptr< te::gm::Geometry > getGeometry(std::size_t i) const
Method for retrieving a geometric attribute value.
bool isAfterEnd() const
It tells if the dataset internal pointer is on the sentinel position after the last element of the co...
std::string getString(std::size_t i) const
Method for retrieving a string value attribute.
void CheckDecimalSeparator(std::string &value)
std::string getDatasetNameOfProperty(std::size_t i) const
It returns the underlying dataset name of the property at position pos.
te::common::TraverseType getTraverseType() const
It returns the traverse type associated to the dataset.
int getType() const
It returns the property data type.
void add(Constraint *c)
It adds a new constraint.
MultiLineString is a MultiCurve whose elements are LineStrings.
boost::int64_t getInt64(std::size_t i) const
Method for retrieving a 64-bit integer attribute value (8 bytes long).
bool moveBeforeFirst()
It moves the internal pointer to a position before the first item in the collection.
bool isConnected() const
It returns true if the dataset is connected and false if it is disconnected. A dataset can be connect...
bool moveFirst()
It moves the internal pointer to the first item in the collection.
void add(Geometry *g)
It adds the geometry into the collection.
bool isEmpty() const
It returns true if the collection is empty.
bool getBool(std::size_t i) const
Method for retrieving a boolean attribute value.
bool isNull(std::size_t i) const
It checks if the attribute value is NULL.
Utilitary functions for dealing with TerraLib 5 and 4.x conversion.
float getFloat(std::size_t i) const
Method for retrieving a float attribute value.
bool isPositionValid() const
It tells if the dataset internal pointer is on a valid position.
bool isAtBegin() const
It tells if the dataset internal pointer is on the first element of the collection or not...
An utility class for converting a TerraLib 4.x geometry to a TerraLib 5.
bool moveNext()
It moves the internal pointer to the next item of the collection.
It is a collection of other geometric objects.
bool isAtEnd() const
It tells if the dataset internal pointer is on the last element of the collection.
bool movePrevious()
It moves the internal pointer to the previous item of the collection.
te::da::DataSetType * m_dt