25 #include "../common.h" 26 #include "../common/progress/TaskProgress.h" 27 #include "../core/translator/Translator.h" 29 #include "../dataaccess/dataset/DataSet.h" 30 #include "../dataaccess/dataset/DataSetAdapter.h" 31 #include "../dataaccess/dataset/DataSetType.h" 32 #include "../dataaccess/dataset/DataSetTypeConverter.h" 33 #include "../dataaccess/dataset/ObjectIdSet.h" 34 #include "../dataaccess/datasource/DataSource.h" 35 #include "../dataaccess/datasource/DataSourceCapabilities.h" 36 #include "../dataaccess/utils/Utils.h" 38 #include "../datatype/Property.h" 39 #include "../datatype/StringProperty.h" 41 #include "../geometry/GeometryProperty.h" 42 #include "../geometry/Line.h" 43 #include "../geometry/LineString.h" 44 #include "../geometry/Polygon.h" 45 #include "../geometry/Point.h" 46 #include "../geometry/Utils.h" 48 #include "../memory/DataSetItem.h" 50 #include "../raster.h" 51 #include "../raster/BandProperty.h" 52 #include "../raster/Grid.h" 53 #include "../raster/RasterFactory.h" 55 #include "../rp/RasterAttributes.h" 57 #include "../statistics/core/Utils.h" 63 #include <boost/lexical_cast.hpp> 68 std::string inVectorName,
69 std::unique_ptr<te::da::DataSetTypeConverter> inVectorDsType)
125 std::size_t propPos = boost::lexical_cast<std::size_t>(
m_inVectorDsType->getResult()->getPropertyPosition(geomProp->
getName()));
132 std::vector<te::rst::BandProperty*> vecBandProp;
141 vecBandProp.push_back(bProp);
145 std::map<std::string, std::string> conInfo;
146 conInfo[
"URI"] =
m_outDsrc->getConnectionInfo().host() +
m_outDsrc->getConnectionInfo().path();
154 std::string geomName = geomProp->
getName();
155 std::map<te::gm::Geometry*, std::vector<double> > vectorMap;
157 inDataSet->moveBeforeFirst();
158 while(inDataSet->moveNext())
161 std::vector<double> valueVec;
168 vectorMap.insert(std::pair<
te::gm::Geometry*, std::vector<double> >(geom, valueVec));
177 std::map<te::gm::Geometry*, std::vector<double> >::iterator vectorIt = vectorMap.begin();
179 while(vectorIt != vectorMap.end())
181 switch (vectorIt->first->getGeomTypeId())
186 std::vector<te::gm::Geometry*> geomVec;
191 geomVec.push_back(vectorIt->first);
193 for (std::size_t g = 0; g < geomVec.size(); ++g)
216 std::vector<te::gm::Geometry*> geomVec;
221 geomVec.push_back(vectorIt->first);
224 for (std::size_t g = 0; g < geomVec.size(); ++g)
231 std::size_t nPoints = lineString->
getNPoints();
233 for (std::size_t n = 0; n < nPoints - 1; ++n)
256 std::vector<te::gm::Geometry*> geomVec;
261 geomVec.push_back(vectorIt->first);
263 for (std::size_t g = 0; g < geomVec.size(); ++g)
265 std::vector<te::gm::Point*> pointVec;
271 pointVec.push_back(point);
297 throw te::attributefill::Exception(
TE_TR(
"Operation canceled!"));
A Line is LineString with 2 points.
void setSRID(int srid) _NOEXCEPT_OP(true)
It sets the Spatial Reference System ID of the Point.
void setSRID(int srid)
It sets the Spatial Reference System ID of the geometry and all its parts if it is a GeometryCollecti...
boost::shared_ptr< DataSource > DataSourcePtr
A raster band description.
void useTimer(bool flag)
Used to define if task use progress timer information.
unsigned int getColumn() const
Returns the current column in iterator.
This class implements the strategy to iterate with spatial restriction, the iteration occurs inside a...
This class implements the strategy to iterate with spatial restriction, the iteration occurs inside a...
This class can be used to inform the progress of a task.
std::unique_ptr< Point > getPointN(std::size_t i) const
It returns the specified point in this LineString.
static PointSetIterator end(const te::rst::Raster *r, const std::vector< te::gm::Point * > p)
Returns an iterator referring to after the end of the iterator.
TERASTEREXPORT void FillRaster(te::rst::Raster *rin, const std::complex< double > &value)
Fill a Raster with provided value (all bands).
unsigned int getRow() const
Returns the current row in iterator.
double m_noDataValue
Value to indicate elements where there is no data, default is std::numeric_limits<double>::max().
#define TE_TR(message)
It marks a string in order to get translated.
TEGEOMEXPORT void Multi2Single(const te::gm::Geometry *g, std::vector< te::gm::Geometry * > &geoms)
It will get a GeometryCollection and distribute in a vector.
bool isActive() const
Verify if the task is active.
This class implements the strategy to iterate with spatial restriction, the iteration occurs inside a...
void setTotalSteps(int value)
Set the task total stepes.
te::da::DataSourcePtr m_inVectorDsrc
LineString is a curve with linear interpolation between points.
static PolygonIterator end(const te::rst::Raster *r, const te::gm::Polygon *p)
Returns an iterator referring to after the end of the iterator.
int getSRID() const
It returns the spatial reference system identifier associated to this property.
A point with x and y coordinate values.
An Envelope defines a 2D rectangular region.
void setInput(te::da::DataSourcePtr inVectorDsrc, std::string inVectorName, std::unique_ptr< te::da::DataSetTypeConverter > inVectorDsType)
std::string m_inVectorName
std::size_t getNPoints() const
It returns the number of points (vertexes) in the linestring.
void pulse()
Calls setCurrentStep() function using getCurrentStep() + 1.
Vector to Raster processing.
Geometry is the root class of the geometries hierarchy, it follows OGC and ISO standards.
std::vector< std::string > m_selectedAttVec
static PolygonIterator begin(const te::rst::Raster *r, const te::gm::Polygon *p, const IterationType iterationType)
Returns an iterator referring to the first value of the band.
void setParams(std::vector< std::string > selectedAttVec, double resolutionX, double resolutionY, int columns, int rows, bool useDummy, int dummy=0)
Polygon is a subclass of CurvePolygon whose rings are defined by linear rings.
te::da::DataSourcePtr m_outDsrc
unsigned int getColumn() const
Returns the current column in iterator.
static Raster * make()
It creates and returns an empty raster with default raster driver.
static LineIterator end(const te::rst::Raster *r, const te::gm::Line *l)
Returns an iterator referring to after the end of the iterator.
unsigned int getRow() const
Returns the current row in iterator.
unsigned int getColumn() const
Returns the current column in iterator.
TEDATAACCESSEXPORT te::gm::GeometryProperty * GetFirstGeomProperty(const DataSetType *dt)
A rectified grid is the spatial support for raster data.
void setOutput(te::da::DataSourcePtr outDsrc, std::string dsName)
unsigned int getRow() const
Returns the current row in iterator.
An exception class for the Attribute Fill module.
static PointSetIterator begin(const te::rst::Raster *r, const std::vector< te::gm::Point * > p)
Returns an iterator referring to the first value of the band.
std::unique_ptr< te::da::DataSetTypeConverter > m_inVectorDsType
static LineIterator begin(const te::rst::Raster *r, const te::gm::Line *l)
Returns an iterator referring to the first value of the band.
const std::string & getName() const
It returns the property name.