12 #include "../../common/progress/TaskProgress.h" 13 #include "../../core/translator/Translator.h" 14 #include "../../dataaccess/utils/Utils.h" 15 #include "../../geometry/GeometryProperty.h" 16 #include "../../raster/BandProperty.h" 17 #include "../../raster/Grid.h" 18 #include "../../raster/RasterFactory.h" 19 #include "../../raster/RasterProperty.h" 20 #include "../../srs/SpatialReferenceSystemManager.h" 47 std::string inDsetName,
62 double vmin,
double vmax,
double minval,
double maxval,
double dummy,
63 unsigned int outputWidth,
unsigned int outputHeight,
double resxo,
double resyo)
87 std::unique_ptr<te::rst::Raster> raster(inDset->getRaster(rasterProp->
getName()));
88 if (raster->getNumberOfBands() > 1)
106 if (((val[1] <= vmax) && (val[1] >= vmin)) && ((val[3] <= vmax) && (val[3] >= vmin)) &&
107 ((val[6] <= vmax) && (val[6] >= vmin)) && ((val[4] <= vmax) && (val[4] >= vmin)))
109 if (((val[0] <= vmax) && (val[0] >= vmin)) && ((val[2] <= vmax) && (val[2] >= vmin)) &&
110 ((val[5] <= vmax) && (val[5] >= vmin)) && ((val[7] <= vmax) && (val[7] >= vmin)))
112 dx = ((val[7] + (2 * val[4]) + val[2]) - (val[5] + (2 * val[3]) + val[0])) / (8 * deltaX);
113 dy = ((val[7] + (2 * val[6]) + val[5]) - (val[2] + (2 * val[1]) + val[0])) / (8 * deltaY);
117 dx = (val[4] - val[3]) / (2 * deltaX);
118 dy = (val[6] - val[1]) / (2 * deltaY);
123 if (((val[0] <= vmax) && (val[0] >= vmin)) && ((val[2] <= vmax) && (val[2] >= vmin)) &&
124 ((val[5] <= vmax) && (val[5] >= vmin)) && ((val[7] <= vmax) && (val[7] >= vmin)))
126 dx = ((val[7] + val[2]) - (val[5] + val[0])) / (4 * deltaX);
127 dy = ((val[7] + val[5]) - (val[2] + val[0])) / (4 * deltaY);
140 std::vector< std::complex<double> > aux;
154 std::vector<te::rst::BandProperty*>
bands;
156 bands[0]->m_nblocksx = 1;
159 bands[0]->m_blkh = 1;
165 double pi = 3.1415927;
166 double teta = (90. -
m_azimuth) * (pi / 180.);
171 double cx = cos(teta) * cos(phi);
172 double cy = sin(teta) * cos(phi);
173 double cz = sin(phi);
184 for (
int i = 0; i < nrows_out; i++)
185 for (
int j = 0; j < ncols_out; j++)
188 std::vector < std::complex<double> > val1(ncols);
189 std::vector < std::complex<double> > val2(ncols);
190 std::vector < std::complex<double> > val3(ncols);
211 for (
int col = 1;
col < ncols - 1;
col++)
214 val[0] = val1[
col - 1].real();
215 val[1] = val1[
col].real();
216 val[2] = val1[
col + 1].real();
217 val[3] = val2[
col - 1].real();
218 val[4] = val2[
col + 1].real();
219 val[5] = val3[
col - 1].real();
220 val[6] = val3[
col].real();
221 val[7] = val3[
col + 1].real();
222 double val0 = val2[
col].real();
229 dzdx = (dzdx * exRelief);
230 dzdy = (dzdy * exRelief);
232 double d = sqrt((dzdx * dzdx) + (dzdy * dzdy) + 1);
233 double costeta = (-(dzdx * cx) - (dzdy * cy) + cz) / d;
238 double value = ambi + difu * costeta;
virtual void setValue(unsigned int c, unsigned int r, const double value, std::size_t b=0)
Sets the attribute value in a band of a cell.
te::gm::Envelope * getExtent()
Returns the geographic extension of the raster data.
TEDATAACCESSEXPORT te::rst::RasterProperty * GetFirstRasterProperty(const DataSetType *dt)
This file contains a class to shadow image generation. Adapted from SPRING.
boost::shared_ptr< DataSetType > DataSetTypePtr
Index into a lookup table.
bool calcLocalGradient(te::rst::Raster *inputRaster, int line, int col, double vmin, double vmax, double &dx, double &dy, double *val)
std::map< std::string, std::string > m_outDsinfo
te::da::DataSourcePtr m_inDsrc
boost::shared_ptr< DataSource > DataSourcePtr
static te::dt::Date dx(2010, 12, 31)
A raster band description.
unsigned int getNumberOfColumns() const
Returns the raster number of columns.
virtual void getValues(unsigned int c, unsigned int r, std::vector< double > &values) const
Returns the imaginary attribute values in all complex bands of a cell.
void setInput(te::da::DataSourcePtr inDsrc, std::string inDsetName, const te::da::DataSetTypePtr &inDsetType)
An utility struct for representing 2D coordinates.
const double & getUpperRightY() const
It returns a constant refernce to the x coordinate of the upper right corner.
#define TE_TR(message)
It marks a string in order to get translated.
std::string m_outRstDSType
An abstract class for raster data strucutures.
int m_srid
Attribute with spatial reference information.
unsigned int getNumberOfRows() const
Returns the raster number of rows.
static te::dt::DateTime d(2010, 8, 9, 15, 58, 39)
double getResolutionX() const
Returns the raster horizontal (x-axis) resolution.
void setParams(double azimuth, double elevation, double relief, double dummy, double vmin, double vmax, double minval, double maxval, unsigned int outputWidth, unsigned int outputHeight, double resxo, double resyo)
Utility functions for the data access module.
This class is designed to declare objects to be thrown as exceptions by TerraLib. ...
std::unique_ptr< te::da::DataSet > inDset
te::rst::Raster * GenerateImage(te::rst::Raster *raster)
void setOutput(std::map< std::string, std::string > &dsinfo, std::string outRstDSType)
unsigned int m_outputWidth
static Raster * make()
It creates and returns an empty raster with default raster driver.
const double & getLowerLeftX() const
It returns a constant reference to the x coordinate of the lower left corner.
double getResolutionY() const
Returns the raster vertical (y-axis) resolution.
void getRasterElementLine(te::rst::Raster *inputRaster, int line, std::vector< std::complex< double > > &val)
te::da::DataSetTypePtr m_inDsetType
A rectified grid is the spatial support for raster data.
unsigned int m_outputHeight
const std::string & getName() const
It returns the property name.