examples/maptools/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 Map Tools.
24  */
25 
26 #include "MapToolsExamples.h"
27 
28 // TerraLib
29 #include <terralib/common.h>
30 #include <terralib/core/plugin.h>
31 #include <terralib/geometry.h>
32 #include <terralib/dataaccess.h>
33 
34 
35 // STL
36 #include <cassert>
37 #include <cstdlib>
38 #include <exception>
39 #include <iostream>
40 #include <locale.h>
41 
42 unsigned int G_ID = 0;
43 
44 int main(int /*argc*/, char** /*argv*/)
45 {
46  setlocale(LC_ALL,"C");
47 
48 // initialize Terralib support
50 
51  try
52  {
53  // It initializes all the data source drivers (see LoadModule.cpp)
54  LoadModules();
55 
56  // Show a MapDisplay
57  MapDisplay();
58 
59  // Creates a OGC Filter Expression and convert it to TerraLib Expression.
60  Filter2Query();
61 
62  // Creates a set of Layers and Styles.
63  //DrawStyledLayers();
64 
65  // Creates a set of raster Layers and Styles.
67  }
68  catch(const std::exception& e)
69  {
70  std::cout << std::endl << "An exception has occurred: " << e.what() << std::endl;
71 
72  return EXIT_FAILURE;
73  }
74  catch(...)
75  {
76  std::cout << std::endl << "An unexpected exception has occurred!" << std::endl;
77 
78  return EXIT_FAILURE;
79  }
80 
82 
84 
85  return EXIT_SUCCESS;
86 }
Include files for Core Plugin Library.
void MapDisplay()
It retrieves data from a data source, create a set of layer and show map display. ...
int main(int, char **)
static PluginManager & instance()
Access the singleton.
void finalize()
It finalizes the TerraLib Platform.
static TerraLib & getInstance()
It returns a reference to the singleton instance.
void DrawRasterStyledLayers()
It draws a set of raster layers using styles encoded using OGC RasterSymbology Enconding specificatio...
void Filter2Query()
It converts a OGC Filter Expression to TerraLib Expression.
void initialize()
It initializes the TerraLib Platform.
This file contains include headers for the TerraLib Common Runtime module.
unsigned int G_ID
This file contains include headers for the Vector Geometry model of TerraLib.
void clear()
Stop and unload all plugins, then clear the internal list of plugins.
This file contains include headers for the Data Access module of TerraLib.
void LoadModules()
Load terralib modules.