17 std::string resultString;
18 std::pair<std::string,unsigned int> resultPair;
21 std::string gp4txt =
"proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m";
22 std::string gwkt =
"PROJCS[\"unnamed\",GEOGCS[\"unnamed ellipse\",DATUM[\"unknown\",SPHEROID[\"unnamed\",6378137,0]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433]],PROJECTION[\"Mercator_2SP\"],PARAMETER[\"standard_parallel_1\",0],PARAMETER[\"central_meridian\",0],PARAMETER[\"false_easting\",0],PARAMETER[\"false_northing\",0],UNIT[\"Meter\",1]";
26 CPPUNIT_ASSERT(resultBool);
29 CPPUNIT_ASSERT(!resultString.empty());
32 CPPUNIT_ASSERT(resultString == gp4txt);
35 CPPUNIT_ASSERT(resultString == gwkt);
38 CPPUNIT_ASSERT(resultPair.second == 96 && resultPair.first ==
"sr-org");
41 CPPUNIT_ASSERT(resultPair.second == 96 && resultPair.first ==
"sr-org");
47 CPPUNIT_ASSERT(resultBool ==
false);
52 CPPUNIT_ASSERT(!resultString.empty());
58 CPPUNIT_ASSERT(!resultString.empty());
65 CPPUNIT_ASSERT(resultSRS.get());
71 while(its.first != its.second)
84 CPPUNIT_ASSERT_NO_THROW(converter->setSourceSRID(
TE_SRS_WGS84));
92 converter->convert(xin,yin,xout,yout);
94 CPPUNIT_ASSERT_DOUBLES_EQUAL(500000,xout,0.1);
95 CPPUNIT_ASSERT_DOUBLES_EQUAL(10000000,yout,0.1);
100 converter->invert(xin,yin,xout,yout);
102 CPPUNIT_ASSERT_DOUBLES_EQUAL(-45.0,xout,0.001);
103 CPPUNIT_ASSERT_DOUBLES_EQUAL(0.0,yout,0.001);
108 converter->convert(xin,yin);
110 CPPUNIT_ASSERT_DOUBLES_EQUAL(500000,xin,0.1);
111 CPPUNIT_ASSERT_DOUBLES_EQUAL(10000000,yin,0.1);
117 CPPUNIT_ASSERT_DOUBLES_EQUAL(-45.0,xin,0.001);
118 CPPUNIT_ASSERT_DOUBLES_EQUAL(0.0,yin,0.001);
124 CPPUNIT_ASSERT_DOUBLES_EQUAL(500000,xin,0.1);
125 CPPUNIT_ASSERT_DOUBLES_EQUAL(10000000,yin,0.1);
127 std::vector<double> vxin;
128 std::vector<double> vyin;
130 vxin.push_back(-45.0); vxin.push_back(-45.0); vxin.push_back(-45.0);
131 vyin.push_back(0); vyin.push_back(0); vyin.push_back(0);
133 std::vector<double> vxout; vxout.resize(3);
134 std::vector<double> vyout; vyout.resize(3);
136 converter->convert(&vxin[0],&vyin[0],&vxout[0],&vyout[0],3);
138 CPPUNIT_ASSERT_DOUBLES_EQUAL(500000,vxout[0],0.1);
139 CPPUNIT_ASSERT_DOUBLES_EQUAL(10000000,vyout[0],0.1);
140 CPPUNIT_ASSERT_DOUBLES_EQUAL(500000,vxout[1],0.1);
141 CPPUNIT_ASSERT_DOUBLES_EQUAL(10000000,vyout[1],0.1);
142 CPPUNIT_ASSERT_DOUBLES_EQUAL(500000,vxout[2],0.1);
143 CPPUNIT_ASSERT_DOUBLES_EQUAL(10000000,vyout[2],0.1);
145 converter->convert(&vxin[0],&vyin[0],3);
147 CPPUNIT_ASSERT_DOUBLES_EQUAL(500000,vxin[0],0.1);
148 CPPUNIT_ASSERT_DOUBLES_EQUAL(10000000,vyin[0],0.1);
149 CPPUNIT_ASSERT_DOUBLES_EQUAL(500000,vxin[1],0.1);
150 CPPUNIT_ASSERT_DOUBLES_EQUAL(10000000,vyin[1],0.1);
151 CPPUNIT_ASSERT_DOUBLES_EQUAL(500000,vxin[2],0.1);
152 CPPUNIT_ASSERT_DOUBLES_EQUAL(10000000,vyin[2],0.1);
This file contains include headers for TerraLib Spatial Reference System module.
boost::multi_index::nth_index< srs_set, 0 >::type::iterator iterator
An iterator by SRS <id,authority>
#define TE_SRS_WGS84_UTM_ZONE_25S
static SpatialReferenceSystemManager & getInstance()
It returns a reference to the singleton instance.
std::unique_ptr< SpatialReferenceSystem > SpatialReferenceSystemPtr
#define TE_SRS_WGS84_UTM_ZONE_23S
void tearDown()
It finalizes the environment after a test case (actually a method) had run.
A Converter is responsible for the conversion of coordinates between different Coordinate Systems (CS...
void setUp()
It sets the environment for a test case (actually a method).
This file contains include headers for the TerraLib Common Runtime module.
CPPUNIT_TEST_SUITE_REGISTRATION(TsSrs)