TsWKBReader.h
Go to the documentation of this file.
1 /* Copyright (C) 2008 National Institute For Space Research (INPE) - Brazil.
2 
3  This file is part of the TerraLib - a Framework for building GIS enabled applications.
4 
5  TerraLib is free software: you can redistribute it and/or modify
6  it under the terms of the GNU Lesser General Public License as published by
7  the Free Software Foundation, either version 3 of the License,
8  or (at your option) any later version.
9 
10  TerraLib is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public License
16  along with TerraLib. See COPYING. If not, write to
17  TerraLib Team at <terralib-team@terralib.org>.
18  */
19 
20 /*!
21  \file TsWKBReader.h
22 
23  \brief Test suite for the geometry WKB Reader.
24  */
25 
26 #ifndef __TERRALIB_UNITTEST_GEOMETRY_INTERNAL_WKBREADER_H
27 #define __TERRALIB_UNITTEST_GEOMETRY_INTERNAL_WKBREADER_H
28 
29 // STL
30 #include <string>
31 #include <vector>
32 
33 // cppUnit
34 #include <cppunit/extensions/HelperMacros.h>
35 
36 /*!
37  \class TsWKBReader
38 
39  \brief Test suite for the WKBReader class.
40 
41  This test suite will check the following:
42  <ul>
43  <li>PostGIS Extended-WKB reading and writing;</li>
44  <li>Official OGC WKB reading/writing;</li>
45  <li>Spatial Operators;</li>
46  <li>Re-projection (transformation of SRS);</li>
47  </ul>
48  */
49 class TsWKBReader : public CPPUNIT_NS::TestFixture
50 {
51 // It registers this class as a Test Suit
53 
54 // It registers the class methods as Test Cases belonging to the suit
58 
60 
61  public:
62 
63 // It sets up context before running the test.
64  void setUp();
65 
66 // It cleann up after the test run.
67  void tearDown();
68 
69  protected:
70 
71 // Test Cases:
72 
73  /*! \brief Test Case: Creating basic Geom and apply read test. */
75 
76  /*! \brief Test Case: Creating basic Geom from WKT and apply read test. */
78 
79  /*! \brief Test Case: testing the basic geometry methods. */
81 
82  private:
83 
84  /* Auxiliary data structure when testing geometry basic methods */
85  struct WKBEntry
86  {
87  std::string m_hwkb; //!<
88  int m_srid; //!<
89  std::string m_geomType; //!<
90  int m_dimensonality; //!<
91  int m_ndims; //!<
92  std::string m_wkt; //!<
93  int m_geomTypeId; //!<
94  bool m_is3D; //!<
95  bool m_isMeasured; //!<
96  };
97 
98  /*!
99  \brief Auxiliary method for reading geometry information from an ASCII file.
100 
101  \param hwkbVec An output vector with geometry information.
102  */
103  void loadGeometry(std::vector<WKBEntry>& hwkbVec) const;
104  void loadWKT(std::vector<std::string>& geom_wkt) const;
105  void loadWKT(std::string filewkt, std::vector<std::string>& geom_wkt) const;
106 
107 };
108 
109 #endif // __TERRALIB_UNITTEST_GEOMETRY_INTERNAL_WKBREADER_H
110 
void loadWKT(std::vector< std::string > &geom_wkt) const
CPPUNIT_TEST_SUITE(TsWKBReader)
void tcBasicGeometryMethods()
Test Case: testing the basic geometry methods.
void setUp()
Definition: TsWKBReader.cpp:40
Test suite for the WKBReader class.
Definition: TsWKBReader.h:49
CPPUNIT_TEST_SUITE_END()
void loadGeometry(std::vector< WKBEntry > &hwkbVec) const
Auxiliary method for reading geometry information from an ASCII file.
void tcCreateGeomFromWKTAndApplyReadTests()
Test Case: Creating basic Geom from WKT and apply read test.
void tcCreateGeometriesAndApplyReadTests()
Test Case: Creating basic Geom and apply read test.
Definition: TsWKBReader.cpp:48
void tearDown()
Definition: TsWKBReader.cpp:44
CPPUNIT_TEST(tcCreateGeomFromWKTAndApplyReadTests)
std::string m_hwkb
Definition: TsWKBReader.h:87
std::string m_geomType
Definition: TsWKBReader.h:89