27 #include <terralib_buildconfig.h> 31 #include "../Config.h" 34 #include <boost/test/unit_test.hpp> 35 #include <boost/shared_ptr.hpp> 47 BOOST_CHECK( grid.
getSRID() == 12345 );
57 BOOST_CHECK_CLOSE( 2.0, x, 0.0000000001 );
58 BOOST_CHECK_CLOSE( 2.5, y, 0.0000000001 );
61 BOOST_CHECK_CLOSE( 4.0, x, 0.0000000001 );
62 BOOST_CHECK_CLOSE( 1.5, y, 0.0000000001 );
65 BOOST_CHECK_CLOSE( 0.0, x, 0.0000000001 );
66 BOOST_CHECK_CLOSE( 0.0, y, 0.0000000001 );
69 BOOST_CHECK_CLOSE( 1.0, x, 0.0000000001 );
70 BOOST_CHECK_CLOSE( 1.0, y, 0.0000000001 );
81 BOOST_CHECK( grid.
getSRID() == 12345 );
91 BOOST_CHECK_CLOSE( 0.5, x, 0.0000000001 );
92 BOOST_CHECK_CLOSE( -0.5, y, 0.0000000001 );
95 BOOST_CHECK_CLOSE( 1.5, x, 0.0000000001 );
96 BOOST_CHECK_CLOSE( -1.5, y, 0.0000000001 );
99 BOOST_CHECK_CLOSE( 0.0, x, 0.0000000001 );
100 BOOST_CHECK_CLOSE( 0.0, y, 0.0000000001 );
103 BOOST_CHECK_CLOSE( 1.0, x, 0.0000000001 );
104 BOOST_CHECK_CLOSE( 1.0, y, 0.0000000001 );
119 BOOST_CHECK( grid.
getSRID() == 12345 );
129 BOOST_CHECK_CLOSE( 2.0, x, 0.0000000001 );
130 BOOST_CHECK_CLOSE( 2.5, y, 0.0000000001 );
133 BOOST_CHECK_CLOSE( 4.0, x, 0.0000000001 );
134 BOOST_CHECK_CLOSE( 1.5, y, 0.0000000001 );
137 BOOST_CHECK_CLOSE( 0.0, x, 0.0000000001 );
138 BOOST_CHECK_CLOSE( 0.0, y, 0.0000000001 );
141 BOOST_CHECK_CLOSE( 1.0, x, 0.0000000001 );
142 BOOST_CHECK_CLOSE( 1.0, y, 0.0000000001 );
153 BOOST_CHECK( grid.
getSRID() == 12345 );
163 BOOST_CHECK_CLOSE( 0.5, x, 0.0000000001 );
164 BOOST_CHECK_CLOSE( -0.5, y, 0.0000000001 );
167 BOOST_CHECK_CLOSE( 1.5, x, 0.0000000001 );
168 BOOST_CHECK_CLOSE( -1.5, y, 0.0000000001 );
171 BOOST_CHECK_CLOSE( 0.0, x, 0.0000000001 );
172 BOOST_CHECK_CLOSE( 0.0, y, 0.0000000001 );
175 BOOST_CHECK_CLOSE( 1.0, x, 0.0000000001 );
176 BOOST_CHECK_CLOSE( 1.0, y, 0.0000000001 );
187 BOOST_CHECK( grid.
getSRID() == 12345 );
197 BOOST_CHECK_CLOSE( 2.0, x, 0.0000000001 );
198 BOOST_CHECK_CLOSE( 2.5, y, 0.0000000001 );
201 BOOST_CHECK_CLOSE( 4.0, x, 0.0000000001 );
202 BOOST_CHECK_CLOSE( 1.5, y, 0.0000000001 );
205 BOOST_CHECK_CLOSE( 0.0, x, 0.0000000001 );
206 BOOST_CHECK_CLOSE( 0.0, y, 0.0000000001 );
209 BOOST_CHECK_CLOSE( 1.0, x, 0.0000000001 );
210 BOOST_CHECK_CLOSE( 1.0, y, 0.0000000001 );
221 BOOST_CHECK( grid.
getSRID() == 12345 );
231 BOOST_CHECK_CLOSE( 2.0, x, 0.0000000001 );
232 BOOST_CHECK_CLOSE( 2.5, y, 0.0000000001 );
235 BOOST_CHECK_CLOSE( 4.0, x, 0.0000000001 );
236 BOOST_CHECK_CLOSE( 1.5, y, 0.0000000001 );
239 BOOST_CHECK_CLOSE( 0.0, x, 0.0000000001 );
240 BOOST_CHECK_CLOSE( 0.0, y, 0.0000000001 );
243 BOOST_CHECK_CLOSE( 1.0, x, 0.0000000001 );
244 BOOST_CHECK_CLOSE( 1.0, y, 0.0000000001 );
249 double geoTrans[ 6 ];
254 geoTrans[ 4 ] = -1.0;
263 BOOST_CHECK( grid.
getSRID() == 12345 );
273 BOOST_CHECK_CLOSE( 2.0, x, 0.0000000001 );
274 BOOST_CHECK_CLOSE( 2.5, y, 0.0000000001 );
277 BOOST_CHECK_CLOSE( 4.0, x, 0.0000000001 );
278 BOOST_CHECK_CLOSE( 1.5, y, 0.0000000001 );
281 BOOST_CHECK_CLOSE( 0.0, x, 0.0000000001 );
282 BOOST_CHECK_CLOSE( 0.0, y, 0.0000000001 );
285 BOOST_CHECK_CLOSE( 1.0, x, 0.0000000001 );
286 BOOST_CHECK_CLOSE( 1.0, y, 0.0000000001 );
289 BOOST_AUTO_TEST_SUITE_END()
unsigned int getNumberOfRows() const
Returns the grid number of rows.
int getSRID() const
Returns the grid spatial reference system identifier.
BOOST_AUTO_TEST_CASE(gridConstructor1NoEnv_test)
double m_urx
Upper right corner x-coordinate.
An utility struct for representing 2D coordinates.
void geoToGrid(const double &x, const double &y, double &col, double &row) const
Get the grid point associated to a spatial location.
double getResolutionY() const
Returns the grid vertical (y-axis) resolution.
double m_llx
Lower left corner x-coordinate.
An Envelope defines a 2D rectangular region.
unsigned int getNumberOfColumns() const
Returns the grid number of columns.
double getResolutionX() const
Returns the grid horizontal (x-axis) resolution.
BOOST_AUTO_TEST_SUITE(grid_tests) BOOST_AUTO_TEST_CASE(gridConstructor1_test)
double m_lly
Lower left corner y-coordinate.
double m_ury
Upper right corner y-coordinate.
te::gm::Envelope * getExtent()
Returns the geographic extension of the grid.
void gridToGeo(const double &col, const double &row, double &x, double &y) const
Get the spatial location of a grid point.
This file contains include headers for the Vector Geometry model of TerraLib.
A rectified grid is the spatial support for raster data.