All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Config.h
Go to the documentation of this file.
1 /* Copyright (C) 2008-2013 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 terralib/postgis/Config.h
22 
23  \brief Configuration flags for the PostGIS Driver Implementation of TerraLib.
24 */
25 
26 #ifndef __TERRALIB_POSTGIS_INTERNAL_CONFIG_H
27 #define __TERRALIB_POSTGIS_INTERNAL_CONFIG_H
28 
29 #include "../Config.h"
30 
31 /** @name General Defines
32  * Configuring PostGIS support.
33  */
34 //@{
35 
36 /*!
37  \def PGIS_DEFAULT_INITIAL_POOL_SIZE
38 
39  \brief This sets the default initial number of connections opened by a connection pool.
40  */
41 #define PGIS_DEFAULT_INITIAL_POOL_SIZE 4
42 
43 /*!
44  \def PGIS_DEFAULT_MIN_POOL_SIZE
45 
46  \brief This sets the default minimum number of connections to be kept in the pool.
47  */
48 #define PGIS_DEFAULT_MIN_POOL_SIZE 2
49 
50 /*!
51  \def PGIS_DEFAULT_MAX_POOL_SIZE
52 
53  \brief This sets the default maximum number of connections in the pool.
54  */
55 #define PGIS_DEFAULT_MAX_POOL_SIZE 4
56 
57 /*!
58  \def PGIS_DEFAULT_MAX_IDLE_TIME
59 
60  \brief This sets the default maximum time that a connection can be in the pool without being used.
61  */
62 #define PGIS_DEFAULT_MAX_IDLE_TIME 10
63 
64 /*!
65  \def PGIS_DEFAULT_PORT
66 
67  \brief The default port used to connect to a PostgreSQL database server.
68  */
69 #define PGIS_DEFAULT_PORT "5432"
70 
71 /*!
72  \def PGIS_DEFAULT_CONNECT_TIMEOUT
73 
74  \brief The default maximum wait for connection, in seconds.
75  */
76 #define PGIS_DEFAULT_CONNECT_TIMEOUT "4"
77 
78 /*!
79  \def PGIS_DEFAULT_CLIENT_ENCODING
80 
81  \brief The default client encoding when talking with the database.
82  */
83 #define PGIS_DEFAULT_CLIENT_ENCODING "UTF8"
84 
85 /*!
86  \def PGIS_DRIVER_IDENTIFIER
87 
88  \brief The PostGIS driver identifier string.
89  */
90 #define PGIS_DRIVER_IDENTIFIER "POSTGIS"
91 
92 /*!
93  \def TERRALIB_RASTER_DRIVER_IDENTIFIER
94 
95  \brief The TerraLib Raster driver identifier string.
96  */
97 #define TERRALIB_RASTER_DRIVER_IDENTIFIER "TEPG"
98 
99 #define PG_UNKNOW_TYPE -1
100 #define PG_BOOL_TYPE 16
101 #define PG_BYTEA_TYPE 17
102 #define PG_CHAR_TYPE 18
103 #define PG_NAME_TYPE 19
104 #define PG_INT8_TYPE 20
105 #define PG_INT2_TYPE 21
106 #define PG_INT2_VECTOR_TYPE 22
107 #define PG_INT4_TYPE 23
108 #define PG_TEXT_TYPE 25
109 #define PG_OID_TYPE 26
110 #define PG_FLOAT4_TYPE 700
111 #define PG_FLOAT8_TYPE 701
112 #define PG_CHARACTER_TYPE 1042
113 #define PG_VARCHAR_TYPE 1043
114 #define PG_DATE_TYPE 1082
115 #define PG_TIME_TYPE 1083
116 #define PG_TIMETZ_TYPE 1266
117 #define PG_TIMESTAMP_TYPE 1114
118 #define PG_TIMESTAMPTZ_TYPE 1184
119 #define PG_NUMERIC_TYPE 1700
120 #define PG_BOOL_ARRAY_TYPE 1000
121 #define PG_BYTEA_ARRAY_TYPE 1001
122 #define PG_CHAR_ARRAY_TYPE 1002
123 #define PG_NAME_ARRAY_TYPE 1003
124 #define PG_INT8_ARRAY_TYPE 1016
125 #define PG_INT2_ARRAY_TYPE 1005
126 #define PG__INT2_VECTOR_TYPE 1006
127 #define PG_INT4_ARRAY_TYPE 1007
128 #define PG_TEXT_ARRAY_TYPE 1009
129 #define PG_OID_ARRAY_TYPE 1028
130 #define PG_OID_VECTOR_TYPE 1013
131 #define PG_FLOAT4_ARRAY_TYPE 1021
132 #define PG_FLOAT8_ARRAY_TYPE 1022
133 #define PG_CHARACTER_ARRAY_TYPE 1014
134 #define PG_VARCHAR_ARRAY_TYPE 1015
135 #define PG_DATE_ARRAY_TYPE 1182
136 #define PG_TIME_ARRAY_TYPE 1183
137 #define PG_TIMETZ_ARRAY_TYPE 1270
138 #define PG_TIMESTAMP_ARRAY_TYPE 1115
139 #define PG_TIMESTAMPTZ_ARRAY_TYPE 1185
140 #define PG_NUMERIC_ARRAY_TYPE 1231
141 
142 //@}
143 
144 /** @name Internationalization Defines
145  * Flags for TerraLib code internationalization.
146  */
147 //@{
148 
149 /*!
150  \def TE_PGIS_TEXT_DOMAIN
151 
152  \brief It contains the name of the text domain used in the translation of messages in TerraLib PostGIS driver implementation.
153  */
154 #define TE_PGIS_TEXT_DOMAIN "tepostgis"
155 
156 /*!
157  \def TE_PGIS_TEXT_DOMAIN_DIR
158 
159  \brief It contains the translation catalog directory.
160  */
161 #define TE_PGIS_TEXT_DOMAIN_DIR "locale"
162 
163 /*!
164  \def TR_PGIS
165 
166  \brief It marks a string in order to get translated. This is a special mark used in the DataAccess module of TerraLib.
167  */
168 #define TR_PGIS(message) TR(message, TE_PGIS_TEXT_DOMAIN)
169 
170 /*!
171  \def TR_PLURAL_PGIS
172 
173  \brief This mark can be used when you have a plural phrase to be translated. This is a special mark used in the PostGIS module of TerraLib.
174  */
175 #define TR_PLURAL_PGIS(message1, message2, n) TR_PLURAL(TE_PGIS_TEXT_DOMAIN, message1, message2, n)
176 
177 //@}
178 
179 /** @name PostGIS Compatibility Flags
180  * Flags for constructing compatible WKB format with PostGIS
181  */
182 //@{
183 
184 #define TE_EWKB_ZM_OFFSET 0xC0000000
185 #define TE_EWKB_Z_OFFSET 0x80000000
186 #define TE_EWKB_M_OFFSET 0x40000000
187 #define TE_EWKB_SRID_FLAG 0x20000000
188 #define TE_EWKB_BBOX_FLAG 0x10000000
189 
190 //@}
191 
192 /** @name DLL/LIB Module
193  * Flags for building TerraLib as a DLL or as a Static Library
194  */
195 //@{
196 
197 /*!
198  \def TEPGISEXPORT
199 
200  \brief You can use this macro in order to export/import classes and functions from this module.
201 
202  \note If you want to compile TerraLib as DLL in Windows, remember to insert TEPGISDLL into the project's list of defines.
203 
204  \note If you want to compile TerraLib as an Static Library under Windows, remember to insert the TEPGISSTATIC flag into the project list of defines.
205  */
206 #ifdef WIN32
207 
208  #ifdef _MSC_VER
209  #pragma warning( disable : 4251 )
210  #pragma warning( disable : 4275 )
211  #endif
212 
213  #ifdef TEPGISSTATIC
214  #define TEPGISEXPORT // Don't need to export/import... it is a static library
215  #elif TEPGISDLL
216  #define TEPGISEXPORT __declspec(dllexport) // export DLL information
217  #else
218  #define TEPGISEXPORT __declspec(dllimport) // import DLL information
219  #endif
220 #else
221  #define TEPGISEXPORT
222 #endif
223 
224 //@}
225 
226 #endif // __TERRALIB_POSTGIS_INTERNAL_CONFIG_H
227