examples/sam/main.cpp
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 main.cpp
22 
23  \brief A list of examples for the TerraLib Spatial Access Methods Module.
24  */
25 
26 #include <terralib_buildconfig.h>
27 
28 // TerraLib
29 #include <terralib/common.h>
30 #include <terralib/geometry.h>
31 #include <terralib/dataaccess.h>
32 
33 
34 // Examples
35 #include "SAMExamples.h"
36 
37 // STL
38 #include <cassert>
39 #include <cstdlib>
40 #include <exception>
41 #include <iostream>
42 
43 int main(int /*argc*/, char** /*argv*/)
44 {
45  try
46  {
48 
49 // R-tree examples
51 
52 // K-d tree examples
54 
56  }
57  catch(const std::exception& e)
58  {
59  std::cout << std::endl << "An exception has occurred: " << e.what() << std::endl;
60 
61  return EXIT_FAILURE;
62  }
63  catch(...)
64  {
65  std::cout << std::endl << "An unexpected exception has occurred!" << std::endl;
66 
67  return EXIT_FAILURE;
68  }
69 
70  return EXIT_SUCCESS;
71 }
Several examples on how to use Spatial Access Methods in TerraLib.
void finalize()
It finalizes the TerraLib Platform.
static TerraLib & getInstance()
It returns a reference to the singleton instance.
void IndexPointUsingRTree()
This example shows how to index a set of points using the R-tree spatial access method.
void initialize()
It initializes the TerraLib Platform.
int main(int, char **)
This file contains include headers for the TerraLib Common Runtime module.
This file contains include headers for the Vector Geometry model of TerraLib.
This file contains include headers for the Data Access module of TerraLib.
void IndexPointUsingKdTree()
This example shows how to index a set of points using the K-d tree spatial access method...